Skip to content

adding new geothermal bedrock - #152

Draft
Eleanor Burke (eleanorgb) wants to merge 11 commits into
MetOffice:mainfrom
eleanorgb:76_geothermal_heat_flux
Draft

adding new geothermal bedrock#152
Eleanor Burke (eleanorgb) wants to merge 11 commits into
MetOffice:mainfrom
eleanorgb:76_geothermal_heat_flux

Conversation

@eleanorgb

@eleanorgb Eleanor Burke (eleanorgb) commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

PR Summary

#76

Fixing bug in bedrock and adding a geothermal heat flux at bottom

Sci/Tech Reviewer:
Code Reviewer:

(https://github.com/MetOffice/um/issues/127)

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • If editing rose-meta/jules-shared then have you supplied a linked UM and LFRic Apps PR?

Ive added a UM PR.

Testing

  • I have tested this change locally, using the JULES rose-stem suite
  • If shared files have been modified, I have run the UM and LFRic Apps rose stem suites
  • If any tests fail (rose-stem or CI) the reason is understood and acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system tests, unit tests, etc.)

I will add tests when Ive added a few more upates to cover all of them.

trac.log

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and confirmed that it builds correctly

Approvals

Please request all relevant approvals. See the CodeOwners.txt file for section owners.

Technical

  • JULES Code Owner
  • OpenMP
  • River Routing
  • Rose Stem
  • Rose Metadata
  • Upgrade Macros

Scientific

  • Surface
  • Hydrology
  • Vegetation
  • Veg3 RED Demography
  • Biogeochemistry
  • Biogenic fluxes
  • Fire
  • Lakes
  • Evaluation
  • Imogen

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

Please alert the code reviewer via a tag when you have approved the SR

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

@github-actions github-actions Bot added the cla-required The CLA has not yet been signed by the author of this PR - added by GA label Aug 27, 2026
@eleanorgb Eleanor Burke (eleanorgb) linked an issue Aug 27, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for a geothermal heat flux lower boundary condition for the bedrock thermal diffusion column, including a numerical correction accumulator to reduce rounding drift in deep-soil temperatures.

Changes:

  • Add hflux_geo (geothermal heat flux) to jules_soil namelist, Rose metadata, documentation, and an upgrade macro.
  • Extend bedrock temperature integration to apply a basal flux and track an accumulated numerical correction term (dtsd_acc_gb) through the call chain.
  • Adjust standalone dimension sizing/prognostics to carry the new bedrock correction state.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/science/soil/soil_htc_jls_mod.F90 Passes new accumulated-correction array through soil_htc into bedrock.
src/science/soil/hydrol_jls_mod.F90 Threads dtsd_acc_gb through the hydrology → soil heat coupling call path.
src/science/soil/bedrock_jls_mod.F90 Implements geothermal basal flux term and accumulated numerical correction in bedrock temperature update.
src/initialisation/standalone/grid/init_dim_sizes_mod.F90 Updates standalone IO dimension sizing logic for the bedrock dimension.
src/control/shared/surf_couple_extra_mod.F90 Adds dtsd_acc_gb to the coupled surf/hydrol argument list.
src/control/shared/prognostics.F90 Allocates/associates the new prognostic dtsd_acc_gb array.
src/control/shared/jules_soil_mod.F90 Introduces hflux_geo namelist parameter and related validation/printing.
rose-meta/jules-standalone/versions.py Adds an upgrade macro intended to introduce hflux_geo into existing apps.
rose-meta/jules-standalone/HEAD/rose-meta.conf Adds Rose metadata entry and trigger for hflux_geo.
doc/source/namelists/jules_soil.nml.rst Documents hflux_geo and updates bedrock parameter defaults.
Suppressed comments (1)

src/control/shared/jules_soil_mod.F90:320

  • hflux_geo is initialised to rmdi, but the current validation treats it as having a 0.0 default and will report a confusing out-of-range error if it is unset. Add an explicit 'not found' check (like the other bedrock parameters) before the range check, and update the comment accordingly.
  IF (hflux_geo < -0.052 .OR. hflux_geo > 15.6 ) THEN
    CALL ereport(RoutineName, errorstatus,                                     &
                   'hflux_geo must lie in the range -0.052 to 15.6 W/m2')

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/initialisation/standalone/grid/init_dim_sizes_mod.F90 Outdated
Comment thread src/control/shared/prognostics.F90
Comment thread src/control/shared/jules_soil_mod.F90 Outdated
Comment thread rose-meta/jules-standalone/HEAD/rose-meta.conf Outdated
Comment thread doc/source/namelists/jules_soil.nml.rst Outdated
Comment thread doc/source/namelists/jules_soil.nml.rst Outdated
Comment thread rose-meta/jules-standalone/versions.py
Comment thread src/science/soil/bedrock_jls_mod.F90
@eleanorgb Eleanor Burke (eleanorgb) added this to the Autumn 2026 milestone Aug 28, 2026
@github-actions github-actions Bot added cla-signed The CLA has been signed as part of this PR - added by GA and removed cla-required The CLA has not yet been signed by the author of this PR - added by GA labels Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Suppressed comments (3)

Previously missed (3) — in code that hasn't changed since the last review.

src/control/shared/jules_soil_mod.F90:293

  • The soil-tiling compatibility check uses nsoilt, but check_jules_soil() is called during namelist read (e.g., standalone init_soil) before nsoilt is set by dimension initialisation, so this will usually still be 1 and won’t catch an incompatible l_tile_soil configuration.
  ELSE IF ( nsoilt > 1 ) THEN
    CALL ereport(RoutineName, errorstatus,                                     &
              'Bedrock not yet compatible with soil tiling')
  END IF

rose-meta/jules-standalone/HEAD/rose-meta.conf:4711

  • Unit formatting for hflux_geo is inconsistent with nearby entries (e.g., hcondeep uses W m-1 K-1). Prefer the same style here (e.g., W m-2) for consistency across the rose metadata.
description=Geothermal heat flux (W/m2)

rose-meta/jules-standalone/versions.py:50

  • The macro docstring still contains placeholder text ("by Author"), which makes the upgrade history harder to audit. Consider updating it to describe the actual purpose (ticket/feature) instead.
    """Upgrade macro from JULES by Author"""

Comment on lines 58 to 61
# Add settings
self.add_setting(config, ["namelist:jules_soil", "hflux_geo"], "0.067")
self.change_setting_value(config, ["namelist:jules_soil", "hcondeep"], "3.0")
return config, self.reports
Comment on lines 414 to +421
ALLOCATE(progs_data%tsoil_deep_gb(land_pts,ns_deep))
progs_data%tsoil_deep_gb(:,:) = 0.0
ALLOCATE(progs_data%dtsd_acc_gb(land_pts,ns_deep))
ELSE
ALLOCATE(progs_data%tsoil_deep_gb(1,1))
ALLOCATE(progs_data%dtsd_acc_gb(1,1))
END IF
progs_data%dtsd_acc_gb(:,:) = 0.0
progs_data%tsoil_deep_gb(:,:) = 0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The CLA has been signed as part of this PR - added by GA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a geothermal heat flux

5 participants