Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/srt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
# Versions of all dependencies can be updated here
ESMF_VERSION: v8.8.0
PARALLELIO_VERSION: pio2_6_5
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates to latest PIO, not related to issue of the PR.

PARALLELIO_VERSION: pio2_6_6
CIME_MODEL: cesm
CIME_DRIVER: nuopc
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
27 changes: 25 additions & 2 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
raise SystemExit("ERROR: must set CIMEROOT environment variable")

sys.path.append(os.path.join(_CIMEROOT, "scripts", "Tools"))
sys.path.append(os.path.join(_CIMEROOT, "CIME", "Tools"))
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path change from 'scripts/Tools' to 'CIME/Tools' appears unrelated to the main PR purpose of moving library lists to driver buildnml. Consider separating this path update into a separate commit or explaining its necessity in the PR description.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrects an incorrect path, should have been changed years ago.


import shutil, glob, itertools
from standard_script_setup import *
Expand Down Expand Up @@ -628,13 +628,36 @@ def compare_drv_flds_in(first, second, infile1, infile2):
% (infile1, infile2),
)

def cmeps_lib_list(case):
# provide a list of support libs that must be built for this case
# should be ordered with dependent libraries listed after those depended on
# the library names should match the keys in variable BUILD_LIB_FILE from config_files.xml
ufs_driver = os.environ.get("UFS_DRIVER")
if ufs_driver:
logger.info("UFS_DRIVER is set to {}".format(ufs_driver))

libs = case.get_values("CASE_SUPPORT_LIBRARIES")

mpilib = case.get_value("MPILIB")
if mpilib == "mpi-serial":
libs.insert(0, mpilib)

ocn_model = case.get_value("COMP_OCN")
# These will be handled by MOM and CAM, included here for backward compatibility.
atm_dycore = case.get_value("CAM_DYCORE")
if (ocn_model == "mom" or (atm_dycore and atm_dycore == "fv3")) and "FMS" not in libs:
libs.append("FMS")
return libs

###############################################################################
def buildnml(case, caseroot, component):
###############################################################################
if component != "drv":
raise AttributeError

libs = cmeps_lib_list(case)
case.set_value("CASE_SUPPORT_LIBRARIES", ",".join(libs))

esmfmkfile = os.getenv("ESMFMKFILE")
expect(
esmfmkfile and os.path.isfile(esmfmkfile),
Expand Down Expand Up @@ -725,7 +748,7 @@ def buildnml(case, caseroot, component):
def _main_func():
caseroot = parse_input(sys.argv)

with Case(caseroot) as case:
with Case(caseroot, read_only=False) as case:
buildnml(case, caseroot, "drv")


Expand Down
18 changes: 15 additions & 3 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2522,10 +2522,22 @@
<desc>Remote git repository used for this case</desc>
</entry>

<!-- ===================================================================== -->
<!-- Include the AOFLUX calculation for this compset -->
<!-- ===================================================================== -->
<entry id="CASE_SUPPORT_LIBRARIES">
<type>char</type>
<default_value></default_value>
<values>
<value cime_model="cesm">gptl,pio,csm_share,FTorch,CDEPS</value>
</values>
<group>build_def</group>
<file>env_build.xml</file>
<desc>Support libraries required</desc>
</entry>


<!-- ===================================================================== -->
<!-- Include the AOFLUX calculation for this compset -->
<!-- ===================================================================== -->

<entry id="ADD_AOFLUX_TO_RUNSEQ">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
Expand Down
Loading