Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point to a git version of cism and get standalone build to work #189

Merged
merged 9 commits into from
Jan 16, 2018
31 changes: 31 additions & 0 deletions .config_files.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>

<?xml-stylesheet type="text/xsl" ?>

<entry_id>

<!-- This is the same as the default entry in
cime/config/cesm/config_files.xml except for the value for clm:
In a standalone clm checkout, COMP_ROOT_DIR_LND is $SRCROOT
rather than $SRCROOT/components/clm.

However, because of the way overrides are handled, we need to
re-specify the full information here rather than just overriding
the value for clm.
-->
<entry id="COMP_ROOT_DIR_LND">
Copy link
Member Author

Choose a reason for hiding this comment

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

I was hoping that I could get away with just specifying the new COMP_ROOT_DIR_LND for clm, without duplicating all of the metadata and without duplicating the entries for dlnd, slnd or xlnd. Alas, this doesn't seem possible:

  • When I didn't duplicate all of the metadata (group, file, etc.), the python complained about missing file

  • When I didn't specify entries for dlnd, slnd and xlnd, I wasn't able to run a T compset (CISM forced by dlnd). I know it's kind of funny to run a compset without CLM from a standalone CLM checkout, but I sometimes do that for testing, and I can see some value in allowing it for scientists as well, so I don't want to lose that ability.

This isn't a big deal, but @bandre-ucar @jedwards4b - am I missing something that would allow me to make this override file briefer?

Copy link
Contributor

Choose a reason for hiding this comment

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

You aren't missing anything, the override needs to be a complete entry. I'm not aware of a way to make it shorter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, thanks a lot for taking a look at this

<type>char</type>
<default_value>unset</default_value>
<values>
<value component="clm" >$SRCROOT</value>
<value component="dlnd" >$CIMEROOT/src/components/data_comps/dlnd</value>
<value component="slnd" >$CIMEROOT/src/components/stub_comps/slnd</value>
<value component="xlnd" >$CIMEROOT/src/components/xcpl_comps/xlnd</value>
</values>
<group>case_comps</group>
<file>env_case.xml</file>
<desc>Root directory of the case land model component </desc>
<schema>$CIMEROOT/config/xml_schemas/config_compsets.xsd</schema>
</entry>

</entry_id>
9 changes: 5 additions & 4 deletions CESM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ required = True

[cism]
local_path = components/cism
protocol = svn
repo_url = https://svn-ccsm-models.cgd.ucar.edu/glc
tag = trunk_tags/cism2_1_40
protocol = git
repo_url = https://github.com/ESCOMP/cism-wrapper
branch = add_manage_externals_file
externals = CISM.cfg
Copy link
Member Author

Choose a reason for hiding this comment

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

@bandre-ucar do I need to explicitly point to an externals file like this, or can it be auto-detected if I name it appropriately?

Copy link
Contributor

Choose a reason for hiding this comment

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

It needs to be explicitly listed.

required = True

[rtm]
Expand All @@ -29,7 +30,7 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/CESM-Development/cime
tag = billsacks/always_glcmec_n01
tag = billsacks/always_glcmec_n02
required = True

[externals_description]
Expand Down
4 changes: 2 additions & 2 deletions cime_config/buildcpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def buildcpp(case):
"""

caseroot = case.get_value("CASEROOT")
srcroot = case.get_value("SRCROOT")
lnd_root = case.get_value("COMP_ROOT_DIR_LND")
lnd_grid = case.get_value("LND_GRID")
mask_grid = case.get_value("MASK_GRID")
clm_usrdat_name = case.get_value("CLM_USRDAT_NAME")
Expand All @@ -35,7 +35,7 @@ def buildcpp(case):
if not os.path.isdir(clmconf):
os.makedirs(clmconf)

cmd = os.path.join(srcroot,"components","clm","bld","configure")
cmd = os.path.join(lnd_root,"bld","configure")
command = "%s %s %s -usr_src %s -comp_intf mct " \
%(cmd, config_opts, clm_config_opts, os.path.join(caseroot,"SourceMods","src.clm"))

Expand Down
31 changes: 15 additions & 16 deletions cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _main_func():
with Case(caseroot) as case:

casetools = case.get_value("CASETOOLS")
srcroot = case.get_value("SRCROOT")
lnd_root = case.get_value("COMP_ROOT_DIR_LND")
gmake_j = case.get_value("GMAKE_J")
gmake = case.get_value("GMAKE")
mach = case.get_value("MACH")
Expand All @@ -48,7 +48,7 @@ def _main_func():
# create Filepath file and clm_cppdefs for clm4_0
#-------------------------------------------------------
# the call to configure here creates BOTH the Filepath file and the clm_cppdefs
cmd = os.path.join(os.path.join(srcroot,"components","clm","cime_config","buildcpp"))
cmd = os.path.join(os.path.join(lnd_root,"cime_config","buildcpp"))
logger.info(" ...calling clm buildcpp to set build time options")
try:
mod = imp.load_source("buildcpp", cmd)
Expand All @@ -68,22 +68,21 @@ def _main_func():
#-------------------------------------------------------
filepath_file = os.path.join(bldroot,"Filepath")
if not os.path.isfile(filepath_file):
srcroot = case.get_value("SRCROOT")
caseroot = case.get_value("CASEROOT")
paths = [os.path.join(caseroot,"SourceMods","src.clm"),
os.path.join(srcroot,"components","clm","src","main"),
os.path.join(srcroot,"components","clm","src","biogeophys"),
os.path.join(srcroot,"components","clm","src","biogeochem"),
os.path.join(srcroot,"components","clm","src","soilbiogeochem"),
os.path.join(srcroot,"components","clm","src","dyn_subgrid"),
os.path.join(srcroot,"components","clm","src","init_interp"),
os.path.join(srcroot,"components","clm","src","fates"),
os.path.join(srcroot,"components","clm","src","fates","main"),
os.path.join(srcroot,"components","clm","src","fates","biogeophys"),
os.path.join(srcroot,"components","clm","src","fates","biogeochem"),
os.path.join(srcroot,"components","clm","src","fates","fire"),
os.path.join(srcroot,"components","clm","src","utils"),
os.path.join(srcroot,"components","clm","src","cpl")]
os.path.join(lnd_root,"src","main"),
os.path.join(lnd_root,"src","biogeophys"),
os.path.join(lnd_root,"src","biogeochem"),
os.path.join(lnd_root,"src","soilbiogeochem"),
os.path.join(lnd_root,"src","dyn_subgrid"),
os.path.join(lnd_root,"src","init_interp"),
os.path.join(lnd_root,"src","fates"),
os.path.join(lnd_root,"src","fates","main"),
os.path.join(lnd_root,"src","fates","biogeophys"),
os.path.join(lnd_root,"src","fates","biogeochem"),
os.path.join(lnd_root,"src","fates","fire"),
os.path.join(lnd_root,"src","utils"),
os.path.join(lnd_root,"src","cpl")]
with open(filepath_file, "w") as filepath:
filepath.write("\n".join(paths))
filepath.write("\n")
Expand Down
6 changes: 3 additions & 3 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def buildnml(case, caseroot, compname):
if compname != "clm":
raise AttributeError

srcroot = case.get_value("SRCROOT")
lnd_root = case.get_value("COMP_ROOT_DIR_LND")
din_loc_root = case.get_value("DIN_LOC_ROOT")
ccsm_co2_ppmv = case.get_value("CCSM_CO2_PPMV")
clm_co2_type = case.get_value("CLM_CO2_TYPE")
Expand Down Expand Up @@ -105,7 +105,7 @@ def buildnml(case, caseroot, compname):
if not filecmp.cmp(file1, file2):
call_buildcpp = True
if call_buildcpp:
cmd = os.path.join(os.path.join(srcroot,"components","clm","cime_config","buildcpp"))
cmd = os.path.join(os.path.join(lnd_root,"cime_config","buildcpp"))
logger.info(" ...calling clm buildcpp to set build time options")
try:
mod = imp.load_source("buildcpp", cmd)
Expand Down Expand Up @@ -225,7 +225,7 @@ def buildnml(case, caseroot, compname):

create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines))

cmd = os.path.join(srcroot, "components","clm","bld","build-namelist")
cmd = os.path.join(lnd_root,"bld","build-namelist")

command = ("%s -infile %s -csmdata %s -inputdata %s %s -namelist \"&clm_inparm start_ymd=%s %s/ \" "
"%s %s -res %s %s -clm_start_type %s -envxml_dir %s -l_ncpl %s "
Expand Down