Skip to content

Commit d43d777

Browse files
authored
Merge pull request #3326 from samsrabin/b4b-dev-merge-20250710
b4b-dev merge 2025-07-10
2 parents 400bfa0 + 0f7c453 commit d43d777

File tree

51 files changed

+1541
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1541
-232
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ cdf40d265cc82775607a1bf25f5f527bacc97405
6969
742cfa606039ab89602fde5fef46458516f56fd4
7070
4ad46f46de7dde753b4653c15f05326f55116b73
7171
75db098206b064b8b7b2a0604d3f0bf8fdb950cc
72+
84609494b54ea9732f64add43b2f1dd035632b4c

.github/workflows/formatting_python.yml renamed to .github/workflows/python-tests.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check Python formatting
1+
name: Run Python tests
22

33
on:
44
push:
@@ -18,7 +18,27 @@ on:
1818
- 'cime_config/buildnml/**'
1919

2020
jobs:
21-
lint-and-format-check:
21+
python-unit-tests:
22+
runs-on: ubuntu-latest
23+
steps:
24+
# Checkout the code
25+
- uses: actions/checkout@v4
26+
27+
# Set up the conda environment
28+
- uses: conda-incubator/setup-miniconda@v3
29+
with:
30+
activate-environment: ctsm_pylib
31+
environment-file: python/conda_env_ctsm_py.yml
32+
channels: conda-forge
33+
auto-activate-base: false
34+
35+
# Run Python unit tests check
36+
- name: Run Python unit tests
37+
run: |
38+
cd python
39+
conda run -n ctsm_pylib ./run_ctsm_py_tests -u
40+
41+
python-lint-and-black:
2242
runs-on: ubuntu-latest
2343
steps:
2444
# Checkout the code

bld/namelist_files/namelist_definition_ctsm.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,7 @@ snow melt of Brock et al. (2006)
30123012
group="clm_initinterp_inparm" valid_values="" >
30133013
If FALSE (which is the default): If an output type cannot be found in the input for initInterp,
30143014
code aborts
3015-
If TRUE: If an output type cannot be found in the input, fill with closest natural veg column
3015+
If TRUE: If a non-urban output type cannot be found in the input, fill with closest natural veg column
30163016
(using bare soil for patch-level variables)
30173017

30183018
NOTE: Natural vegetation and crop landunits always behave as if this were true. e.g., if
@@ -3021,6 +3021,14 @@ always fill with the closest natural veg patch / column, regardless of the value
30213021
flag. So interpolation from non-crop to crop cases can be done without setting this flag.
30223022
</entry>
30233023

3024+
<entry id="init_interp_fill_missing_urban_with_HD" type="logical" category="datasets"
3025+
group="clm_initinterp_inparm" valid_values="" >
3026+
If FALSE (which is the default): If an urban output type cannot be found in the input for initInterp,
3027+
code aborts
3028+
If TRUE: If an urban output type cannot be found in the input, fill with closest urban high density
3029+
(HD) landunit
3030+
</entry>
3031+
30243032
<entry id="init_interp_method" type="char*64" category="datasets"
30253033
group="clm_initinterp_inparm"
30263034
valid_values="general,use_finidat_areas" >

cime_config/SystemTests/lreprstruct.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
1717
"""
1818

19+
import re
20+
1921
from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo
2022
from CIME.XML.standard_module_setup import *
2123
from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files
@@ -53,13 +55,16 @@ def _case_one_setup(self):
5355
user_nl_clm_path = os.path.join(self._get_caseroot(), "user_nl_clm")
5456
with open(user_nl_clm_path) as f:
5557
user_nl_clm_text = f.read()
56-
for grain_output in re.findall("GRAIN\w*", user_nl_clm_text):
57-
user_nl_clm_text = user_nl_clm_text.replace(
58-
grain_output,
58+
59+
def replace_grain(match):
60+
grain_output = match.group()
61+
return (
5962
grain_output.replace("GRAIN", "REPRODUCTIVE1")
6063
+ "', '"
61-
+ grain_output.replace("GRAIN", "REPRODUCTIVE2"),
64+
+ grain_output.replace("GRAIN", "REPRODUCTIVE2")
6265
)
66+
67+
user_nl_clm_text = re.sub(r"GRAIN\w*", replace_grain, user_nl_clm_text)
6368
with open(user_nl_clm_path, "w") as f:
6469
f.write(user_nl_clm_text)
6570

cime_config/SystemTests/sspmatrixcn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""
1515

1616
import shutil, glob, os, sys
17+
from pathlib import Path
1718
from datetime import datetime
1819

1920
if __name__ == "__main__":
@@ -205,9 +206,9 @@ def run_indv(self, nstep, st_archive=True):
205206
restdir = os.path.join(rest_r, rundate)
206207
os.mkdir(restdir)
207208
rpoint = os.path.join(restdir, "rpointer.clm." + rundate)
208-
os.mknod(rpoint)
209+
Path.touch(rpoint)
209210
rpoint = os.path.join(restdir, "rpointer.cpl." + rundate)
210-
os.mknod(rpoint)
211+
Path.touch(rpoint)
211212

212213
def run_phase(self):
213214
"Run phase"

0 commit comments

Comments
 (0)