Skip to content

Conversation

@billsacks
Copy link
Member

@billsacks billsacks commented Dec 24, 2025

Description of changes

Rather than having med_methods_FB_init accept one of fieldNameList or
STflds, now it accepts an array of med_field_info_type objects.
med_field_info_type is defined in a new module that also includes some
creation methods, making calls to med_methods_FB_init a two-step
process: first create field_info_array, then call med_methods_FB_init
with this field_info_array.

A key new feature is that the creation of a field_info_array from
field_names will assume a single ungridded dimension with size given by
shr_wtracers_get_num_tracers for any field with the water tracer suffix.
This was the main motivation for the refactor here.

Some specific notes about the changes in this commit:

  • Behavior change: if there are only scalar or blank fields, we do some
    unnecessary work now (retrieving the mesh that we won't end up ever
    using)
  • I think I got the gridToFieldMap right: before it was hard-coded to 2,
    but I think that was only right for a single ungridded dimension; here
    I'm generalizing that for multiple ungridded dimensions

This depends on the CESM_share changes in ESCOMP/CESM_share#78

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)? No

Testing performed

Please describe the tests along with the target model and machine(s)
If possible, please also added hashes that were used in the testing

Ran a subset of the CESM prealpha tests with baseline comparisons, using cesm3_0_alpha08a with this CMEPS branch and the share branch from ESCOMP/CESM_share#78:

ERS_D_Ld3.ne30pg3_t232.B1850C_LTso.derecho_intel.allactive-defaultio
ERI.ne30pg3_t232.B1850C_LTso.derecho_intel.allactive-defaultio
ERC_D_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq9s
ERS_Ly7.f09_g17_gris4.T1850Gg.derecho_intel
SMS_Lm13.f10_f10_mg37.I1850Clm50SpG.derecho_intel
MULTINOAIS_Ly2.f10_f10_ais8gris4_mg37.I1850Clm50SpRsGag.derecho_intel.cism-change_params
SMS_D_Ld1.ne30pg3_t232.I1850Clm50BgcSpinup.derecho_intel.clm-cplhist
ERI.TL319_t232.G_JRA.derecho_intel.cice-default
SMS_D.TL319_t232.G_JRA_RYF.derecho_intel
SMS_Ld40.TL319_t232.C_JRA.derecho_intel

All tests pass and are bit-for-bit with the baselines.

There were NLCOMP failures in some tests; from spot-checking, the NLCOMP failures all seem to be in MOM files. Nothing in this PR or the accompanying share PR could change the namelists, so I assume these are a pre-existing issue:

    FAIL ERI.ne30pg3_t232.B1850C_LTso.derecho_intel.allactive-defaultio NLCOMP
    FAIL ERI.TL319_t232.G_JRA.derecho_intel.cice-default NLCOMP
    FAIL ERS_D_Ld3.ne30pg3_t232.B1850C_LTso.derecho_intel.allactive-defaultio NLCOMP
    FAIL SMS_D.TL319_t232.G_JRA_RYF.derecho_intel NLCOMP
    FAIL SMS_Ld40.TL319_t232.C_JRA.derecho_intel NLCOMP

Rather than having med_methods_FB_init accept one of fieldNameList or
STflds, now it accepts an array of med_field_info_type objects.
med_field_info_type is defined in a new module that also includes some
creation methods, making calls to med_methods_FB_init a two-step
process: first create field_info_array, then call med_methods_FB_init
with this field_info_array.

A key new feature is that the creation of a field_info_array from
field_names will assume a single ungridded dimension with size given by
shr_wtracers_get_num_tracers for any field with the water tracer suffix.
This was the main motivation for the refactor here.

Some specific notes about the changes in this commit:
- Behavior change: if there are only scalar or blank fields, we do some
  unnecessary work now (retrieving the mesh that we won't end up ever
  using)
- I think I got the gridToFieldMap right: before it was hard-coded to 2,
  but I think that was only right for a single ungridded dimension; here
  I'm generalizing that for multiple ungridded dimensions
We haven't set that up here; we'll fix this in an upcoming set of
changes.
@billsacks billsacks requested a review from mvertens December 24, 2025 02:03
@billsacks
Copy link
Member Author

The build-cmeps workflow will fail here until ESCOMP/CESM_share#78 is merged... then we can try rerunning it at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant