From 7695c1f91854d7007888c106508da40f56a7d2dd Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 26 Feb 2021 10:35:33 -0700 Subject: [PATCH 1/4] passes test SMS_D_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm45BgcCropQianRs.cheyenne_intel.clm-cropMonthOutput --- config/cesm/config_files.xml | 2 +- config/cesm/config_grids.xml | 184 +++++++++++------- config/cesm/config_grids_mct.xml | 2 +- ...g_grids_v2.1.xsd => config_grids_v2.2.xsd} | 45 +++-- scripts/lib/CIME/XML/grids.py | 7 +- 5 files changed, 149 insertions(+), 91 deletions(-) rename config/xml_schemas/{config_grids_v2.1.xsd => config_grids_v2.2.xsd} (76%) diff --git a/config/cesm/config_files.xml b/config/cesm/config_files.xml index 09e1bbadcc7..7e9a1d5647f 100644 --- a/config/cesm/config_files.xml +++ b/config/cesm/config_files.xml @@ -30,7 +30,7 @@ case_last env_case.xml file containing specification of all supported model grids, domains and mapping files (for documentation only - DO NOT EDIT) - $CIMEROOT/config/xml_schemas/config_grids_v2.1.xsd + $CIMEROOT/config/xml_schemas/config_grids_v2.2.xsd diff --git a/config/cesm/config_grids.xml b/config/cesm/config_grids.xml index e946616438f..8537503b148 100644 --- a/config/cesm/config_grids.xml +++ b/config/cesm/config_grids.xml @@ -31,19 +31,19 @@ null null rx1 - r05 + r05 r05 HDMA rx1 r05 r05 - null - gland5UM - gland4 + null + gland5UM + gland4 gland4 - null - ww3a - ww3a + null + ww3a + ww3a ww3a null @@ -1290,64 +1290,6 @@ null is no grid: - - - - - - 1 1 - domain.ocn.01col.ArcticOcean.20150824.nc - domain.ocn.01col.ArcticOcean.20150824.nc - 01col is a single-column grid for datm and POP: - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.${CLM_USRDAT_NAME}_navy.nc - create_mesh - user specified domain - only valid for DATM/CLM compset - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-numaIA_navy.110106.nc - create_mesh - 1x1 Numa Iowa -- only valid for DATM/CLM compset - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-brazil_navy.090715.nc - create_mesh - 1x1 Brazil -- only valid for DATM/CLM compset - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-smallvilleIA_test.110106.nc - create_mesh - 1x1 Smallville Iowa Crop Test Case -- only valid for DATM/CLM compset - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-camdenNJ_navy.111004.nc - create_mesh - 1x1 Camden New Jersey -- only valid for DATM/CLM compset - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-mexicocityMEX_navy.090715.nc - create_mesh - 1x1 Mexico City Mexico -- only valid for DATM/CLM compset - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-vancouverCAN_navy.090715.nc - create_mesh - 1x1 Vancouver Canada -- only valid for DATM/CLM compset - - - 1 1 - $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-urbanc_alpha_test.110201.nc - create_mesh - 1x1 Urban C Alpha Test Case -- only valid for DATM/CLM compset - @@ -1446,7 +1388,7 @@ 24 19 $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.fv10x15_USGS.110713.nc - $DIN_LOC_ROOT/share/domains/domain.clm/domain.ocn.fv10x15_USGS_070807.nc + $DIN_LOC_ROOT/share/domains/domain.clm/domain.ocn.fv10x15_USGS_070807.nc $DIN_LOC_ROOT/share/domains/domain.lnd.fv10x15_gx3v7.180321.nc $DIN_LOC_ROOT/share/domains/domain.ocn.fv10x15_gx3v7.180321.nc $DIN_LOC_ROOT/share/meshes/10x15_nomask_c110308_ESMFmesh.nc @@ -2012,11 +1954,119 @@ + + + + + + 1 1 + domain.ocn.01col.ArcticOcean.20150824.nc + domain.ocn.01col.ArcticOcean.20150824.nc + 01col is a single-column grid for datm and POP: + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.${CLM_USRDAT_NAME}_navy.nc + create_mesh + user specified domain - only valid for DATM/CLM compset + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-numaIA_navy.110106.nc + create_mesh + 1x1 Numa Iowa -- only valid for DATM/CLM compset + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-brazil_navy.090715.nc + create_mesh + 1x1 Brazil -- only valid for DATM/CLM compset + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-smallvilleIA_test.110106.nc + create_mesh + 1x1 Smallville Iowa Crop Test Case -- only valid for DATM/CLM compset + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-camdenNJ_navy.111004.nc + create_mesh + 1x1 Camden New Jersey -- only valid for DATM/CLM compset + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-mexicocityMEX_navy.090715.nc + create_mesh + 1x1 Mexico City Mexico -- only valid for DATM/CLM compset + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-vancouverCAN_navy.090715.nc + create_mesh + 1x1 Vancouver Canada -- only valid for DATM/CLM compset + + + 1 1 + $DIN_LOC_ROOT/share/domains/domain.clm/domain.lnd.1x1pt-urbanc_alpha_test.110201.nc + create_mesh + 1x1 Urban C Alpha Test Case -- only valid for DATM/CLM compset + + + + + + + + 83.144928 + 359.150902 + 01col is a single-column grid for datm and POP: + + + + user specified domain - only valid for DATM/CLM compset + + + 40.6878 + 267.0228 + 1x1 Numa Iowa -- only valid for DATM/CLM compset + + + -7.0 + 305.0 + 1x1 Brazil -- only valid for DATM/CLM compset + + + 40.6878 + 267.0228 + 1x1 Smallville Iowa Crop Test Case -- only valid for DATM/CLM compset + + + 40.0 + 285.0 + 1x1 Camden New Jersey -- only valid for DATM/CLM compset + + + 19.5 + 260.5 + 1x1 Mexico City Mexico -- only valid for DATM/CLM compset + + + 49.5 + 236.5 + 1x1 Vancouver Canada -- only valid for DATM/CLM compset + + + -37.7308 + 0.0 + 1x1 Urban C Alpha Test Case -- only valid for DATM/CLM compset + + + - diff --git a/config/cesm/config_grids_mct.xml b/config/cesm/config_grids_mct.xml index b784a36c285..025e86574c6 100644 --- a/config/cesm/config_grids_mct.xml +++ b/config/cesm/config_grids_mct.xml @@ -1,10 +1,10 @@ - + cpl/gridmaps/C24/map_C24_TO_gx1v6_aave.181018.nc diff --git a/config/xml_schemas/config_grids_v2.1.xsd b/config/xml_schemas/config_grids_v2.2.xsd similarity index 76% rename from config/xml_schemas/config_grids_v2.1.xsd rename to config/xml_schemas/config_grids_v2.2.xsd index 7fdc92a29e9..26d77f878f3 100644 --- a/config/xml_schemas/config_grids_v2.1.xsd +++ b/config/xml_schemas/config_grids_v2.2.xsd @@ -1,24 +1,24 @@ - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -26,6 +26,8 @@ + + @@ -35,7 +37,7 @@ - + @@ -78,14 +80,17 @@ + - - + + + + diff --git a/scripts/lib/CIME/XML/grids.py b/scripts/lib/CIME/XML/grids.py index b56a408a9b7..4298b46fa2c 100644 --- a/scripts/lib/CIME/XML/grids.py +++ b/scripts/lib/CIME/XML/grids.py @@ -24,7 +24,7 @@ def __init__(self, infile=None, files=None): expect(False, "Could not initialize Grids") self._version = self.get_version() - + print("grid version is {}".format(self._version)) self._comp_gridnames = self._get_grid_names() def _get_grid_names(self): @@ -229,7 +229,10 @@ def _get_domains(self, component_grids, atmlevregex, lndlevregex, driver): # Determine all domain information search for the grid name with no level suffix in config_grids.xml domain_node = self.get_optional_child("domain", attributes={"name":grid_name_nonlev}, root=self.get_child("domains")) - if domain_node is not None: + if not domain_node: + domain_node = self.get_optional_child("domain", attributes={"name":grid_name_nonlev}, + root=self.get_child("domains",{"driver":driver})) + if domain_node: comp_name = grid[0].upper() # determine xml variable name From b1d6779f6ff0e1a9e6d1bcfa9b2a36478a72f5e1 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 26 Feb 2021 12:46:47 -0700 Subject: [PATCH 2/4] read lat and lon for 1pt in cmeps driver --- scripts/lib/CIME/XML/grids.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/lib/CIME/XML/grids.py b/scripts/lib/CIME/XML/grids.py index 4298b46fa2c..7a7cb0deb6d 100644 --- a/scripts/lib/CIME/XML/grids.py +++ b/scripts/lib/CIME/XML/grids.py @@ -237,8 +237,17 @@ def _get_domains(self, component_grids, atmlevregex, lndlevregex, driver): # determine xml variable name if not comp_name == "MASK": - domains[comp_name + "_NX"] = int(self.get_element_text("nx", root=domain_node)) - domains[comp_name + "_NY"] = int(self.get_element_text("ny", root=domain_node)) + if self.get_element_text("nx", root=domain_node): + domains[comp_name + "_NX"] = int(self.get_element_text("nx", root=domain_node)) + domains[comp_name + "_NY"] = int(self.get_element_text("ny", root=domain_node)) + elif self.get_element_text("lon", root=domain_node): + domains[comp_name + "_NX"] = 1 + domains[comp_name + "_NY"] = 1 + domains["PTS_LAT"] = self.get_element_text("lat", root=domain_node) + domains["PTS_LON"] = self.get_element_text("lon", root=domain_node) + else: + expect(False,"In config_grids.xml either nx and ny or lat and lon must be set") + file_name = comp_name + "_DOMAIN_FILE" path_name = comp_name + "_DOMAIN_PATH" mesh_name = comp_name + "_DOMAIN_MESH" From 032d5d7650f93d6d875ef3910b9d40fc4e90c5ea Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 26 Feb 2021 13:35:28 -0700 Subject: [PATCH 3/4] remove debug print --- scripts/lib/CIME/XML/grids.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/lib/CIME/XML/grids.py b/scripts/lib/CIME/XML/grids.py index 7a7cb0deb6d..11ebd66d4e1 100644 --- a/scripts/lib/CIME/XML/grids.py +++ b/scripts/lib/CIME/XML/grids.py @@ -24,7 +24,6 @@ def __init__(self, infile=None, files=None): expect(False, "Could not initialize Grids") self._version = self.get_version() - print("grid version is {}".format(self._version)) self._comp_gridnames = self._get_grid_names() def _get_grid_names(self): From 5ee267db7f5df2d23e2b9e2c1727a825ea5153ae Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 26 Feb 2021 16:24:14 -0700 Subject: [PATCH 4/4] need to allow for this case for user entered latlon --- scripts/lib/CIME/XML/grids.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/lib/CIME/XML/grids.py b/scripts/lib/CIME/XML/grids.py index 11ebd66d4e1..fe29e179be9 100644 --- a/scripts/lib/CIME/XML/grids.py +++ b/scripts/lib/CIME/XML/grids.py @@ -245,7 +245,8 @@ def _get_domains(self, component_grids, atmlevregex, lndlevregex, driver): domains["PTS_LAT"] = self.get_element_text("lat", root=domain_node) domains["PTS_LON"] = self.get_element_text("lon", root=domain_node) else: - expect(False,"In config_grids.xml either nx and ny or lat and lon must be set") + domains[comp_name + "_NX"] = 1 + domains[comp_name + "_NY"] = 1 file_name = comp_name + "_DOMAIN_FILE" path_name = comp_name + "_DOMAIN_PATH"