Repository navigation
New med_enthalpy_mod, plus a multi-instance fix for the branch-run pointer check - #716
Merged
Merged
Conversation
billsacks
approved these changes
Oct 21, 2026
billsacks
left a comment
Member
There was a problem hiding this comment.
Approving based on a cursory look at the enthalpy changes and a somewhat more careful look at the buildnml changes for multi-instance branch cases.
Member
|
@mvertens - I'm approving this but, given the conservative period we're in with the run-up to the CESM release, I want to get feedback from a few other people about what testing we want to do here before merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR creates a new med_enthalpy_mod, plus a multi-instance fix for the branch-run pointer check.
1. Move enthalpy flux calculations into a new med_enthalpy_mod
The enthalpy flux code was split across
med_phases_prep_ocn_modandmed_phases_prep_atm_mod, with shared state duplicated between them. This collects it into a single new module,med_enthalpy_mod.What was wrong
component_computes_enthalpy_fluxexisted as two independent module variables, one in each prep module, each populated by its ownNUOPC_CompAttributeGetcall.global_htot_corrandglobal_hrof_corrlived inmed_phases_prep_atm_modbut were computed by routines invoked frommed_phases_prep_ocn_mod.med_phases_prep_ocn_modhad touse med_phases_prep_atm_modfrom inside two of its subroutines, giving prep_ocn a dependency on prep_atm purely for enthalpy.What this does
mediator/med_enthalpy_mod.F90holding all five enthalpy routines and one copy of each shared variable.med_enthalpy_init, which performs the attribute read that was previously duplicated in both prep modules. Called frommed_phases_prep_ocn_initandmed_phases_prep_atm.The module is not named
med_phases_*because it contains no NUOPC run phases; it follows themed_io_mod/med_methods_modconvention instead.Interface change
med_phases_prep_atm_modno longer exports:med_phases_prep_atm_enthalpy_correctionmed_phases_prep_atm_enthalpy_runoffThese become
med_enthalpy_correctionandmed_enthalpy_runoffinmed_enthalpy_mod, alongsidemed_enthalpy_init,med_enthalpy_med_computationandmed_enthalpy_atm_computation. The modulealso makes
component_computes_enthalpy_flux,global_htot_corrandglobal_hrof_corrpublic, as they are now shared rather than private to prep_atm.2. Fix the branch-run DRV_RESTART_POINTER check for multi-instance cases
The check in
cime_config/buildnmlconstructed the expected pointer name asTesting
This exact code was tested in noresm using the prealpha test suite and all tests passed and were bit-for-bit
<fill in: which test suite, which machine/compiler, bit-for-bit vs. baseline>
🤖 Generated in collaboration with Claude Code