Skip to content

Conversation

@billsacks
Copy link
Member

Description of changes

The calculation of qsat in the atm-ocn fluxes was recently changed to use the shr_wv_sat module. However, NorESM would like to continue to use the old formulation for now. This PR reintroduces the old code and introduces a new config variable that controls whether to use the old or new formulation for qsat.

The goal here is to allow NorESM and CESM to use the same code, so that @mvertens doesn't need to maintain a separate fork of CMEPS for NorESM. For now, NorESM will need a one-line difference in the namelist definition file, setting the default value of aofluxes_use_shr_wv_sat to false instead of true.

Note that this only applies to ocn_surface_flux_scheme = 0 (Large) or 1 (COARE) (but see #624 regarding extending this at some point).

This PR also renames some arguments in the calls to shr_wv_sat_qsat_liquid to better match the argument names in that subroutine.

Specific notes

Contributors other than yourself, if any:

CMEPS Issues Fixed (include github issue #):

Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial) No - bfb

Any User Interface Changes (namelist or namelist defaults changes)? Adds new namelist flag, aofluxes_use_shr_wv_sat.

Testing performed

Ran these tests in the context of cesm3_0_alpha08a (but with share code updated to the latest, since that's a dependency of the latest CMEPS):

ERS_D_Ld3.ne30pg3_t232.B1850C_LTso.derecho_intel.allactive-defaultio
SMS_Ld1.ne30_ne30_mg17.FC2010climo.derecho_intel.cam-outfrq1d
ERP_D_Ln9.ne30pg3_ne30pg3_mt232.F1850C_MTso.derecho_intel.cam-outfrq9s

I ran 4 versions of these tests:

  • ocn_surface_flux_scheme = 0, aofluxes_use_shr_wv_sat = true (out-of-the-box defaults): bit-for-bit
  • ocn_surface_flux_scheme = 1, aofluxes_use_shr_wv_sat = true, comparing against baselines with ocn_surface_flux_scheme = 1: bit-for-bit
  • ocn_surface_flux_scheme = 0, aofluxes_use_shr_wv_sat = false: changes answers, as expected
  • ocn_surface_flux_scheme = 1, aofluxes_use_shr_wv_sat = false, comparing against baselines with ocn_surface_flux_scheme = 1: changes answers as expected

This currently isn't used but will be in an upcoming commit
Use shr_wv_sat_qsat_liquid if aofluxes_use_shr_wv_sat is true, otherwise
use the old, inline formulation.

This just applies to the Large and COARE formulations.
@billsacks
Copy link
Member Author

@mvertens - I'd welcome a careful review from you here to make sure that this is going to integrate smoothly into the noresm branch, since the main point of this PR is to facilitate merging the noresm branch with the main ESCOMP branch. I have double-checked this reinstated code against what's in the NorESM branch, but in addition to reviewing the code, can you please test to confirm that this is bit-for-bit with the NorESM code when you set the new config variable to false?

@jiang-zhu - I'd welcome your double-check of the changes I made to your recent edits in the flux modules to make sure this looks right.

@megandevlan - as CESM code owner of the flux routines, I'd welcome whatever level of review you want to give this, from detailed review to just deferring to the other reviewers here... up to you.

Copy link
Collaborator

@mvertens mvertens left a comment

Choose a reason for hiding this comment

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

Thanks @billsacks. These changes look great.

@mvertens
Copy link
Collaborator

@billsacks - thanks so much for this PR. I've reviewed it and the changes look great. I'm just wondering what the next steps are for the NorESMhub and ESCOMP CMEPS versions to be brought more closely together.

@billsacks
Copy link
Member Author

billsacks commented Jan 11, 2026

Thanks, @mvertens . I have made a branch where I've merged the latest escomp changes into the noresm branch. That includes both the recent changes in escomp/main and the changes in this PR. I think that's the first step to getting these reconciled. I'm opening a PR into the noresm branch for that: NorESMhub#45. Once we get that in, we should talk about the next steps... I'm not fully sure of it myself, but am happy to talk it through with you.

billsacks added a commit to billsacks/CMEPS that referenced this pull request Jan 11, 2026
This is the branch from ESCOMP#625

Resolved Conflicts:
	cesm/flux_atmocn/flux_atmocn_COARE_mod.F90
	cesm/flux_atmocn/flux_atmocn_Large.F90
	cime_config/namelist_definition_drv.xml
3.9 is now the minimum supported by CIME
@billsacks
Copy link
Member Author

@jedwards4b - note that I just pushed a commit to this branch that changes the python 3.8 testing to 3.9 in srt.yml since CIME's minimum python version is now 3.9.

@megandevlan
Copy link
Collaborator

This looks great to me as well!

3.9 gives a warning, which seems to create a error in the GitHub
testing. So instead of 3.9 and 3.11, use 3.10 and 3.12.
@billsacks
Copy link
Member Author

@jedwards4b - I actually changed srt.yml to test python 3.10 and 3.12: 3.9 generated a warning which apparently causes errors in the GitHub testing. Since I was bumping 3.9 to 3.10, I also bumped 3.11 to 3.12 to have a broader set of versions.

@jedwards4b
Copy link
Collaborator

@billsacks I just asked for your review of a PR that fixes the issues with python 3.9.

Otherwise it's interpreted as 3.1
Copy link
Collaborator

@jedwards4b jedwards4b left a comment

Choose a reason for hiding this comment

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

A couple of suggestions.

@mvertens
Copy link
Collaborator

@jedwards4b - these are both really good suggestions.

@billsacks
Copy link
Member Author

I agree - these are both great suggestions, @jedwards4b . I'll add code to write the value to the log file. I can take a stab at adding a comment, but would love feedback from both of you (@jedwards4b and @mvertens ) if you have any thoughts about what that comment should look like based on your understanding of the background/history.

@mvertens
Copy link
Collaborator

@billsacks - for the NorESM branch you can write that 'This option is currently being used by NorESM'. I'm not sure I would add that further validation needs to be done to adopt the changes for using the share code for now. Does that sound reasonable?

@billsacks
Copy link
Member Author

Sounds good - thanks, @mvertens . I think I'll also add that it is the historical option that was used for a long time prior to the recent change in Oct, 2025.

@mvertens
Copy link
Collaborator

@billsacks - perfect.

@billsacks
Copy link
Member Author

@jiang-zhu gave approval via email, so I'm going ahead and merging this.

@billsacks billsacks merged commit 35f4fc1 into ESCOMP:main Jan 15, 2026
4 checks passed
@billsacks billsacks deleted the shr_flux_namelist branch January 15, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants