From 79a598d6a51db653b8f491245ca62577195f8d32 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sat, 14 Sep 2024 20:44:45 +0200 Subject: [PATCH 1/4] updated dms exchange --- cime_config/buildnml | 13 ++++++++++--- cime_config/namelist_definition_drv.xml | 7 ++++--- mediator/esmFldsExchange_cesm_mod.F90 | 8 ++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 13d04514..cdc76f1f 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -53,6 +53,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config["rest_option"] = case.get_value("REST_OPTION") config["comp_ocn"] = case.get_value("COMP_OCN") + atm_grid = case.get_value("ATM_GRID") lnd_grid = case.get_value("LND_GRID") ice_grid = case.get_value("ICE_GRID") @@ -107,7 +108,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config["COMP_ROF"] = case.get_value("COMP_ROF") config["COMP_WAV"] = case.get_value("COMP_WAV") config["CAMDEV"] = "True" if "CAM70" in case.get_value("COMPSET") else "False" - + if ( ( case.get_value("COMP_ROF") == "mosart" @@ -129,6 +130,12 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config['wav_ice_coupling'] = 'ww3' in config['COMP_WAV'] and config['COMP_ICE'] == 'cice' + if config["COMP_OCN"] == "blom": + if "ecosys" in case.get_value("BLOM_TRACER_MODULES"): + config["dms_from_ocn"] = "on" + else: + config["dms_from_ocn"] = "off" + # ---------------------------------------------------- # Initialize namelist defaults # ---------------------------------------------------- @@ -150,7 +157,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): add_gusts = literal_to_python_value(nmlgen.get_value("add_gusts"), type_="logical") if add_gusts: expect("CAM70" in case.get_value("COMPSET"),"ERROR: add_gusts can only be set if CAM70 in compset {}".format(case.get_value("COMPSET"))) - + # -------------------------------- # Overwrite: set component coupling frequencies # -------------------------------- @@ -665,7 +672,7 @@ def buildnml(case, caseroot, component): create_namelist_infile(case, user_nl_file, namelist_infile, infile_text) infile = [namelist_infile] - + # create the files nuopc.runconfig, nuopc.runseq, drv_in and drv_flds_in _create_drv_namelists(case, infile, confdir, nmlgen, files) diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index c24170de..0f55d37a 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -887,7 +887,7 @@ .false. - + integer @@ -2420,7 +2420,7 @@ - + logical flds ALLCOMP_attributes @@ -2429,10 +2429,11 @@ .false. + .true. - + logical flds ALLCOMP_attributes diff --git a/mediator/esmFldsExchange_cesm_mod.F90 b/mediator/esmFldsExchange_cesm_mod.F90 index 71219057..04279aed 100644 --- a/mediator/esmFldsExchange_cesm_mod.F90 +++ b/mediator/esmFldsExchange_cesm_mod.F90 @@ -1700,7 +1700,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fdms_ocn', rc=rc) .and. & fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fdms_ocn', rc=rc)) then - call addmap_from(compocn, 'Faoo_fdms_ocn', compocn, mapconsd, 'one', ocn2atm_map) + call addmap_from(compocn, 'Faoo_fdms_ocn', compatm, mapconsd, 'one', ocn2atm_map) ! custom merge in med_phases_prep_atm end if end if @@ -1714,7 +1714,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fbrf_ocn', rc=rc) .and. & fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fbrf_ocn', rc=rc)) then - call addmap_from(compocn, 'Faoo_fbrf_ocn', compocn, mapconsd, 'one', ocn2atm_map) + call addmap_from(compocn, 'Faoo_fbrf_ocn', compatm, mapconsd, 'one', ocn2atm_map) ! custom merge in med_phases_prep_atm end if end if @@ -1728,7 +1728,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fn2o_ocn', rc=rc) .and. & fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fn2o_ocn', rc=rc)) then - call addmap_from(compocn, 'Faoo_fn2o_ocn', compocn, mapconsd, 'one', ocn2atm_map) + call addmap_from(compocn, 'Faoo_fn2o_ocn', compatm, mapconsd, 'one', ocn2atm_map) ! custom merge in med_phases_prep_atm end if end if @@ -1742,7 +1742,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_fnh3_ocn', rc=rc) .and. & fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_fnh3_ocn', rc=rc)) then - call addmap_from(compocn, 'Faoo_fnh3_ocn', compocn, mapconsd, 'one', ocn2atm_map) + call addmap_from(compocn, 'Faoo_fnh3_ocn', compatm, mapconsd, 'one', ocn2atm_map) ! custom merge in med_phases_prep_atm end if end if From 5021dd819310521fd0d25181105376e56bda9b1e Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 27 Sep 2024 13:49:42 +0200 Subject: [PATCH 2/4] updated code to work on betzy --- cime_config/buildnml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 371cdf8b..473cc024 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -52,7 +52,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config["mask_grid"] = case.get_value("MASK_GRID") for val in ("HIST", "REST", "STOP"): config[val.lower()+"_option"] = case.get_value(val+"_OPTION") - + config["comp_ocn"] = case.get_value("COMP_OCN") @@ -210,7 +210,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): mindt = min(mindt, cpl_dt) # Here we convert "nsteps" to "nseconds", this simplifies the fortran - + for val in ("REST", "HIST", "STOP"): if case.get_value(val+"_OPTION") == "nsteps": nsteps = case.get_value(val+"_N") @@ -221,7 +221,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): else: nmlgen.set_value("stop_n", value=mindt*nsteps) - + # sanity check comp_atm = case.get_value("COMP_ATM") if comp_atm is not None and comp_atm not in ("datm", "xatm", "satm"): @@ -644,7 +644,7 @@ def buildnml(case, caseroot, component): major = line[-2] if "MAJOR" in line else major minor = line[-2] if "MINOR" in line else minor logger.debug("ESMF version major {} minor {}".format(major, minor)) - expect(int(major) >= 8 and int(minor) >=6, "ESMF version should be 8.6.1 or newer") + expect(int(major) >= 8 and int(minor) >=4, "ESMF version should be 8.4.1 or newer") confdir = os.path.join(case.get_value("CASEBUILD"), "cplconf") if not os.path.isdir(confdir): From c0ec79e643c521f89aaf0695899bc59b167d00a7 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 30 Sep 2024 11:41:25 -0600 Subject: [PATCH 3/4] update github workflow --- .github/workflows/srt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/srt.yml b/.github/workflows/srt.yml index 5a45a82a..c687e864 100644 --- a/.github/workflows/srt.yml +++ b/.github/workflows/srt.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.10.9 ] + python-version: [ 3.7, 3.x ] env: CC: mpicc FC: mpifort From 7c75a568f95ffb71f394512b58d669fb84e8a8f8 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 30 Sep 2024 11:43:37 -0600 Subject: [PATCH 4/4] update github workflow --- .github/workflows/srt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/srt.yml b/.github/workflows/srt.yml index c687e864..a94205d7 100644 --- a/.github/workflows/srt.yml +++ b/.github/workflows/srt.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.x ] + python-version: [ 3.x ] env: CC: mpicc FC: mpifort