Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
97ed1fe
addition of BLOM logic to key XML settings like CPL_SEQ_OPTION
mvertens May 25, 2023
1912caf
Merge commit '97ed1fe' into feature/add_blom_settings
mvertens May 25, 2023
6563613
Merge tag 'cmeps0.14.32' into feature/add_blom_settings
mvertens May 25, 2023
48c247f
made ogrid default for aoflux calculation - since xgrid crashes for f…
mvertens May 25, 2023
4140d54
Merge pull request #6 from mvertens/feature/add_blom_settings
mvertens May 26, 2023
4fffe1b
changes to have mediator compute dms fluxes
mvertens Jun 15, 2023
9d3b104
added BGC mode to DMS qualifier
Jun 16, 2023
abbcf7e
added more comments
Jun 16, 2023
1396644
fixed an issue in the PR
Jun 16, 2023
7defa6e
addressed issues in PR
Jun 19, 2023
37f203f
removed blank spaces
Jun 19, 2023
f134960
Merge pull request #9 from mvertens/feature/dms_flux_frmed
mvertens Jun 19, 2023
b199f43
addition of atm_ncpl for ww3dev
mvertens Jul 17, 2023
621620f
added comment suggest in PR review
mvertens Jul 17, 2023
0bc7dbf
Merge pull request #10 from mvertens/feature/ww3dev_udpate
mvertens Jul 17, 2023
e93174f
added to fields from ww3dev for mediator history output
mvertens Oct 12, 2023
a834c1f
changes needed to merge cime to latest changes
mvertens Oct 16, 2023
9e4773e
Merge branch 'feature/update_cmeps' into feature/new_flds_to_cmeps
mvertens Oct 16, 2023
be61af7
addressed issues in PR review
mvertens Oct 16, 2023
f3c5073
Merge pull request #12 from mvertens/feature/new_flds_to_cmeps
gold2718 Oct 24, 2023
205b8a9
made histaux_wav2med_file1_enabled an ALLCOMPS attribute that can be …
mvertens Oct 25, 2023
499a6e9
Merge branch 'noresm' into feature/new_flds_to_cmeps
mvertens Oct 25, 2023
052c47d
Merge pull request #13 from mvertens/feature/new_flds_to_cmeps
mvertens Dec 4, 2023
ae3e514
updates for new ww3 auxiliary swell fields
mvertens Dec 4, 2023
faf00ec
Merge branch 'noresm' into feature/averaging_for_partitions
mvertens Dec 4, 2023
fe91055
changes for new ww3dev auxiliary fiel
mvertens Dec 4, 2023
65f2eaf
updates for new averaging for fields sent to mediator from ww3dev for…
mvertens Dec 5, 2023
71bfe7a
updated comment
mvertens Dec 6, 2023
8a98342
removed duplicate <desc> fields
mvertens Dec 6, 2023
8213a0e
Merge pull request #14 from mvertens/feature/averaging_for_partitions
mvertens Dec 6, 2023
0c007a2
obtain 10m u,v from atm and pass it to ww3d
mvertens Jan 4, 2024
2af2904
changes for additional tracers from lnd to rof
mvertens Feb 7, 2024
62f7692
export state to glc added to lnd2glc auxiliary file
mvertens Feb 19, 2024
2ff28de
Merge pull request #16 from mvertens/feature/pass_10mwind_to_ww3
gold2718 Feb 27, 2024
c87ad2f
Merge pull request #19 from mvertens/feature/new_lnd2glc_auxfile
mvertens Mar 8, 2024
b0434b4
removed changes introduced to compute dms fluxes in mediator
mvertens Mar 9, 2024
0b8d0fb
Merge branch 'main' into feature/back_out_dms_changes
mvertens Apr 10, 2024
88e32fd
more updates to cmeps
mvertens Apr 10, 2024
e2b453e
more updates to cmeps
mvertens Apr 10, 2024
f81d357
fix problems in prealpha_noresm testing
mvertens Apr 10, 2024
d135280
updates for different fields to be sent to ww3
Apr 17, 2024
d823721
Merge commit 'd135280e' into feature/update_noresm_to_cmeps0.14.60
Apr 17, 2024
efacee4
fixed typo
mvertens Apr 25, 2024
f61fc1d
Merge pull request #22 from mvertens/feature/update_noresm_to_cmeps0.…
mvertens Apr 25, 2024
9a575aa
Merge branch 'noresm' into feature/update_dms_exchange
mvertens Oct 1, 2024
edcb646
updated to cmeps1.0.20
mvertens Oct 1, 2024
1d456df
Merge pull request #24 from mvertens/feature/update_dms_exchange
mvertens Oct 1, 2024
130a59d
update to noresm head
mvertens Oct 16, 2024
6bc9b06
changes to get tracers to be updated correctly
mvertens Nov 1, 2024
e3994d4
new lnd2med aux files
mvertens Nov 6, 2024
ab0854b
fixes for more than 1 additional liquid tracer
mvertens Nov 21, 2024
9dce503
Merge tag 'cmeps1.0.24' into feature/update_to_cmeps1.0.24
mvertens Nov 24, 2024
dd6f548
backed out two changes temporarily until new esmf6.0.1 library is bui…
mvertens Nov 24, 2024
f8fca11
updated to exactly match cmeps1.0.24 - required update of esmf to esm…
mvertens Nov 26, 2024
bf60775
update to have ogrid be the default since xgrid does not work for ne3…
mvertens Nov 28, 2024
d4334dc
changes to get data2glc working correctly
mvertens Dec 2, 2024
b44e4ee
fixed problem in med_phases_prep_glc_mod for days greater than the fi…
mvertens Dec 3, 2024
c3be965
new docn for multilev
mvertens Dec 8, 2024
fb2bb20
Adjust eps_imesh for tnx2 grid in namelist to omit crash at mesh chec…
jmaerz Mar 7, 2025
975bba5
adopt default value according to ice_mesh_mod.F90
jmaerz Mar 7, 2025
52031c9
update to cmeps1.0.39
mvdebolskiy Mar 7, 2025
0faef8b
Merge pull request #27 from jmaerz/fix_cice_mesh
gold2718 Mar 7, 2025
3ee4735
Make datm timesteps smaller for ww3
mvdebolskiy Mar 19, 2025
91d933c
Merge commit '0faef8b5a5d28b0ce1f929ebb21d528ad9c9fc33' into rpointer…
mvdebolskiy Mar 20, 2025
8b93a82
Merge pull request #29 from mvdebolskiy/rpointers-update-cmeps
mvdebolskiy Mar 20, 2025
d551b22
Merge tag 'cmeps1.0.39_noresm_v0' into feature/additional_liquid_tracers
mvertens Mar 31, 2025
5d4e729
renamed shr_lnd2rof_tracers.F90
mvertens Apr 10, 2025
d4b356e
Merge tag 'cmeps1.0.39_noresm_v0' into feature/add_aux_docn_multilev
mvertens Apr 10, 2025
062b0c0
some merge updates
mvertens Apr 10, 2025
9350261
added new logic to set set_histaux_l2x1yrg to .true. if compset inclu…
mvertens Apr 11, 2025
d1725ae
fixed compile problem
mvertens Apr 11, 2025
f42ffef
fixed logic for ocn2glc_coupling
mvertens Apr 16, 2025
133bd17
Fix ERS tests
mvdebolskiy Apr 19, 2025
cbf5e5e
add defaults for multilev ocn2glc
mvdebolskiy Apr 19, 2025
fa28237
Merge pull request #30 from mvertens/feature/add_aux_docn_multilev
mvdebolskiy Apr 22, 2025
5ad5ec2
buildnml now reads drv_flds_in after creation and determine if lnd (c…
mvertens Apr 23, 2025
7fead40
Merge tag 'cmeps1.0.39_noresm_v1' into feature/additional_liquid_tracers
mvertens Apr 24, 2025
19122da
fixed output of optional line to user_nl_cpl
mvertens Apr 24, 2025
215bbd0
fixed problem in namelist generation
mvertens Apr 27, 2025
e6b0622
fixes to get DLND%RCPL mode working with mosart
mvertens May 13, 2025
a855ba4
changes required for BLOM
mvertens May 29, 2025
b4b21b6
fixes for ocn_flux_shemes 1 and 2 to work
mvertens May 31, 2025
f10aa2a
Merge pull request #32 from mvertens/feature/additional_liquid_tracers
mvdebolskiy May 31, 2025
a530175
fix CPL_ALBAV to be TRUE for BLOM with CORE forcing
mvertens May 31, 2025
8cb8419
Merge branch 'noresm' into feature/fixes_for_blom
mvertens Jun 1, 2025
63d8b55
fixed regular expression for tnx2 matching
mvertens Jun 1, 2025
dc13a28
Merge pull request #34 from mvertens/feature/fixes_for_blom
mvertens Jun 2, 2025
d4b7a35
fix accum call on initialization
mvdebolskiy Jun 9, 2025
45b7b16
Merge remote-tracking branch 'origin/noresm' into try-to-fix-glc
mvdebolskiy Jun 9, 2025
a9e46c8
update comment
mvdebolskiy Jun 10, 2025
691e72e
Merge pull request #35 from mvdebolskiy/try-to-fix-glc
mvdebolskiy Jun 10, 2025
868c4e5
Added options for enthalpy correction programmed by indicate Peter La…
Jun 14, 2025
ae2d923
Adding Alok's fixed file for the fco2 land flux mediation
maritsandstad Aug 11, 2025
e1c588c
Merge pull request #37 from maritsandstad/add-aloks-flux-pass-change
mvdebolskiy Aug 11, 2025
2e415fd
Merge tag 'cmeps1.0.39_noresm_v4' into CMEPS_eneplusZM_mods
mvertens Aug 15, 2025
5970f65
refactor of enthalpy from cam
mvertens Aug 17, 2025
d427817
Enable COARE for fully coupled NorESM compsets
TomasTorsvik Aug 18, 2025
f822a7d
Merge pull request #39 from NorESMhub/pr-enable_coare
TomasTorsvik Aug 18, 2025
c8aed5e
make rof and ocn coupling periods align for 2 deg
mvdebolskiy Aug 27, 2025
fe2fe6f
add comment
mvdebolskiy Aug 28, 2025
2910de8
Merge pull request #40 from mvdebolskiy/fix/mosart-ocn-2deg-cpl
mvdebolskiy Aug 30, 2025
84c3eb3
fixed budget calculations
mvertens Sep 1, 2025
6efc995
scaling of hmat by ofrac in med_diag_mod.F90
mvertens Sep 16, 2025
9cc219d
Merge tag 'cmeps1.0.39_noresm_v7' into feature/cam_computes_enthalpy
mvertens Sep 17, 2025
a6bc075
Add Taylor et al. (1996) ocean albedo scheme as an option (idea and o…
matsbn Sep 18, 2025
5e9d20b
Write log messages to mediator log file and correct error check.
matsbn Sep 18, 2025
257b47a
Merge pull request #41 from matsbn/feature-ocean_albedo_schemes - Add…
mvertens Sep 18, 2025
4bdf713
fixed budget tables for budget_table_version=v2
mvertens Oct 4, 2025
af2c14c
added new v2 logicals that were missing
mvertens Oct 4, 2025
dd3e769
changed default to false for atm_computes_enthalpy
mvertens Oct 4, 2025
f2ba901
added comment
mvertens Oct 5, 2025
4b87c46
Merge tag 'cmeps1.0.39_noresm_v8' into feature/cam_computes_enthalpy
mvertens Oct 8, 2025
6c90dd3
changed config variable to enable from cam versus computation in medi…
mvertens Oct 10, 2025
d60646c
new modules for different atmocn flux schemes
Oct 13, 2025
ce9bfd2
fixed issue from PR review
Oct 15, 2025
561efe7
fixed problem in how ocn2glc coupling was handled
Oct 15, 2025
202528f
addressed more issues in the PR
mvertens Oct 15, 2025
ccbd55b
more updates
Oct 16, 2025
334a26c
fixed compile problems
mvertens Oct 16, 2025
3e2b114
fixed compiler problems
Oct 16, 2025
f322cd0
fixed typos
mvertens Oct 16, 2025
749e5a8
fix compiler issues
Oct 16, 2025
3ba7758
fixed compile problem
Oct 16, 2025
2e21ce0
more compile issues
Oct 16, 2025
962d043
fixed more compile problems
mvertens Oct 16, 2025
8d26434
compile with intel is now successful
mvertens Oct 16, 2025
26643a9
removed all references to water isotopes - since this will be heavily…
Oct 16, 2025
9b99cff
formatting changes
Oct 16, 2025
d0b2fc9
compile fixes for removing isotopes
mvertens Oct 16, 2025
bbb1622
some cleanup of routine
mvertens Oct 17, 2025
46664e4
Merge pull request #42 from mvertens/feature/cam_computes_enthalpy
mvertens Oct 17, 2025
124f2e4
Merge branch 'noresm' into feature/new_atmocn_flux_modules
mvertens Oct 17, 2025
c86ae40
addressed PR issue
mvertens Oct 18, 2025
11a214f
update for consistency with escomp PR
mvertens Oct 19, 2025
4e7bbe4
updates for noresm workflows
mvertens Oct 19, 2025
b75f582
Merge branch 'feature/new_atmocn_flux_modules_escomp' into feature/up…
mvertens Oct 19, 2025
578607a
changed comment
mvertens Oct 19, 2025
38e4c74
fixed typo
mvertens Oct 19, 2025
7f75593
fixed comment
mvertens Oct 19, 2025
1a9153b
minor formatting change
mvertens Oct 19, 2025
ed805ef
update for history
mvertens Oct 20, 2025
31ee29e
Merge pull request #43 from mvertens/feature/new_atmocn_flux_modules
mvertens Oct 20, 2025
9d636ec
uncomment tmate to debug workflow
jedwards4b Oct 20, 2025
161b084
backed out changes for noresm
mvertens Oct 21, 2025
66b2e59
Merge tag 'cmeps1.1.23' into feature/update_to_cmeps1.1.23
Oct 31, 2025
ff93205
updated shr_megan_mod.F90 to cmeps1.1.23
Oct 31, 2025
a6505ae
backed out cmeps1.1.23 changes to flux_atmocn_COARE_mod.F90 and flux_…
Nov 1, 2025
36e7fa8
removed unused variable is
mvertens Nov 1, 2025
e02828d
removed unused variable
mvertens Nov 1, 2025
1a04ba1
removed unused variable
mvertens Nov 1, 2025
0f14d67
made Taylor the default scheme for the ocean albedo calculation for N…
mvertens Nov 4, 2025
b9abe25
added new timers in mapping
mvertens Nov 28, 2025
bdafcec
Merge pull request #44 from mvertens/feature/update_to_cmeps1.1.23
mvdebolskiy Dec 6, 2025
bdfe9dd
Merge tag 'cmeps1.1.27' into noresm_merge_escomp
billsacks Jan 10, 2026
bbb2b4a
Merge tag 'cmeps1.1.28' into noresm_merge_escomp
billsacks Jan 10, 2026
0d1218f
Merge tag 'cmeps1.1.29' into noresm_merge_escomp
billsacks Jan 10, 2026
8ecf909
Merge tag 'cmeps1.1.31' into noresm_merge_escomp
billsacks Jan 11, 2026
a6f0ee5
Merge branch 'shr_flux_namelist' into noresm_merge_escomp
billsacks Jan 11, 2026
ba21bc3
Change aofluxes_use_shr_wv_sat to false for noresm
billsacks Jan 11, 2026
072da1c
Add use statements
billsacks Jan 11, 2026
799325e
Merge branch 'shr_flux_namelist' into noresm_merge_escomp
billsacks Jan 12, 2026
16f28d8
Merge branch 'shr_flux_namelist' into noresm_merge_escomp
billsacks Jan 12, 2026
8099279
Merge branch 'main' into noresm_merge_escomp
billsacks Jan 15, 2026
9097147
Merge pull request #45 from billsacks/noresm_merge_escomp
mvertens Mar 23, 2026
252c427
Merge tag 'cmeps1.1.41' into feature/merge_to_cmeps1.1.41
mvertens Mar 24, 2026
97ddd2c
fixed compiler issues
mvertens Mar 29, 2026
681a793
fixed comment
mvertens Apr 1, 2026
b16528e
Merge pull request #46 from mvertens/feature/merge_to_cmeps1.1.41
mvertens Apr 9, 2026
f84cfbc
updates needed for noresm ww3 development
mvertens May 5, 2026
6756f77
fixed compiler issue
mvertens May 8, 2026
d26de95
fixed bug in found in testing
mvertens May 8, 2026
df45638
changed default for ww3 aux fields for noresm coupling_mode
mvertens May 10, 2026
5aac7a5
made histaux_wav2med_file1_enabled true when running with WW3 for bot…
mvertens May 10, 2026
d36730d
fixes to get noresm tests working
May 11, 2026
0e28456
fixed the reference to git-fleximod
May 11, 2026
a0cecec
checking out noresm_develop by default for srt.yml
May 11, 2026
919412e
replaced tab with white space
May 11, 2026
943cdd0
change ref to test actions
May 11, 2026
b54d025
fix checkouts in workflow
May 11, 2026
7049659
Revert "fix checkouts in workflow"
May 11, 2026
9e02e78
revert testing changes, put action on main, so it's not triggered
May 12, 2026
c9c8a60
Merge pull request #48 from mvertens/feature/update_ww3_settings
mvdebolskiy May 12, 2026
0ff1a6f
merged to escomp cmeps1.1.48
mvertens May 22, 2026
45adcc4
fixed invalid flag
mvertens May 22, 2026
7541a7a
merge to ESCOMP cmeps1.1.48
mvertens Jun 1, 2026
7949f87
Merge tag 'cmeps1.1.51' into feature/merge_to_cmeps1.1.51
mvertens Jul 2, 2026
b77515d
made wav_ice_coupling on for noresm if components include ww3 and cice
mvertens Jul 6, 2026
3d2dbab
updated condition for wav_ice_coupling
mvertens Jul 7, 2026
c08b5b7
Merge pull request #50 from mvertens/feature/new_wav_ice_coupling_def…
mvertens Jul 7, 2026
94d22a7
check on DRV_RESTART_POINTER for branch runs
Jul 29, 2026
94e8798
Merge pull request #54 from mvertens/feature/branch_run_check
mvertens Jul 29, 2026
d17fa4c
Merge pull request #52 from mvertens/feature/merge_to_cmeps1.1.51
mvertens Jul 29, 2026
e91ce72
first pass at merging to cmeps1.1.57
Jul 31, 2026
23a07d6
updated diag table for glc ice and liquid runoff
Aug 3, 2026
17524f2
updated med_phases_prep_ocn correctly cmeps1.1.57
Aug 3, 2026
a7085e8
separated out Faxa_lwdn for noresm coupling
Aug 3, 2026
7576810
fixed problems in merge to fd_cesm.yaml
Aug 3, 2026
73d2c66
Merge pull request #55 from mvertens/feature/update_to_cmeps1.1.57
mvertens Aug 5, 2026
4f5b91a
Merge tag 'cmeps1.1.57_noresm_v0' into feature/merge_cmeps1.1.57_nore…
Aug 13, 2026
ba8cb3b
removed updates of noresm for .github/workflows files
Aug 13, 2026
24418aa
Merge pull request #59 from mvertens/feature/fix_issues_with_glc
mvdebolskiy Sep 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 114 additions & 2 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
config["CPL_I2O_PER_CAT"] = case.get_value("CPL_I2O_PER_CAT")
config["DRV_THREADING"] = case.get_value("DRV_THREADING")
config["CPL_ALBAV"] = case.get_value("CPL_ALBAV")
config["CPL_EPBAL"] = case.get_value("CPL_EPBAL")
config["BUDGETS"] = case.get_value("BUDGETS")
config["MACH"] = case.get_value("MACH")
config["MPILIB"] = case.get_value("MPILIB")
config["OS"] = case.get_value("OS")
config["TESTCASE"] = case.get_value("TESTCASE")
config["ocn_multilev"] = ".false."
config["set_histaux_l2x1yrg"] = ".false."
if not config["TESTCASE"]:
config["TESTCASE"] = "UNSET"
config["glc_nec"] = (
Expand All @@ -53,9 +56,14 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
for val in ("HIST", "REST", "STOP"):
config[val.lower()+"_option"] = case.get_value(val+"_OPTION")


config["comp_ocn"] = case.get_value("COMP_OCN")

config["set_histaux_l2x1yrg"] = (
".true." if case.get_value("COMP_OCN") == 'blom' and case.get_value("COMP_LND") == 'clm' else ".false."
)
config["ocn_multilev"] = (
".true." if case.get_value("COMP_OCN") == 'blom' or 'DOCN%MULTILEV' in case.get_value("COMPSET") else ".false."
)

atm_grid = case.get_value("ATM_GRID")
lnd_grid = case.get_value("LND_GRID")
Expand Down Expand Up @@ -122,11 +130,29 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
elif case.get_value("RUN_TYPE") == "branch":
config["run_type"] = "branch"

# For a branch run the driver must read the reference case's restart, so
# the driver restart pointer must be set explicitly to the dated
# rpointer.cpl of that reference case. buildnml does not modify xml
# variables, so rather than set DRV_RESTART_POINTER we check that it
# matches the expected dated pointer (built from RUN_REFDATE and
# RUN_REFTOD) and, if not, fail with the exact xmlchange command needed.
# (On a continue run CIME sets DRV_RESTART_POINTER automatically, and a
# hybrid run does not read the driver restart, so neither is checked.)
if not case.get_value("CONTINUE_RUN"):
expected_pointer = "rpointer.cpl.{}-{}".format(
case.get_value("RUN_REFDATE"), case.get_value("RUN_REFTOD")
)
expect(
case.get_value("DRV_RESTART_POINTER") == expected_pointer,
"For a branch run the driver restart pointer must be set to the "
"dated rpointer.cpl of the reference case. Set it with:\n"
" ./xmlchange DRV_RESTART_POINTER={}".format(expected_pointer),
)

# determine coupling mode
config["coupling_mode"] = case.get_value("COUPLING_MODE")

# determine wav_ice_coupling
config["wav_ice_coupling"] = "off"
if config["coupling_mode"] == "cesm" or config["coupling_mode"] == "noresm":
if config['COMP_WAV'] == 'ww3' and config['COMP_ICE'] == 'cice':
config["wav_ice_coupling"] = "on"
Expand All @@ -143,6 +169,15 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
# ----------------------------------------------------
nmlgen.init_defaults(infile, config, skip_default_for_groups=["modelio"])

# ----------------------------------------------------
# Error checks
# ----------------------------------------------------
# double check if ocn2glc_coupling is set correctly
ocn2glc_coupling = nmlgen.get_value("ocn2glc_coupling")
if ocn2glc_coupling == ".true.":
expect(case.get_value("COMP_OCN") == 'blom' or 'DOCN%MULTILEV' in case.get_value("COMPSET"),
"ocn2glc_coupling is only allowed currently if the ocean component is BLOM or if DOCN%MULTILEV is in the compset")

# --------------------------------
# Overwrite: set brnch_retain_casename
# --------------------------------
Expand Down Expand Up @@ -238,6 +273,24 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
run_startdate = "".join(str(x) for x in case.get_value("RUN_STARTDATE").split("-"))
nmlgen.set_value("start_ymd", value=run_startdate)

# --------------------------------
# Overwrite: budget_table_version if atm computes enthalpy
# --------------------------------
component_computes_enthalpy_flux = nmlgen.get_value("component_computes_enthalpy_flux")
if 'atm' in component_computes_enthalpy_flux:
nmlgen.set_value("budget_table_version", value="v2")
expect(
case.get_value("COMP_ATM") != "cam" and
case.get_value("COMP_OCN") == "mom6",
"Only CAM and BLOM are currently allowed if cam computes enthalpy fluxes"
)
elif component_computes_enthalpy_flux == "med":
expect(
case.get_value("COMP_ATM") != "cam" and
case.get_value("COMP_OCN") != "mom6",
"Only CAM and MOM6 are currently allowed if mediator computes enthalpy fluxes"
)

# --------------------------------
# Overwrite: set tprof_option and tprof_n - if tprof_total is > 0
# --------------------------------
Expand Down Expand Up @@ -552,6 +605,65 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
drv_flds_in = os.path.join(caseroot, "CaseDocs", "drv_flds_in")
nmlgen.write_output_file(drv_flds_in)

# now read drv_flds_in and determine if lnd sends extra
# non-water tracers to runoff component
add_tracer_field = False
with open(drv_flds_in, "r", encoding="utf-8") as namelist_file:
for line in namelist_file.readlines():
if 'lnd2rof_tracers' in line and 'lnd2rof_tracers_inparm' not in line:
add_tracer_field = True

append_line = False
if add_tracer_field:
user_nl_cpl = os.path.join(caseroot, "user_nl_cpl")
append_line = True
with open(user_nl_cpl) as user_file:
for line in user_file.readlines():
if 'Flrl_rofsur_nonh2o' in line:
append_line = False
if append_line:
print("NOTE: Adding the following line to user_nl_cpl")
print( "histaux_lnd2med_file2_flds = \'Flrl_rofsur:Flrl_rofi:Flrl_rofgwl:Flrl_rofsub:Flrl_rofsur_nonh2o\'\n")
with open(user_nl_cpl, 'a') as user_file:
user_file.write("histaux_lnd2med_file2_flds = \'Flrl_rofsur:Flrl_rofi:Flrl_rofgwl:Flrl_rofsub:Flrl_rofsur_nonh2o\'\n")

###############################################################################
def _add_water_tracers(water_tracers_xml, nmlgen):
###############################################################################

if not water_tracers_xml.strip():
water_tracers = []
else:
water_tracers = water_tracers_xml.split(":")
tracer_names = []
tracer_species = []
tracer_initial_ratios = []

for tracer in water_tracers:
# Each item in the list consists of a name and then, optionally, a '%' followed by
# the isotope species for this tracer. For standard water tracers (i.e., tracers
# of bulk water), the list item will only contain the name (without a '%').
expect(
tracer.count("%") <= 1,
f"Invalid WATER_TRACERS element, '{tracer}': Each element of WATER_TRACERS must contain at most 1 '%' separator",
)
parts = tracer.split("%")
tracer_names.append(parts[0])
if len(parts) > 1:
tracer_species.append(parts[1])
# We could check the validity of the species name here (confirming that it's
# one of the handled species), but that would lead to this allowed list being
# replicated in multiple places (here as well as in the Fortran), which would
# make it more difficult to add new species later. So we're deferring this
# check to runtime.
else:
tracer_species.append("-")
tracer_initial_ratios.append("1.0")

nmlgen.add_default("water_tracer_names", ":".join(tracer_names))
nmlgen.add_default("water_tracer_species", ":".join(tracer_species))
nmlgen.add_default("water_tracer_initial_ratios", ":".join(tracer_initial_ratios))


###############################################################################
def _add_water_tracers(water_tracers_xml, nmlgen):
Expand Down
7 changes: 2 additions & 5 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<entry id="COUPLING_MODE">
<type>char</type>
<valid_values>cesm,noresm</valid_values>
<default_value>cesm</default_value>
<default_value>noresm</default_value>
<group>run_coupling</group>
<file>env_run.xml</file>
<desc>coupling mode</desc>
Expand Down Expand Up @@ -1412,10 +1412,7 @@
<default_value>idmap</default_value>
<group>run_domain</group>
<file>env_run.xml</file>
<desc>lnd2rof flux (conservative) mapping file. (This mapping file is used for both consd and consf mappings; as discussed in
https://github.com/ESCOMP/CMEPS/issues/408, the results of these two mappings are the same within roundoff in CMEPS due to the
normalization that is done when applying the mapping weights. For simplicity, and because land mesh files generally don't have
a mask, this mapping file should be generated with '--norm_type dstarea'.)</desc>
<desc>lnd2rof flux mapping file</desc>
</entry>

<entry id="ROF2LND_FMAPNAME">
Expand Down
12 changes: 11 additions & 1 deletion cime_config/config_component_cesm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<desc>Activates additional CO2-related fields to be exchanged between components. Possible values are:

CO2A: sets the driver namelist variable flds_co2a = .true.; this adds
prognostic CO2 and diagnostic CO2 at the lowest model level to be sent from
diagnostic CO2 at the lowest model level to be sent from
the atmosphere to the land and ocean.

CO2B: sets the driver namelist variable flds_co2b = .true.; this adds
Expand Down Expand Up @@ -301,7 +301,14 @@
<!-- N compsets -->
<!-- =================================================== -->
<value compset="_DATM.*_BLOM">24</value>
<value compset="_DATM.*_BLOM" grid="oi%tnx2">18</value>
<value compset="_BLOM" grid="oi%tnx0.25v">48</value>
<!-- =================================================== -->
<!-- WW3Test compset -->
<!-- =================================================== -->
<value compset="_DATM.*_WW3" grid="w025">72</value>
<value compset="_DATM.*_WW3" grid="wtx0.66v1">72</value>
<!-- otherwise ww3 buildnml won't be happy. -->
</values>
<group>run_coupling</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -342,6 +349,9 @@
<values match="last">
<value compset="_MOM6">24</value>
<value compset="_BLOM">24</value>
<value compset="_BLOM" grid="oi%tnx2">18</value>
<!-- quick fix for coupled with 2 deg ocn-->
<value compset="_BLOM.*_MOSART" grid="oi%tnx2">24</value>
<value compset="_DLND.*_CISM\d">1</value>
<value compset="_NEMO">24</value>
</values>
Expand Down
Loading