Skip to content

Commit

Permalink
Merge branch 'master' into lnd2glc_bilinear
Browse files Browse the repository at this point in the history
Merging in latest version of master for the sake of testing the
integration
  • Loading branch information
billsacks committed May 25, 2017
2 parents bb9b17a + 2deb949 commit 6d8cda5
Show file tree
Hide file tree
Showing 58 changed files with 1,691 additions and 939 deletions.
442 changes: 370 additions & 72 deletions ChangeLog

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion config/acme/machines/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@
<machine MACH="anlworkstation">
<DESC>Linux workstation for ANL</DESC>
<NODENAME_REGEX>compute.*mcs.anl.gov</NODENAME_REGEX>
<PROXY></PROXY>
<TESTS>acme_developer</TESTS>
<OS>LINUX</OS>
<COMPILERS>gnu</COMPILERS>
Expand Down
13 changes: 6 additions & 7 deletions config/acme/machines/template.case.test
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/usr/bin/env python

# Batch system directives
{{ batchdirectives }}

"""
This is the system test submit script for CIME. This should only ever be called
by case.submit when on batch system. This script only exists as a way of providing
batch directives. Use case.submit from the command line to run your case.
"""

import os, sys
os.chdir( '{{ caseroot }}')

Expand Down Expand Up @@ -50,12 +46,15 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
parser.add_argument("--caseroot",
help="Case directory to build")

parser.add_argument("--reset", action="store_true",
help="Reset the case to its original state as defined by config_tests.xml")

args = CIME.utils.parse_args_and_handle_standard_logging_options(args, parser)

if args.caseroot is not None:
os.chdir(args.caseroot)

return args.caseroot, args.testname
return args.caseroot, args.testname, args.reset

###############################################################################
def _main_func(description):
Expand All @@ -64,9 +63,9 @@ def _main_func(description):
test_results = doctest.testmod(verbose=True)
sys.exit(1 if test_results.failed > 0 else 0)

caseroot, testname = parse_command_line(sys.argv, description)
caseroot, testname, reset = parse_command_line(sys.argv, description)
with Case(caseroot, read_only=False) as case:
success = case_test(case, testname)
success = case_test(case, testname, reset)

sys.exit(0 if success else 1)

Expand Down
41 changes: 24 additions & 17 deletions config/cesm/config_grids.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
=========================================
The notation for the grid longname is
a%name_l%name_oi%name_r%name_m%mask_g%name_w%name
where
where
a% => atm, l% => lnd, oi% => ocn/ice, r% => river, m% => mask, g% => glc, w% => wav

Supported out of the box grid configurations are given via alias specification in
the file "config_grids.xml". Each grid alias can also be associated with the
the file "config_grids.xml". Each grid alias can also be associated with the
following optional attributes

compset (Regular expression for compset matches that are required for this grid)
Expand All @@ -35,12 +35,15 @@
<grid name="rof" compset="MOSART">r05</grid>
<grid name="rof" compset="DROF" >rx1</grid>
<grid name="rof" compset="DROF%CPLHIST">r05</grid>
<grid name="rof" compset="XROF" >r05</grid>
<grid name="glc" compset="SGLC" >null</grid>
<grid name="glc" compset="CISM1" >gland5UM</grid>
<grid name="glc" compset="CISM2" >gland4</grid>
<grid name="glc" compset="XGLC" >gland4</grid>
<grid name="wav" compset="SWAV" >null</grid>
<grid name="wav" compset="DWAV" >ww3a</grid>
<grid name="wav" compset="WW3" >ww3a</grid>
<grid name="wav" compset="XWAV" >ww3a</grid>
</model_grid_defaults>

<model_grid alias="g16_g16" compset="DATM.+DROF">
Expand Down Expand Up @@ -586,7 +589,7 @@
<grid name="ocnice">10x15</grid>
<mask>usgs</mask>
</model_grid>

<model_grid alias="f10_f10_musgs" not_compset="_POP">
<grid name="atm">10x15</grid>
<grid name="lnd">10x15</grid>
Expand Down Expand Up @@ -971,6 +974,8 @@
<nx>144</nx> <ny>96</ny>
<file grid="atm|lnd" mask="gx1v6">domain.lnd.fv1.9x2.5_gx1v6.090206.nc</file>
<file grid="ocnice" mask="gx1v6">domain.ocn.1.9x2.5_gx1v6_090403.nc</file>
<file grid="atm|lnd" mask="gx1v7">domain.lnd.fv1.9x2.5_gx1v7.170518.nc</file>
<file grid="ocnice" mask="gx1v7">domain.ocn.fv1.9x2.5_gx1v7.170518.nc</file>
<file grid="ocnice" mask="null">domain.aqua.fv1.9x2.5.nc</file>
<desc>1.9x2.5 is FV 2-deg grid:</desc>
</domain>
Expand Down Expand Up @@ -1089,8 +1094,8 @@

<domain name="gx1v7">
<nx>320</nx> <ny>384</ny>
<file grid="atm|lnd">$DIN_LOC_ROOT/share/domains/domain.ocn.gx1v7.151020.nc</file>
<file grid="ocnice">$DIN_LOC_ROOT/share/domains/domain.ocn.gx1v7.151020.nc</file>
<file grid="atm|lnd">$DIN_LOC_ROOT/share/domains/domain.ocn.gx1v7.151008.nc</file>
<file grid="ocnice">$DIN_LOC_ROOT/share/domains/domain.ocn.gx1v7.151008.nc</file>
<desc>gx1v7 is displaced Greenland pole 1-deg grid with Caspian as a land feature:</desc>
</domain>

Expand Down Expand Up @@ -1154,7 +1159,7 @@
</domain>

<domain name="gland4">
<nx>376</nx> <ny>701</ny>
<nx>416</nx> <ny>704</ny>
<desc>4-km Greenland grid, for use with the glissade dycore</desc>
</domain>

Expand Down Expand Up @@ -1264,6 +1269,13 @@
<map name="OCN2ATM_FMAPNAME">cpl/gridmaps/gx1v6/map_gx1v6_TO_fv1.9x2.5_aave.130322.nc</map>
<map name="OCN2ATM_SMAPNAME">cpl/gridmaps/gx1v6/map_gx1v6_TO_fv1.9x2.5_aave.130322.nc</map>
</gridmap>
<gridmap atm_grid="1.9x2.5" ocn_grid="gx1v7">
<map name="ATM2OCN_FMAPNAME">cpl/gridmaps/fv1.9x2.5/map_fv1.9x2.5_TO_gx1v7_aave.170518.nc</map>
<map name="ATM2OCN_SMAPNAME">cpl/gridmaps/fv1.9x2.5/map_fv1.9x2.5_TO_gx1v7_blin.170518.nc</map>
<map name="ATM2OCN_VMAPNAME">cpl/gridmaps/fv1.9x2.5/map_fv1.9x2.5_TO_gx1v7_patc.170518.nc</map>
<map name="OCN2ATM_FMAPNAME">cpl/gridmaps/gx1v7/map_gx1v7_TO_fv1.9x2.5_aave.170518.nc</map>
<map name="OCN2ATM_SMAPNAME">cpl/gridmaps/gx1v7/map_gx1v7_TO_fv1.9x2.5_aave.170518.nc</map>
</gridmap>
<gridmap atm_grid="1.9x2.5" ocn_grid="tx1v1">
<map name="ATM2OCN_FMAPNAME">cpl/cpl6/map_fv1.9x2.5_to_tx1v1_aave_da_090710.nc</map>
<map name="ATM2OCN_SMAPNAME">cpl/cpl6/map_fv1.9x2.5_to_tx1v1_bilin_da_090710.nc</map>
Expand Down Expand Up @@ -1476,6 +1488,12 @@
<map name="ICE2WAV_SMAPNAME">cpl/gridmaps/gx1v7/map_gx1v7_TO_ww3a_splice_170214.nc</map>
</gridmap>

<gridmap ocn_grid="tx1v1" wav_grid="ww3a">
<map name="WAV2OCN_SMAPNAME">cpl/gridmaps/ww3a/map_ww3a_TO_tx1v1_blin.170523.nc</map>
<map name="OCN2WAV_SMAPNAME">cpl/gridmaps/tx1v1/map_tx1v1_TO_ww3a_blin.170523.nc</map>
<map name="ICE2WAV_SMAPNAME">cpl/gridmaps/tx1v1/map_tx1v1_TO_ww3a_blin.170523.nc</map>
</gridmap>

<gridmap atm_grid="48x96" wav_grid="ww3a">
<map name="ATM2WAV_SMAPNAME">cpl/gridmaps/T31/map_T31_TO_ww3a_bilin_131104.nc</map>
</gridmap>
Expand Down Expand Up @@ -1655,17 +1673,6 @@
<map name="ROF2OCN_ICE_RMAPNAME">cpl/cpl6/map_r01_to_gx1v6_120711.nc</map>
</gridmap>

<!--- river flooding variables -->

<gridmap lnd_grid="1.9x2.5" rof_grid="r05" ocn_grid="gx1v6" >
<map name="XROF_FLOOD_MODE">ACTIVE</map>
</gridmap>

<gridmap lnd_grid="1.9x2.5" rof_grid="r05" ocn_grid="gx1v7" >
<map name="XROF_FLOOD_MODE">ACTIVE</map>
</gridmap>


<!-- ======================================================== -->
<!-- gridS: lnd to glc and glc to lnd mapping -->
<!-- -->
Expand Down
6 changes: 3 additions & 3 deletions config/cesm/machines/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<arg name="anum_tasks"> -np $TOTALPES</arg>
<arg name="labelstdout">-p "%g:"</arg>
<!-- the omplace argument needs to be last -->
<arg name="zthreadplacement"> omplace </arg>
<arg name="zthreadplacement"> omplace -tm open64 </arg>
</arguments>
</mpirun>
<mpirun mpilib="default" unit_testing="true">
Expand Down Expand Up @@ -259,7 +259,7 @@
<command name="load">gnu/6.3.0</command>
</modules>
<modules>
<command name="load">mpt/2.15</command>
<command name="load">mpt/2.15f</command>
<command name="load">ncarcompilers/0.3.5</command>
</modules>
<modules mpilib="mpi-serial">
Expand Down Expand Up @@ -878,7 +878,7 @@
<command name="load"> tool/parallel-netcdf/1.7.0/intel/mvapich2 </command>
</modules>
<modules compiler="pgi">
<command name="load">compiler/pgi/15.1</command>
<command name="load">compiler/pgi/17.04</command>
</modules>
<modules compiler="pgi" mpilib="mvapich2">
<command name="load"> tool/parallel-netcdf/1.6.1/pgi/mvapich2 </command>
Expand Down
9 changes: 6 additions & 3 deletions config/cesm/machines/template.case.test
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
parser.add_argument("--caseroot",
help="Case directory to build")

parser.add_argument("--reset", action="store_true",
help="Reset the case to its original state as defined by config_tests.xml")

args = CIME.utils.parse_args_and_handle_standard_logging_options(args, parser)

if args.caseroot is not None:
os.chdir(args.caseroot)

return args.caseroot, args.testname
return args.caseroot, args.testname, args.reset

###############################################################################
def _main_func(description):
Expand All @@ -60,9 +63,9 @@ def _main_func(description):
test_results = doctest.testmod(verbose=True)
sys.exit(1 if test_results.failed > 0 else 0)

caseroot, testname = parse_command_line(sys.argv, description)
caseroot, testname, reset = parse_command_line(sys.argv, description)
with Case(caseroot, read_only=False) as case:
success = case_test(case, testname)
success = case_test(case, testname, reset)

sys.exit(0 if success else 1)

Expand Down
7 changes: 2 additions & 5 deletions config/xml_schemas/config_compsets.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<xs:element name="alias" type="xs:NCName"/>
<xs:element name="lname" type="xs:string"/>
<xs:element name="science_support"/>
<xs:element name="user_mods" type="xs:string"/>

<!-- complex elements -->

Expand All @@ -33,9 +32,7 @@
<xs:element ref="alias"/>
<xs:element ref="lname"/>
<xs:element ref="science_support" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="user_mods" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute ref="grid"/>
</xs:complexType>
</xs:element>

Expand Down Expand Up @@ -68,8 +65,8 @@
<xs:element name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:NMTOKEN">
<xs:attribute ref="compset" use="required"/>
<xs:extension base="xs:string">
<xs:attribute ref="compset"/>
<xs:attribute ref="grid"/>
</xs:extension>
</xs:simpleContent>
Expand Down
12 changes: 6 additions & 6 deletions config/xml_schemas/env_mach_specific.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<xs:sequence>
<xs:element ref="header"/>
<xs:element ref="module_system"/>
<xs:element maxOccurs="unbounded" ref="environment_variables"/>
<xs:element maxOccurs="unbounded" ref="mpirun"/>
<xs:element maxOccurs="unbounded" ref="entry"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="environment_variables"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="mpirun"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="entry"/>
</xs:sequence>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="version" use="required"/>
Expand All @@ -35,9 +35,9 @@
<xs:element name="module_system">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="init_path"/>
<xs:element maxOccurs="unbounded" ref="cmd_path"/>
<xs:element maxOccurs="unbounded" ref="modules"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="init_path"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="cmd_path"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="modules"/>
</xs:sequence>
<xs:attribute name="type" use="required" type="xs:NCName"/>
</xs:complexType>
Expand Down
45 changes: 26 additions & 19 deletions scripts/Tools/xmlconvertors/config_pes_converter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
"""
config_pes_converter.py -- convert (or verify) config_pesfrom CIME2 format
to CIME5
config_pes_converter.py -- convert (or verify) config_pes elements from CIME2
format to CIME5. This tool will compare the two versions and suggest updates to
the CIME5 file.
The location of these files are needed by the script:
CIME2: cime/machines-acme/config_pes.xml
Expand All @@ -25,14 +26,15 @@ def parse_command_line(args):
CIME.utils.setup_standard_logging_options(parser)

# Set command line options
parser.add_argument("-cime2file", "--cime2file", help="location of config_grid.xml file in CIME2 repository")
parser.add_argument("-cime5file", "--cime5file", help="location of config_grids.xml file in CIME5 repository")
parser.add_argument("-cime2file", "--cime2file",
help="location of config_grid.xml file in CIME2 format",
required=True)
parser.add_argument("-cime5file", "--cime5file",
help="location of config_grids.xml file in CIME5 format",
required=True)

CIME.utils.parse_args_and_handle_standard_logging_options(args, parser)

if args.cime2file is None or args.cime5file is None:
parser.print_help()
exit()
args = CIME.utils.parse_args_and_handle_standard_logging_options(args,
parser)

return args.cime2file, args.cime5file

Expand Down Expand Up @@ -176,18 +178,23 @@ class PesTree(grid_xml_converter.DataTree):
def __init__(self, xmlfilename):
# original xml file has bad comments
import re, StringIO
with open(xmlfilename,'r') as xmlfile:
t1 = xmlfile.read()
t2 = re.sub(r'(?<=<!--)([ -]+)',
lambda x: x.group(0).replace('-',' '), t1)
t3 = re.sub(r'([ -]+)(?=-->)',
lambda x: x.group(0).replace('-',' '), t2)
tempxml = StringIO.StringIO(t3)
super(PesTree, self).__init__(tempxml)
tempxml.close()
if os.access(xmlfilename, os.R_OK):
with open(xmlfilename, 'r') as xmlfile:
t1 = xmlfile.read()
t2 = re.sub(r'(?<=<!--)([ -]+)',
lambda x: x.group(0).replace('-', ' '), t1)
t3 = re.sub(r'([ -]+)(?=-->)',
lambda x: x.group(0).replace('-', ' '), t2)
tempxml = StringIO.StringIO(t3)
super(PesTree, self).__init__(tempxml)
tempxml.close()

else:
super(PesTree, self).__init__(xmlfilename)

def populate(self):
if self.root is None:
return
xmlnodes = self.root.findall('grid')
nodeclass = Cime5PesNode

Expand Down Expand Up @@ -256,7 +263,7 @@ def diff_tree(atree, btree):
LOGGER.info("Number of wrong nodes: %d" % len(fixlist))
LOGGER.info("Number of missing nodes: %d" % len(addlist))
for miss in addlist:
LOGGER.info(miss[0].keyvalue())
LOGGER.debug(miss[0].keyvalue())
LOGGER.info("Number of duplicate nodes: %d" % len(duplist))
for dup in duplist:
LOGGER.info(dup)
Expand Down
Loading

0 comments on commit 6d8cda5

Please sign in to comment.