Skip to content

Commit b875259

Browse files
authored
Merge pull request #584 from jedwards4b/move_liblist_to_driver
moves liblist to driver buildnml making cime more generic. 3.8 failure is expected, will be fixed in next cesm tag.
2 parents 60034eb + 60a8e23 commit b875259

3 files changed

Lines changed: 41 additions & 6 deletions

File tree

.github/workflows/srt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
2929
# Versions of all dependencies can be updated here
3030
ESMF_VERSION: v8.8.0
31-
PARALLELIO_VERSION: pio2_6_5
31+
PARALLELIO_VERSION: pio2_6_6
3232
CIME_MODEL: cesm
3333
CIME_DRIVER: nuopc
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

cime_config/buildnml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ _CIMEROOT = os.environ.get("CIMEROOT")
77
if _CIMEROOT is None:
88
raise SystemExit("ERROR: must set CIMEROOT environment variable")
99

10-
sys.path.append(os.path.join(_CIMEROOT, "scripts", "Tools"))
10+
sys.path.append(os.path.join(_CIMEROOT, "CIME", "Tools"))
1111

1212
import shutil, glob, itertools
1313
from standard_script_setup import *
@@ -629,13 +629,36 @@ def compare_drv_flds_in(first, second, infile1, infile2):
629629
% (infile1, infile2),
630630
)
631631

632+
def cmeps_lib_list(case):
633+
# provide a list of support libs that must be built for this case
634+
# should be ordered with dependent libraries listed after those depended on
635+
# the library names should match the keys in variable BUILD_LIB_FILE from config_files.xml
636+
ufs_driver = os.environ.get("UFS_DRIVER")
637+
if ufs_driver:
638+
logger.info("UFS_DRIVER is set to {}".format(ufs_driver))
639+
640+
libs = case.get_values("CASE_SUPPORT_LIBRARIES")
641+
642+
mpilib = case.get_value("MPILIB")
643+
if mpilib == "mpi-serial":
644+
libs.insert(0, mpilib)
645+
646+
ocn_model = case.get_value("COMP_OCN")
647+
# These will be handled by MOM and CAM, included here for backward compatibility.
648+
atm_dycore = case.get_value("CAM_DYCORE")
649+
if (ocn_model == "mom" or (atm_dycore and atm_dycore == "fv3")) and "FMS" not in libs:
650+
libs.append("FMS")
651+
return libs
632652

633653
###############################################################################
634654
def buildnml(case, caseroot, component):
635655
###############################################################################
636656
if component != "drv":
637657
raise AttributeError
638658

659+
libs = cmeps_lib_list(case)
660+
case.set_value("CASE_SUPPORT_LIBRARIES", ",".join(libs))
661+
639662
esmfmkfile = os.getenv("ESMFMKFILE")
640663
expect(
641664
esmfmkfile and os.path.isfile(esmfmkfile),
@@ -726,7 +749,7 @@ def buildnml(case, caseroot, component):
726749
def _main_func():
727750
caseroot = parse_input(sys.argv)
728751

729-
with Case(caseroot) as case:
752+
with Case(caseroot, read_only=False) as case:
730753
buildnml(case, caseroot, "drv")
731754

732755

cime_config/config_component.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,10 +2522,22 @@
25222522
<desc>Remote git repository used for this case</desc>
25232523
</entry>
25242524

2525-
<!-- ===================================================================== -->
2526-
<!-- Include the AOFLUX calculation for this compset -->
2527-
<!-- ===================================================================== -->
2525+
<entry id="CASE_SUPPORT_LIBRARIES">
2526+
<type>char</type>
2527+
<default_value></default_value>
2528+
<values>
2529+
<value cime_model="cesm">gptl,pio,csm_share,FTorch,CDEPS</value>
2530+
</values>
2531+
<group>build_def</group>
2532+
<file>env_build.xml</file>
2533+
<desc>Support libraries required</desc>
2534+
</entry>
25282535

2536+
2537+
<!-- ===================================================================== -->
2538+
<!-- Include the AOFLUX calculation for this compset -->
2539+
<!-- ===================================================================== -->
2540+
25292541
<entry id="ADD_AOFLUX_TO_RUNSEQ">
25302542
<type>logical</type>
25312543
<valid_values>TRUE,FALSE</valid_values>

0 commit comments

Comments
 (0)