From 97ebaec61329a84affa978e14a2fb27b4f96656c Mon Sep 17 00:00:00 2001 From: Mats Bentsen Date: Wed, 21 Aug 2024 16:13:27 +0200 Subject: [PATCH 1/3] Made hybrid vertical coordinate selectable as compset option and defined vertical dimension in env_build.xml. --- cime_config/buildcpp | 14 ++---- cime_config/buildlib_2.1 | 12 ++--- cime_config/buildlib_2.2 | 1 - cime_config/buildnml | 2 +- cime_config/config_component.xml | 60 +++++++++++++++--------- cime_config/config_pes.xml | 20 ++++---- cime_config/namelist_definition_blom.xml | 8 ++-- 7 files changed, 63 insertions(+), 54 deletions(-) diff --git a/cime_config/buildcpp b/cime_config/buildcpp index ec5f5bac..d90374fd 100644 --- a/cime_config/buildcpp +++ b/cime_config/buildcpp @@ -36,20 +36,14 @@ def create_dimmod(case): comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN") ocn_grid = case.get_value("OCN_GRID") blom_vcoord = case.get_value("BLOM_VCOORD") + blom_kdm = case.get_value("BLOM_KDM") ntasks_ocn = case.get_value("NTASKS_OCN") objroot = case.get_value("OBJROOT") gridconf_dir = os.path.join(comp_root_dir_ocn, "bld", ocn_grid) - kdm_file = os.path.join(gridconf_dir, "kdm." + blom_vcoord) blom_dimensions_script = os.path.join(comp_root_dir_ocn, "bld", "blom_dimensions") - try: - with open(kdm_file, "r") as kdm_file_obj: - kdm = kdm_file_obj.read().strip() - except: - expect(False, "Failed to read kdm from file {}".format(kdm_file)) - - cmd = "{} -n {} -k {} -d {}".format(blom_dimensions_script, ntasks_ocn, kdm, gridconf_dir) + cmd = "{} -n {} -k {} -d {}".format(blom_dimensions_script, ntasks_ocn, blom_kdm, gridconf_dir) rc, out, err = run_cmd(cmd, from_dir=blomconf_dir) expect(rc == 0, "Command %s failed rc=%d\nout=%s\nerr=%s" % (cmd, rc, out, err)) @@ -95,10 +89,10 @@ def buildcpp(case): if ocn_grid in ["gx1v5", "gx1v6", "tnx1v1", "tnx1v3", "tnx1v4", "tnx0.25v1", "tnx0.25v3", "tnx0.25v4", "tnx0.125v4"]: blom_cppdefs = blom_cppdefs + " -DLEVITUS2X" - if turbclo or tracers: + if turbclo != "null" or tracers: blom_cppdefs = blom_cppdefs + " -DTRC" - if turbclo: + if turbclo != "null": twoeq = False oneeq = False for option in turbclo.split(): diff --git a/cime_config/buildlib_2.1 b/cime_config/buildlib_2.1 index b36dc37d..55009bf4 100755 --- a/cime_config/buildlib_2.1 +++ b/cime_config/buildlib_2.1 @@ -53,7 +53,6 @@ def _main_func(): objroot = case.get_value("OBJROOT") comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN") - turbclo = case.get_value("BLOM_TURBULENT_CLOSURE") tracers = case.get_value("BLOM_TRACER_MODULES") driver = case.get_value("COMP_INTERFACE") @@ -65,18 +64,17 @@ def _main_func(): os.path.join(comp_root_dir_ocn, "channel"), os.path.join(comp_root_dir_ocn, "single_column"), os.path.join(comp_root_dir_ocn, "pkgs", "CVMix-src", "src", "shared"), - os.path.join(comp_root_dir_ocn, "pkgs", "M4AGO-sinking-scheme", "src"), - os.path.join(comp_root_dir_ocn, "phy")] - - if turbclo != 0 and tracers != 0: - paths.append(os.path.join(comp_root_dir_ocn, "trc")) + os.path.join(comp_root_dir_ocn, "phy"), + os.path.join(comp_root_dir_ocn, "trc"), + os.path.join(comp_root_dir_ocn, "idlage")] if tracers != 0: for module in tracers.split(): if module == "iage": - paths.append(os.path.join(comp_root_dir_ocn, "idlage")) + continue elif module == "ecosys": paths.append(os.path.join(comp_root_dir_ocn, "hamocc")) + paths.append(os.path.join(comp_root_dir_ocn, "pkgs", "M4AGO-sinking-scheme", "src")) else: expect(False, "tracer module {} is not recognized".format(module)) diff --git a/cime_config/buildlib_2.2 b/cime_config/buildlib_2.2 index 343bab26..358b29e4 100755 --- a/cime_config/buildlib_2.2 +++ b/cime_config/buildlib_2.2 @@ -54,7 +54,6 @@ def _main_func(): objroot = case.get_value("OBJROOT") comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN") - turbclo = case.get_value("BLOM_TURBULENT_CLOSURE") tracers = case.get_value("BLOM_TRACER_MODULES") driver = case.get_value("COMP_INTERFACE") diff --git a/cime_config/buildnml b/cime_config/buildnml index 757a8470..926b042e 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -94,7 +94,7 @@ def buildnml(case, caseroot, compname): blom_vcoord = case.get_value("BLOM_VCOORD") turbclo = case.get_value("BLOM_TURBULENT_CLOSURE") - expect(blom_vcoord != "cntiso_hybrid" or not turbclo, + expect(blom_vcoord != "cntiso_hybrid" or turbclo == "null", f"BLOM_VCOORD == {blom_vcoord} and BLOM_TURBULENT_CLOSURE == {turbclo} is not a valid combination") #-------------------------- diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 3d462ee0..ba58c123 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -18,7 +18,7 @@ iage,iage ecosys iage - iage ecosys + iage ecosys build_component_blom env_build.xml @@ -38,6 +38,9 @@ char oneeq advection + + null + build_component_blom env_build.xml Optional turbulent closure. Valid values one of: twoeq oneeq. Additional values: advection isodif @@ -57,11 +60,11 @@ constant,prognostic,diagnostic constant - constant - prognostic - diagnostic - diagnostic - diagnostic + constant + prognostic + diagnostic + diagnostic + diagnostic run_component_blom env_run.xml @@ -74,11 +77,26 @@ char isopyc_bulkml,cntiso_hybrid isopyc_bulkml + + cntiso_hybrid + build_component_blom env_build.xml Vertical coordinate type of BLOM + + integer + + 53 + + 56 + + build_component_blom + env_build.xml + Vertical dimension of BLOM + + char full,partial @@ -121,19 +139,19 @@ UNSET,1850,2000,hist,ssp119,ssp126,ssp245,ssp370,ssp434,ssp460,ssp534os,ssp585 1850 - hist - hist - 2000 - ssp119 - ssp126 - ssp245 - ssp370 - ssp370 - ssp370 - ssp434 - ssp460 - ssp534os - ssp585 + hist + hist + 2000 + ssp119 + ssp126 + ssp245 + ssp370 + ssp370 + ssp370 + ssp434 + ssp460 + ssp534os + ssp585 run_component_blom env_run.xml @@ -246,8 +264,8 @@ - BLOM default: - BLOM/Ecosystem: + BLOM default: + BLOM/Ecosystem: diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml index 8308161d..b7eaf439 100644 --- a/cime_config/config_pes.xml +++ b/cime_config/config_pes.xml @@ -88,7 +88,7 @@ - + Very small pe-layout on 128 pes in total 4 @@ -164,7 +164,7 @@ - + none 128 @@ -204,7 +204,7 @@ - + Very small pe-layout on 128 pes in total 4 @@ -280,7 +280,7 @@ - + none 128 @@ -437,7 +437,7 @@ - + none 256 @@ -591,7 +591,7 @@ - + none 16 @@ -674,7 +674,7 @@ - + Very small and efficent pe-layout on 128 pes in total 1 @@ -712,7 +712,7 @@ - + Small pe-layout with 219 pes in total 1 @@ -788,7 +788,7 @@ - + Medium sized pe-layout with 384 pes in total 18 @@ -826,7 +826,7 @@ - + Large pe-layout with 512 pes in total 1 diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index e3eddc64..89317250 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -338,7 +338,7 @@ 5.e-5 .75e-4 - .75e-4 + .75e-4 .75e-4 .75e-4 @@ -3997,8 +3997,8 @@ config_bgc .false. - .true. - .true. + .true. + .true. activates HAMOCC CFC code @@ -4010,7 +4010,7 @@ .false. .true. - .true. + .true. activates HAMOCC natural tracer code From 802dbbeaa6234bbc982cceac63d70c31f17f2ebf Mon Sep 17 00:00:00 2001 From: Mats Bentsen Date: Thu, 28 Nov 2024 10:01:07 +0100 Subject: [PATCH 2/3] Made plevel vertical coordinate selectable as compset option. --- cime_config/buildnml | 4 ++-- cime_config/config_component.xml | 5 ++++- cime_config/namelist_definition_blom.xml | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 14c27423..d80713b0 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -95,7 +95,7 @@ def buildnml(case, caseroot, compname): blom_vcoord = case.get_value("BLOM_VCOORD") turbclo = case.get_value("BLOM_TURBULENT_CLOSURE") - expect(blom_vcoord != "cntiso_hybrid" or turbclo == "null", + expect(blom_vcoord == "isopyc_bulkml" or turbclo == "null", f"BLOM_VCOORD == {blom_vcoord} and BLOM_TURBULENT_CLOSURE == {turbclo} is not a valid combination") #-------------------------- @@ -281,7 +281,7 @@ def buildnml(case, caseroot, compname): groups.append('cwmod') - if case.get_value("BLOM_VCOORD") == "cntiso_hybrid": + if case.get_value("BLOM_VCOORD") != "isopyc_bulkml": groups.append('vcoord') groups.append('ale_regrid_remap') diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index a49e3801..2039eebb 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -40,6 +40,7 @@ oneeq advection null + null build_component_blom env_build.xml @@ -75,10 +76,11 @@ char - isopyc_bulkml,cntiso_hybrid + isopyc_bulkml,cntiso_hybrid,plevel isopyc_bulkml cntiso_hybrid + plevel build_component_blom env_build.xml @@ -91,6 +93,7 @@ 53 56 + 56 build_component_blom env_build.xml diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 9cad0847..bb8ee8e9 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -372,6 +372,7 @@ uc dluc + dluc Baroclinic mass flux correction method. Valid methods: @@ -676,6 +677,7 @@ 1. 1. 10. + 10. Maximum mixed layer depth for e-folding SSS relaxation (m) (f) @@ -952,6 +954,8 @@ vcoord 1.08 + 1.08 + 1.105 Minimum layer thickness inflation factor From d621ca0410f584d85ce739675d95e5d9e3f07dec Mon Sep 17 00:00:00 2001 From: Mats Bentsen Date: Thu, 28 Nov 2024 10:02:26 +0100 Subject: [PATCH 3/3] Made hybrid vertical coordinate default in OMIP compsets for NUOPC based NorESM. --- cime_config/config_compsets.xml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 69532ca3..180683b5 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -24,29 +24,29 @@ NOINY_WW3 - 2000_DATM%NYF_SLND_CICE_BLOM_DROF%NYF_SGLC_WW3 + 2000_DATM%NYF_SLND_CICE_BLOM%HYB_DROF%NYF_SGLC_WW3 NOINYOC_WW3 - 2000_DATM%NYF_SLND_CICE_BLOM%ECO_DROF%NYF_SGLC_WW3 + 2000_DATM%NYF_SLND_CICE_BLOM%HYB%ECO_DROF%NYF_SGLC_WW3 NOINY - 2000_DATM%NYF_SLND_CICE_BLOM_DROF%NYF_SGLC_SWAV + 2000_DATM%NYF_SLND_CICE_BLOM%HYB_DROF%NYF_SGLC_SWAV NOINYOC - 1850_DATM%NYF_SLND_CICE_BLOM%ECO_DROF%NYF_SGLC_SWAV + 1850_DATM%NYF_SLND_CICE_BLOM%HYB%ECO_DROF%NYF_SGLC_SWAV NOIIA - 2000_DATM%IAF_SLND_CICE_BLOM_DROF%IAF_SGLC_SWAV + 2000_DATM%IAF_SLND_CICE_BLOM%HYB_DROF%IAF_SGLC_SWAV @@ -56,7 +56,7 @@ NOIIAOC - 2000_DATM%IAF_SLND_CICE_BLOM%ECO_DROF%IAF_SGLC_SWAV + 2000_DATM%IAF_SLND_CICE_BLOM%HYB%ECO_DROF%IAF_SGLC_SWAV @@ -66,7 +66,7 @@ NOIIAOC20TR - 20TR_DATM%IAF_SLND_CICE_BLOM%ECO_DROF%IAF_SGLC_SWAV + 20TR_DATM%IAF_SLND_CICE_BLOM%HYB%ECO_DROF%IAF_SGLC_SWAV @@ -78,7 +78,7 @@ NOIIAJRA - 2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM_DROF%JRA-1p4-2018_SGLC_SWAV + 2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB_DROF%JRA-1p4-2018_SGLC_SWAV @@ -88,7 +88,7 @@ NOIIAJRAOC - 2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM%ECO_DROF%JRA-1p4-2018_SGLC_SWAV + 2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB%ECO_DROF%JRA-1p4-2018_SGLC_SWAV @@ -98,7 +98,7 @@ NOIIAJRAOC1850 - 1850_DATM%JRA-1p4-2018_SLND_CICE_BLOM%ECO_DROF%JRA-1p4-2018_SGLC_SWAV + 1850_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB%ECO_DROF%JRA-1p4-2018_SGLC_SWAV @@ -108,7 +108,7 @@ NOIIAJRAOC20TR - 20TR_DATM%JRA-1p4-2018_SLND_CICE_BLOM%ECO_DROF%JRA-1p4-2018_SGLC_SWAV + 20TR_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB%ECO_DROF%JRA-1p4-2018_SGLC_SWAV @@ -121,7 +121,7 @@ NOINYJRARYF1961OC - 1850_DATM%JRARYF1961_SLND_CICE_BLOM%ECO_DROF%JRARYF1961_SGLC_SWAV + 1850_DATM%JRARYF1961_SLND_CICE_BLOM%HYB%ECO_DROF%JRARYF1961_SGLC_SWAV @@ -134,7 +134,7 @@ NOICPLHISTOC - 1850_DATM%CPLHIST_SLND_CICE_BLOM%ECO_DROF%CPLHIST_SGLC_SWAV + 1850_DATM%CPLHIST_SLND_CICE_BLOM%HYB%ECO_DROF%CPLHIST_SGLC_SWAV @@ -142,8 +142,8 @@ 1700-01-01 1653-01-01 - 1700-01-01 - 1653-01-01 + 1700-01-01 + 1653-01-01