Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
acd0d2d
Replace most uses of npcropmin/max with is_prognostic_crop().
samsrabin Aug 6, 2025
85f72b2
Avoid using npcropmin/max for looping outside pftconMod.
samsrabin Aug 6, 2025
25d0cce
Add get_crop_n_from_veg_type().
samsrabin Aug 6, 2025
29ae909
Add get_veg_type_from_crop_n().
samsrabin Aug 6, 2025
05eec12
Add pftconMod public var num_cfts_possible.
samsrabin Aug 6, 2025
b50faf2
npcropmin/max are now private to pftconMod.
samsrabin Aug 6, 2025
743098a
Add query_paramfile tool.
samsrabin Aug 7, 2025
0e2e1e3
query_paramfile: Accept comma-separated variable list.
samsrabin Aug 7, 2025
72a27f7
query_paramfile: Print PFT name next to PFT-specific params.
samsrabin Aug 7, 2025
56aa742
query_paramfile: Align PFT-specific values.
samsrabin Aug 7, 2025
8e70046
query_paramfile: Add optional -p/--pft option.
samsrabin Aug 7, 2025
43b8310
Merge tag 'ctsm5.3.066' into merge-master-20250808
slevis-lmwg Aug 8, 2025
1b9fbe4
Merge pull request #3398 from slevis-lmwg/merge-master-20250808
slevis-lmwg Aug 8, 2025
ef28019
Merge branch 'b4b-dev' into private-npcropminmax
samsrabin Aug 8, 2025
e9f57b3
py_env_create: conda rename needs --yes, not --force, as of 25.3.0.
samsrabin Aug 8, 2025
8698bfc
test_sys_py_env_create: Empty YML file for mamba.
samsrabin Aug 11, 2025
f591ba5
test_sys_py_env_create: Better err msg if env not found.
samsrabin Aug 11, 2025
b40d87f
py_env_create: conda_env_exists now always uses conda.
samsrabin Aug 11, 2025
a627c5c
Improve comment in empty.yml.
samsrabin Aug 11, 2025
1f549d9
Merge pull request #3403 from samsrabin/fix-py_env_create-tests
samsrabin Aug 11, 2025
20331d1
Suppress crop cold temp msgs when generate_crop_gdds true.
samsrabin Jul 16, 2025
3a37923
Move log() and error() from generate_gdds_functions to cropcal_utils.
samsrabin Jul 25, 2025
fa14f3a
Add logging in GDD generation.
samsrabin Jul 31, 2025
c412710
cropcal_utils log(), error(): Prepend datetime string.
samsrabin Aug 11, 2025
beee2fc
Reformat with black.
samsrabin Aug 11, 2025
ec194e5
Add previous commit to .git-blame-ignore-revs.
samsrabin Aug 11, 2025
478384d
Refactoring to satisfy pylint.
samsrabin Aug 11, 2025
debbe36
Rename query_parameters/ to param_utils/.
samsrabin Aug 12, 2025
e1f29b2
query_paramfile: Add unit tests of get_arguments().
samsrabin Aug 12, 2025
71f2aff
query_paramfile: Add unit tests of print_values().
samsrabin Aug 12, 2025
99baf01
query_paramfile: Add simple system test; failing.
samsrabin Aug 12, 2025
bf39325
query_paramfile: Fix call w/o -p/--pft.
samsrabin Aug 12, 2025
35bac74
query_paramfile: Add more system tests; failing.
samsrabin Aug 12, 2025
b2f08bd
query_paramfile: Always get pft_names if on paramfile.
samsrabin Aug 12, 2025
6429f00
query_parameters: Add docstrings.
samsrabin Aug 12, 2025
29ff74d
query_paramfile: Move some parser stuff to paramfile_shared.
samsrabin Aug 12, 2025
2a178bc
query_paramfile: Split comma-separated lists in parse_args().
samsrabin Aug 12, 2025
958aaf2
Add set_paramfile tool and tests. So far just parses some args.
samsrabin Aug 12, 2025
337a072
set_paramfile: Can now copy a file.
samsrabin Aug 12, 2025
cea3f12
set_paramfile: Use -v/--variables to only include some vars.
samsrabin Aug 12, 2025
93f29e2
set_paramfile: Can now change params. Tested w/ scalars.
samsrabin Aug 12, 2025
22bdf2d
set_paramfile: Include just some PFTs with -p/--pft.
samsrabin Aug 12, 2025
3aeb040
set_paramfile: Can now change 1-d parameters.
samsrabin Aug 12, 2025
a148838
query_paramfile: Fix call for PFT param w/o -p/--pft.
samsrabin Aug 12, 2025
bedf08d
Update _paramfile tool help descriptions.
samsrabin Aug 12, 2025
f0ba3e0
set_paramfile: Check that new value has right ndim.
samsrabin Aug 13, 2025
73d0a01
set_paramfile sys tests: Check dtype didn't change.
samsrabin Aug 13, 2025
fed3ba4
set_paramfile: Add is_integer(). Tested but not yet used.
samsrabin Aug 13, 2025
3056c36
set_paramfile: Test changing scalar int param. Failing.
samsrabin Aug 13, 2025
552f979
set_paramfile: Can now change scalar int params.
samsrabin Aug 13, 2025
b1c0c75
Turns out set_paramfile works for 1d int params too.
samsrabin Aug 13, 2025
6872d2b
set_paramfile: Don't mask or scale when reading parameter file.
samsrabin Aug 13, 2025
f37c301
test_sys_set_paramfile: Check that fill val didn't change.
samsrabin Aug 13, 2025
a8d90d6
set_paramfile: Avoid calling is_integer().
samsrabin Aug 13, 2025
dd38d7e
Add a PE layout for mpas13p75
ekluzek Jul 29, 2025
b03835f
Add a testmod for mpasa3p75 grid
ekluzek Jul 30, 2025
52470c4
Add decomp initialization test and test list for ultra high resolutio…
ekluzek Jul 30, 2025
f1a5a45
Fix syntax and correct 3p75 resolution grid name for test
ekluzek Jul 30, 2025
f3ac549
Fix name of mpasa3p75 testmod in test
ekluzek Jul 30, 2025
5602a7d
test_sys_set_paramfile: Test setting scalar double NaN using 'nan'
samsrabin Aug 13, 2025
89f0c42
set_paramfile: Don't allow setting NaN if param doesn't have FillValue.
samsrabin Aug 13, 2025
c4e1fa4
Copy the files from scratch to inputdata just on glade on Derecho
ekluzek Aug 13, 2025
152ac60
set_paramfile: Don't allow setting NaN in integer params.
samsrabin Aug 13, 2025
cb8fadf
Resolve or delete some testing TODOs.
samsrabin Aug 13, 2025
492bcea
set_paramfile: Require --drop-other-pfts to actually trim the PFT list.
samsrabin Aug 13, 2025
50cf969
Initial add of a unit test for endrun
ekluzek Aug 13, 2025
14bb2f8
set_paramfile: Can now change just a few PFT values.
samsrabin Aug 13, 2025
f42d816
set_paramfile: Can now change just one PFT without touching others.
samsrabin Aug 13, 2025
7eb17f3
Reformat with black.
samsrabin Aug 13, 2025
5462b0e
Add previous commit to .git-blame-ignore-revs.
samsrabin Aug 13, 2025
187a8e4
Satisfy pylint.
samsrabin Aug 13, 2025
4e9d2fe
query_paramfiles: Use space-separated variables to match set_paramfile.
samsrabin Aug 14, 2025
c4d6ac6
query_paramfile now prints all variables if none specified.
samsrabin Aug 14, 2025
4019a5a
query_paramfile: Handle multi-dim vars.
samsrabin Aug 14, 2025
ae22703
set_paramfile sys tests: Explicitly check that a 'nan' is saved as th…
samsrabin Aug 14, 2025
79059bc
set_paramfile: Fix a comment.
samsrabin Aug 14, 2025
65daa85
set_paramfile now preserves non-NaN _FillValue.
samsrabin Aug 14, 2025
9f5e4b4
Fix subset_data when selecting just 1 pft.
samsrabin Aug 14, 2025
e2edd6b
Add more tests for more of the options
ekluzek Aug 14, 2025
a6011fb
set_paramfile: Explain nan in help text.
samsrabin Aug 15, 2025
042f5f4
netcdf_utils: Add are_xr_dataarrays_identical().
samsrabin Aug 15, 2025
9552803
Use are_xr_dataarrays_identical() in set_paramfile system tests. Fail…
samsrabin Aug 15, 2025
24ba0de
are_xr_dataarrays_identical(): NaNs equal; ignore source/original_shape.
samsrabin Aug 15, 2025
ee70147
set_paramfile: Don't add fill value to parameters without one.
samsrabin Aug 15, 2025
952a355
are_xr_dataarrays_identical(): Refactor for pylint.
samsrabin Aug 15, 2025
5431832
Move subgrid setup and teardown to setup and teardown methods, add ex…
ekluzek Aug 15, 2025
895a8df
are_xr_dataarrays_identical(): Don't ignore anything by default.
samsrabin Aug 15, 2025
5492fff
set_paramfile: Add save_paramfile().
samsrabin Aug 15, 2025
31894b1
set_paramfile: Refactor to reduce branching.
samsrabin Aug 15, 2025
8e3e382
set_paramfile: Improve error when assigning fill for param w/o one.
samsrabin Aug 15, 2025
2508e3f
Continue the endrun call even if subgrid_level is bad so that the err…
ekluzek Aug 15, 2025
61f5056
Change to the new expected behavior where the error isn't about the s…
ekluzek Aug 15, 2025
e48342f
Update to using shr_abort_abort as talked about in #3417
ekluzek Aug 15, 2025
27b3b54
Update to using shr_abort_abort as talked about in #3417
ekluzek Aug 15, 2025
8c25599
Add testing for bad point in the pt_context which fails because of su…
ekluzek Aug 15, 2025
b9b9420
save_paramfile(): test saving an integer parameter with a fill value
samsrabin Aug 15, 2025
fce7287
set_paramfile(): Improve text about integer fill values.
samsrabin Aug 15, 2025
62d7711
Reformat with black.
samsrabin Aug 15, 2025
8246f54
Add previous commit to .git-blame-ignore-revs.
samsrabin Aug 15, 2025
eac7e81
Satisfy pylint.
samsrabin Aug 16, 2025
ac849e6
save_paramfile: Save calling command to history.
samsrabin Aug 16, 2025
09f561d
Add handling in case the input point is bad to end_run_pt_context
ekluzek Aug 16, 2025
067fe25
Add more error checking if a bad point is input to get_global_index, …
ekluzek Aug 16, 2025
323dc8a
Allow passing file and line to endrun, output it through shr_log_errM…
ekluzek Aug 16, 2025
608e440
Add some tests for sending in file and line and one with just file to…
ekluzek Aug 16, 2025
ccc7b2d
Correct data type of bad_point to logical
ekluzek Aug 16, 2025
f1856ab
set_paramfile: Functionize _convert_to_output_dtype().
samsrabin Aug 16, 2025
bc2f068
set_paramfile: Improve/test error when given float for integer param.
samsrabin Aug 16, 2025
0207b46
Move are_dicts_identical_nansequal() to netcdf_utils.
samsrabin Aug 17, 2025
f36f3f9
Add SETPARAMFILE SystemTest.
samsrabin Aug 17, 2025
49ad0f7
Reformat with black.
samsrabin Aug 17, 2025
4465b0f
Add prevous commit to .git-blame-ignore-revs.
samsrabin Aug 17, 2025
2eb293c
Merge remote-tracking branch 'escomp/b4b-dev' into query-paramfile
samsrabin Aug 17, 2025
5f4ca9c
set_paramfile: Small refactor.
samsrabin Aug 17, 2025
3211033
query/set_paramfile: Improve help text.
samsrabin Aug 18, 2025
7ff67d6
query/set_paramfile: Update docstrings.
samsrabin Aug 18, 2025
a9a1b89
CNFUNMod: Improve readability of a line.
samsrabin Aug 18, 2025
f36f1d3
test_sys_set_paramfile: Delete some print()s.
samsrabin Aug 17, 2025
be8191d
Improve netcdf_utils and testing.
samsrabin Aug 17, 2025
86dd02c
set_paramfile: Simplify _replace_nans_with_fill().
samsrabin Aug 18, 2025
9040f4a
set_paramfile: Avoid using ds_in for robustness.
samsrabin Aug 18, 2025
af2d7dd
set_paramfile: Functionize apply_new_value_to_parameter().
samsrabin Aug 18, 2025
8163648
set_paramfile: chg now optional kw arg if just used in err msg.
samsrabin Aug 18, 2025
e49e793
set_paramfile: Improve a comment.
samsrabin Aug 18, 2025
2032633
set_paramfile: Delete questionably-useful, confusing -v/--variables.
samsrabin Aug 18, 2025
6c80312
test_unit_netcdf_utils: Satisfy pylint.
samsrabin Aug 18, 2025
e339339
Add docs for paramfile tools.
samsrabin Aug 18, 2025
a88e560
Merge remote-tracking branch 'escomp/b4b-dev' into private-npcropminmax
samsrabin Aug 19, 2025
bd0ba20
is_prognostic_crop(): Improve note.
samsrabin Aug 19, 2025
8d8be78
Merge pull request #3390 from samsrabin/private-npcropminmax
samsrabin Aug 19, 2025
ed3223f
Move 3 functions from cropcal_utils.
samsrabin Aug 19, 2025
87506e1
ctsm_logging: Add error_type option to error().
samsrabin Aug 19, 2025
d7237ac
Try adding caller name to log() and error() msgs.
samsrabin Aug 19, 2025
b33f0aa
Merge remote-tracking branch 'escomp/b4b-dev' into endrun_work
ekluzek Aug 19, 2025
09400a3
Change the directory name for the new endrun tests
ekluzek Aug 19, 2025
6e818f6
Change the names from the specific subroutine endrun to abortutils th…
ekluzek Aug 19, 2025
a139a42
Move the descriptions of test subroutines to just after the subroutin…
ekluzek Aug 19, 2025
b779f98
Merge pull request #3418 from ekluzek/endrun_work
ekluzek Aug 19, 2025
06f7e7f
Finalize caller name in log()/error() msgs.
samsrabin Aug 20, 2025
fd3e54a
ctsm_logging: Functionize _compose_log_msg().
samsrabin Aug 20, 2025
f8e6f87
Add unit tests of log() and error().
samsrabin Aug 20, 2025
8e87966
Merge remote-tracking branch 'escomp/b4b-dev' into gddgen-log-changes
samsrabin Aug 20, 2025
e6568d1
Changes to exit early when self test namelist option used for_testing…
ekluzek Jul 2, 2025
5e8046f
Remove the changes in timers and flow in the nuopc cap level in last …
ekluzek Aug 20, 2025
979edbc
Fix typo in xmlchange
ekluzek Jul 10, 2025
31596b9
Turn off restarts and history and add some timer options as well as t…
ekluzek Jul 11, 2025
72cc02e
Turn off RTM rather than increase the ROF coupling frequency
ekluzek Jul 30, 2025
f1c3c09
Turn off urban HAC completely and minimize urban in gridcells
ekluzek Jul 30, 2025
02e070b
Still need to set NCPL_ROF
ekluzek Jul 30, 2025
39ea6fb
Fix syntax error
ekluzek Jul 30, 2025
38295ac
Seperate run_self_tests into a test mod that just sets up the testing…
ekluzek Aug 17, 2025
d67d87f
Seperate out decomp_init test list into production tests for timing, …
ekluzek Aug 17, 2025
f5fe359
Make decomp_init single grid case run with mpi-serial
ekluzek Aug 20, 2025
d076327
Merge remote-tracking branch 'escomp/b4b-dev' into mpasa3p75
ekluzek Aug 20, 2025
fe1a993
Remove turning on decomp init testing for now
ekluzek Aug 20, 2025
d858665
Reformat with black.
samsrabin Aug 20, 2025
b5db20a
Add previous commit to .git-blame-ignore-revs.
samsrabin Aug 20, 2025
ac5899b
Small change for pylint.
samsrabin Aug 20, 2025
fb8550e
Merge pull request #3408 from samsrabin/gddgen-log-changes
samsrabin Aug 20, 2025
7b80a4e
Turn off restarts and history and add some timer options as well as t…
ekluzek Jul 11, 2025
d93d803
Correct for testing namelist items to just the ncdip_pio tests which …
ekluzek Aug 21, 2025
e57d8f8
Remove the self test turning on of ncdio_pio testing, which should ju…
ekluzek Aug 21, 2025
5b5c40c
Suppress crop cold temp msgs when generate_crop_gdds true.
samsrabin Jul 16, 2025
14a27f0
Move log() and error() from generate_gdds_functions to cropcal_utils.
samsrabin Jul 25, 2025
444fa54
Add logging in GDD generation.
samsrabin Jul 31, 2025
8b5c90d
cropcal_utils log(), error(): Prepend datetime string.
samsrabin Aug 11, 2025
2132750
Reformat with black.
samsrabin Aug 11, 2025
97e2bfe
Add previous commit to .git-blame-ignore-revs.
samsrabin Aug 11, 2025
4113ece
Refactoring to satisfy pylint.
samsrabin Aug 11, 2025
ebef8c7
Move 3 functions from cropcal_utils.
samsrabin Aug 19, 2025
c057113
ctsm_logging: Add error_type option to error().
samsrabin Aug 19, 2025
191e119
Try adding caller name to log() and error() msgs.
samsrabin Aug 19, 2025
e277c92
Finalize caller name in log()/error() msgs.
samsrabin Aug 20, 2025
037ae1b
ctsm_logging: Functionize _compose_log_msg().
samsrabin Aug 20, 2025
dcb39b4
Add unit tests of log() and error().
samsrabin Aug 20, 2025
75c6794
Initial add of a unit test for endrun
ekluzek Aug 13, 2025
4053c0a
Add more tests for more of the options
ekluzek Aug 14, 2025
4dc49a9
Move subgrid setup and teardown to setup and teardown methods, add ex…
ekluzek Aug 15, 2025
1586175
Continue the endrun call even if subgrid_level is bad so that the err…
ekluzek Aug 15, 2025
6c38d62
Change to the new expected behavior where the error isn't about the s…
ekluzek Aug 15, 2025
7d25eba
Update to using shr_abort_abort as talked about in #3417
ekluzek Aug 15, 2025
a13dcdb
Update to using shr_abort_abort as talked about in #3417
ekluzek Aug 15, 2025
33a8e00
Add testing for bad point in the pt_context which fails because of su…
ekluzek Aug 15, 2025
ef54137
Add handling in case the input point is bad to end_run_pt_context
ekluzek Aug 16, 2025
33907d7
Add more error checking if a bad point is input to get_global_index, …
ekluzek Aug 16, 2025
7df48b9
Allow passing file and line to endrun, output it through shr_log_errM…
ekluzek Aug 16, 2025
986fe31
Add some tests for sending in file and line and one with just file to…
ekluzek Aug 16, 2025
9a6bf53
Correct data type of bad_point to logical
ekluzek Aug 16, 2025
fc884eb
Replace most uses of npcropmin/max with is_prognostic_crop().
samsrabin Aug 6, 2025
8ca7af5
Avoid using npcropmin/max for looping outside pftconMod.
samsrabin Aug 6, 2025
0dfa907
Add get_crop_n_from_veg_type().
samsrabin Aug 6, 2025
0901503
Add get_veg_type_from_crop_n().
samsrabin Aug 6, 2025
c77a405
Add pftconMod public var num_cfts_possible.
samsrabin Aug 6, 2025
ff4ead6
npcropmin/max are now private to pftconMod.
samsrabin Aug 6, 2025
8920ed7
CNFUNMod: Improve readability of a line.
samsrabin Aug 18, 2025
c20859f
is_prognostic_crop(): Improve note.
samsrabin Aug 19, 2025
d685e6f
Change the directory name for the new endrun tests
ekluzek Aug 19, 2025
5ac7e3b
Change the names from the specific subroutine endrun to abortutils th…
ekluzek Aug 19, 2025
854a364
Move the descriptions of test subroutines to just after the subroutin…
ekluzek Aug 19, 2025
5b40496
Reformat with black.
samsrabin Aug 20, 2025
a6e2309
Add previous commit to .git-blame-ignore-revs.
samsrabin Aug 20, 2025
22a56e5
Small change for pylint.
samsrabin Aug 20, 2025
1a879d9
set_paramfile: Test & document changing 1-d non-pft param.
samsrabin Aug 21, 2025
73303fb
Merge remote-tracking branch 'escomp/b4b-dev' into query-paramfile
samsrabin Aug 21, 2025
113a63e
Merge pull request #3397 from samsrabin/query-paramfile
samsrabin Aug 21, 2025
11147fe
Correct name of RTM_MODE
ekluzek Aug 21, 2025
b39e405
DATM seems to need more tasks for it to run, so change the mpasa2p75 …
ekluzek Aug 21, 2025
5b0d5a2
Correct the path variable to DIN_LOC_ROOT
ekluzek Aug 21, 2025
a563ed0
Merge remote-tracking branch 'escomp/b4b-dev' into mpasa3p75
ekluzek Aug 21, 2025
58513d7
Merge pull request #3413 from ekluzek/mpasa3p75
ekluzek Aug 21, 2025
ac9aa73
Merge tag 'ctsm5.3.070' into b4b-dev-merge-20250822
samsrabin Aug 22, 2025
30a7f35
Update ChangeLog and ChangeSum.
samsrabin Aug 22, 2025
0f90c77
Finalize ctsm5.3.071 ChangeLog.
samsrabin Aug 23, 2025
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
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,8 @@ cdf40d265cc82775607a1bf25f5f527bacc97405
4ad46f46de7dde753b4653c15f05326f55116b73
75db098206b064b8b7b2a0604d3f0bf8fdb950cc
84609494b54ea9732f64add43b2f1dd035632b4c
7eb17f3ef0b9829fb55e0e3d7f02e157b0e41cfb
62d7711506a0fb9a3ad138ceceffbac1b79a6caa
49ad0f7ebe0b07459abc00a5c33c55a646f1e7e0
ac03492012837799b7111607188acff9f739044a
d858665d799690d73b56bcb961684382551193f4
95 changes: 95 additions & 0 deletions cime_config/SystemTests/setparamfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"""
CTSM-specific test that first runs the set_paramfile tool and then ensures that CTSM does not fail
using the just-generated parameter file
"""

import os
import sys
import logging
import re
from CIME.SystemTests.system_tests_common import SystemTestsCommon

# In case we need to import set_paramfile later
_CTSM_PYTHON = os.path.join(
os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, "python"
)
sys.path.insert(1, _CTSM_PYTHON)

logger = logging.getLogger(__name__)


class SETPARAMFILE(SystemTestsCommon):
def __init__(self, case):
"""
initialize an object interface to the SMS system test
"""
SystemTestsCommon.__init__(self, case)

# Create out-of-the-box lnd_in to obtain paramfile
case.create_namelists(component="lnd")

# Find the paramfile to modify
lnd_in_path = os.path.join(self._get_caseroot(), "CaseDocs", "lnd_in")
self._paramfile_in = None
with open(lnd_in_path, "r", encoding="utf-8") as lnd_in:
for line in lnd_in:
paramfile_in = re.match(r" *paramfile *= *'(.*)'", line)
if paramfile_in:
self._paramfile_in = paramfile_in.group(1)
break
if not self._paramfile_in:
raise RuntimeError(f"paramfile not found in {lnd_in_path}")

# Get the output file
self.paramfile_out = os.path.join(self._get_caseroot(), "paramfile.nc")

# Define set_paramfile command
self.set_paramfile_cmd = [
"set_paramfile",
"-i",
self._paramfile_in,
"-o",
self.paramfile_out,
# Change two parameters for one PFT
"-p",
"needleleaf_deciduous_boreal_tree",
"rswf_min=0.35",
"rswf_max=0.7",
]

def build_phase(self, sharedlib_only=False, model_only=False):
"""
Run set_paramfile and then build the model
"""

# Run set_paramfile.
# build_phase gets called twice:
# - once with sharedlib_only = True and
# - once with model_only = True
# Because we only need set_paramfile run once, we only do it for the sharedlib_only call.
# We could also check for the existence of the set_paramfile outputs, but that might lead to
# a situation where the user expects set_paramfile to be called but it's not. Better to run
# unnecessarily (e.g., if you fixed some FORTRAN code and just need to rebuild).
if sharedlib_only:
self._run_set_paramfile()

# Do the build
self.build_indv(sharedlib_only=sharedlib_only, model_only=model_only)

def _run_set_paramfile(self):
"""
Run set_paramfile
"""
# Import set_paramfile. Do it here rather than at top because otherwise the import will
# be attempted even during RUN phase.
# pylint: disable=wrong-import-position,import-outside-toplevel
from ctsm.param_utils.set_paramfile import main as set_paramfile

# Run set_paramfile
sys.argv = self.set_paramfile_cmd
set_paramfile()

# Append
user_nl_clm_path = os.path.join(self._get_caseroot(), "user_nl_clm")
with open(user_nl_clm_path, "a", encoding="utf-8") as user_nl_clm:
user_nl_clm.write(f"paramfile = '{self.paramfile_out}'\n")
38 changes: 38 additions & 0 deletions cime_config/config_pes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,44 @@
</rootpe>
</pes>
</mach>
</grid>
<grid name="l%mpasa3p75">
<mach name="derecho">
<pes pesize="any" compset="any">
<comment>none</comment>
<ntasks>
<ntasks_atm>-80</ntasks_atm>
<ntasks_lnd>-80</ntasks_lnd>
<ntasks_rof>-80</ntasks_rof>
<ntasks_ice>-80</ntasks_ice>
<ntasks_ocn>-80</ntasks_ocn>
<ntasks_glc>-80</ntasks_glc>
<ntasks_wav>-80</ntasks_wav>
<ntasks_cpl>-80</ntasks_cpl>
<ntasks_lnd>-80</ntasks_lnd>
</ntasks>
<nthrds>
<nthrds_atm>1</nthrds_atm>
<nthrds_lnd>1</nthrds_lnd>
<nthrds_rof>1</nthrds_rof>
<nthrds_ice>1</nthrds_ice>
<nthrds_ocn>1</nthrds_ocn>
<nthrds_glc>1</nthrds_glc>
<nthrds_wav>1</nthrds_wav>
<nthrds_cpl>1</nthrds_cpl>
</nthrds>
<rootpe>
<rootpe_atm>0</rootpe_atm>
<rootpe_lnd>0</rootpe_lnd>
<rootpe_rof>0</rootpe_rof>
<rootpe_ice>0</rootpe_ice>
<rootpe_ocn>0</rootpe_ocn>
<rootpe_glc>0</rootpe_glc>
<rootpe_wav>0</rootpe_wav>
<rootpe_cpl>0</rootpe_cpl>
</rootpe>
</pes>
</mach>
</grid>
<grid name="l%0.125nldas2">
<mach name="any">
Expand Down
10 changes: 10 additions & 0 deletions cime_config/config_tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ This defines various CTSM-specific system tests
<HIST_N>$STOP_N</HIST_N>
</test>

<test NAME="SETPARAMFILE">
<DESC>Modify a copy of the paramfile and run with it.</DESC>
<INFO_DBUG>1</INFO_DBUG>
<DOUT_S>FALSE</DOUT_S>
<CONTINUE_RUN>FALSE</CONTINUE_RUN>
<REST_OPTION>never</REST_OPTION>
<HIST_OPTION>$STOP_OPTION</HIST_OPTION>
<HIST_N>$STOP_N</HIST_N>
</test>

<!--
SSP smoke CLM spinup test (only valid for CLM compsets with CLM45)
do an initial spin test (setting CLM_ACCELERATED_SPINUP to on)
Expand Down
51 changes: 46 additions & 5 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
aux_clm_mpi_serial: aux_clm tests using mpi-serial. Useful for redoing tests that failed due to https://github.com/ESCOMP/CTSM/issues/2916, after having replaced libraries/mpi-serial with a fresh copy.
subset_data: Tests exercising the subset_data tool and running CTSM with its output
decomp_init: Initialization tests specifically for examining the PE layout decomposition initialization
uhr_decomp_init: Initialization tests at Ultra High Resolution - specifically for examining the PE layout decomposition initialization
interim_restart: Tests having to do with interim restart capability.
-->
<testlist version="2.0">
Expand Down Expand Up @@ -4203,7 +4204,28 @@
</test>

<!-- decomp_init tests -->
<test name="SMS_Ln1_P86x1" grid="ne30pg3_ne30pg3_mt232" compset="I2000Clm45Sp" testmods="clm-run_self_tests">
<test name="SMS_D_Ln1_Mmpi-serial" grid="1x1_brazil" compset="I2000Clm45Sp" testmods="clm-run_self_tests">
<machines>
<machine name="derecho" compiler="intel" category="decomp_init"/>
<machine name="izumi" compiler="nag" category="decomp_init"/>
</machines>
<options>
<option name="wallclock">0:05:00</option>
<option name="comment">mpi-serial self tests with DEBUG</option>
</options>
</test>
<test name="SMS_D_Ln1" grid="f10_f10_mt232" compset="I2000Clm45Sp" testmods="clm-run_self_tests">
<machines>
<machine name="derecho" compiler="intel" category="decomp_init"/>
<machine name="derecho" compiler="gnu" category="decomp_init"/>
<machine name="izumi" compiler="nag" category="decomp_init"/>
</machines>
<options>
<option name="wallclock">0:05:00</option>
<option name="comment">Self tests with DEBUG on for f10</option>
</options>
</test>
<test name="SMS_Ln1_P86x1" grid="ne30pg3_ne30pg3_mt232" compset="I2000Clm45Sp" testmods="clm-for_testing_fastsetup_bypassrun">
<machines>
<machine name="derecho" compiler="intel" category="decomp_init"/>
</machines>
Expand All @@ -4212,7 +4234,7 @@
<option name="comment">Initialization test for ne30pg3 with "Large" layout</option>
</options>
</test>
<test name="SMS_Ln1_P43x1" grid="ne30pg3_ne30pg3_mt232" compset="I2000Clm45Sp" testmods="clm-run_self_tests">
<test name="SMS_Ln1_P43x1" grid="ne30pg3_ne30pg3_mt232" compset="I2000Clm45Sp" testmods="clm-for_testing_fastsetup_bypassrun">
<machines>
<machine name="derecho" compiler="intel" category="decomp_init"/>
</machines>
Expand All @@ -4221,7 +4243,7 @@
<option name="comment">Initialization test for ne30pg3 with "Medium" layout</option>
</options>
</test>
<test name="SMS_Ln1_P22x1" grid="ne30pg3_ne30pg3_mt232" compset="I2000Clm45Sp" testmods="clm-run_self_tests">
<test name="SMS_Ln1_P22x1" grid="ne30pg3_ne30pg3_mt232" compset="I2000Clm45Sp" testmods="clm-for_testing_fastsetup_bypassrun">
<machines>
<machine name="derecho" compiler="intel" category="decomp_init"/>
</machines>
Expand All @@ -4230,7 +4252,7 @@
<option name="comment">Initialization test for ne30pg3 with "Small" layout</option>
</options>
</test>
<test name="SMS_Ln1_PL" grid="ne120pg3_ne120pg3_mt13" compset="I2000Clm45Sp" testmods="clm-run_self_tests">
<test name="SMS_Ln1_PL" grid="ne120pg3_ne120pg3_mt13" compset="I2000Clm45Sp" testmods="clm-for_testing_fastsetup_bypassrun">
<machines>
<machine name="derecho" compiler="intel" category="decomp_init"/>
</machines>
Expand All @@ -4239,7 +4261,7 @@
<option name="comment">Initialization test for ne120pg3 with "Large" layout</option>
</options>
</test>
<test name="SMS_Ln1_PL" grid="mpasa15_mpasa15" compset="I2000Clm45Sp" testmods="clm-run_self_tests">
<test name="SMS_Ln1_PL" grid="mpasa15_mpasa15" compset="I2000Clm45Sp" testmods="clm-for_testing_fastsetup_bypassrun">
<machines>
<machine name="derecho" compiler="intel" category="decomp_init"/>
</machines>
Expand All @@ -4248,6 +4270,15 @@
<option name="comment">Initialization test for mpasa15 with "Large" layout</option>
</options>
</test>
<test name="SMS_Ln1" grid="mpasa3p75_mpasa3p75_mt13" compset="I2000Clm45Sp" testmods="clm-for_testing_fastsetup_bypassrun--clm-mpasa3p75">
<machines>
<machine name="derecho" compiler="intel" category="uhr_decomp_init"/>
</machines>
<options>
<option name="wallclock">0:15:00</option>
<option name="comment">Initialization test for mpasa3p75 default layout</option>
</options>
</test>

<test name="LGRAIN2_Ly1_P128x1" grid="f10_f10_mg37" compset="I1850Clm50BgcCrop" testmods="clm/ciso--clm/cropMonthOutput">
<machines>
Expand Down Expand Up @@ -4534,6 +4565,16 @@
</options>
</test>

<test name="SETPARAMFILE_Ld5" grid="f10_f10_mg37" compset="I1850Clm60BgcCrujra" testmods="clm/default">
<machines>
<machine name="derecho" compiler="gnu" category="aux_clm"/>
<machine name="derecho" compiler="gnu" category="clm_pymods"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
</options>
</test>

<test name="SMS_Ld5" grid="f10_f10_mg37" compset="IHistClm60BgcCrop" testmods="clm/default">
<machines>
<machine name="derecho" compiler="gnu" category="interim_restart"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The purpose of this testmod directory is to setup for running fast testing
of initialization. So it bypasses the run phase and exits early.

We use cold start so that we can get through initialization faster,

I/O is turned off as much as possible.

And physics options that make the model run faster are used.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
./xmlchange CLM_FORCE_COLDSTART="on"

# We use this testmod in a _Ln1 test; this requires forcing the ROF coupling frequency to same frequency as DATM
./xmlchange ROF_NCPL='$ATM_NCPL'

# Turn off ROF model when used with compsets that have them
./xmlchange RTM_MODE='NULL'

# Turn MEGAN off to run faster
./xmlchange CLM_BLDNML_OPTS='--no-megan' --append

# Use fast structure and NWP configuration for speed
./xmlchange CLM_STRUCTURE="fast"
./xmlchange CLM_CONFIGURATION="nwp"

# Restarts aren't allowed for these tests, and turn off CPL history
# First change in env_test.xml, then in the standard one so it won't complain there
./xmlchange --force REST_OPTION="never" --file env_test.xml
./xmlchange --force HIST_OPTION="never" --file env_test.xml
./xmlchange REST_OPTION="never"
./xmlchange HIST_OPTION="never"

# Timer settings
./xmlchange TIMER_DETAIL="2"
./xmlchange SAVE_TIMING="TRUE"
./xmlchange CHECK_TIMING="TRUE"
./xmlchange ESMF_PROFILING_LEVEL="10"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
! Turn off history, restarts, and output
hist_empty_htapes = .true.
use_noio = .true.

! Turn off urban options, and only do urban in gridcells that are majority urban
urban_hac = 'OFF'
toosmall_urban = 98.0d00 ! Minimize urban in gridcells
6 changes: 6 additions & 0 deletions cime_config/testdefs/testmods_dirs/clm/mpasa3p75/user_nl_clm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
! Settings currently required to run at the mpasa3p75 grid
! urbantv files at that resolution and use a redistribution mapping

stream_fldfilename_urbantv = '$DIN_LOC_ROOT/lnd/clm2/urbandata/CTSM52_tbuildmax_OlesonFeddema_2020_mpasa3p75_fromf09_simyr1849-2106_c20240502.nc'
stream_meshfile_urbantv = '$DIN_LOC_ROOT/lnd/clm2/urbandata/CTSM52_tbuildmax_Oleson_2020_mpasa3p75_ESMFmesh_cdf5_c202405021.nc'
urbantvmapalgo = 'redist'
11 changes: 7 additions & 4 deletions cime_config/testdefs/testmods_dirs/clm/run_self_tests/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
The purpose of this testmod directory is to trigger the runtime
self-tests. This runs a suite of unit/integration tests.
The purpose of this testmod directory is to trigger runtime
initialization self-tests. This runs a set of unit/integration tests
that apply at initialization.

We use cold start so that we can get through initialization faster,
since how we initialize the model is unimportant for these self-tests.
We inherit the test-mod that sets up for testing and bypassing as much as possible for speed.

There are other self_tests that need to be exercised in the model time stepping
and are done outside of these.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../for_testing_fastsetup_bypassrun

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
for_testing_run_ncdiopio_tests = .true.

! Turn off history, restarts, and output
hist_empty_htapes = .true.
use_noio = .true.
Loading
Loading