From 959b70458f8c1764654c6f2ac0b1ddf98cc52fb4 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 14 Jul 2023 14:43:22 +0200 Subject: [PATCH 01/33] first steps in refactoring buildnml --- cime_config/buildnml | 0 cime_config/buildnml.py | 182 ++++++ cime_config/namelist_definition_blom.xml | 691 +++++++++++++++++++++++ 3 files changed, 873 insertions(+) mode change 100755 => 100644 cime_config/buildnml create mode 100644 cime_config/buildnml.py create mode 100644 cime_config/namelist_definition_blom.xml diff --git a/cime_config/buildnml b/cime_config/buildnml old mode 100755 new mode 100644 diff --git a/cime_config/buildnml.py b/cime_config/buildnml.py new file mode 100644 index 00000000..27924f2e --- /dev/null +++ b/cime_config/buildnml.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python3 + +"""BLOM namelist creator +""" + +# Typically ignore this. +# pylint: disable=invalid-name + +# Disable these because this is our standard setup +# pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-position + +import os, shutil, sys, glob, filecmp, imp, re + +CIMEROOT = os.environ.get("CIMEROOT") +if CIMEROOT is None: + raise SystemExit("ERROR: must set CIMEROOT environment variable") +sys.path.append(os.path.join(CIMEROOT, "CIME", "Tools")) + +from standard_script_setup import * +from CIME.case import Case +from CIME.nmlgen import NamelistGenerator +from CIME.utils import expect +from CIME.utils import run_cmd_no_fail, expect +from CIME.utils import run_cmd +from CIME.buildnml import create_namelist_infile, parse_input + +import glob, shutil +logger = logging.getLogger(__name__) + +# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements +#################################################################################### +def _create_namelists(case, confdir, infile, nmlgen): +#################################################################################### + + """Write out the namelist for this component. + + Most arguments are the same as those for `NamelistGenerator`. + The `confdir` argument is used to specify the directory in which output files will be placed. + """ + + CASEROOT = case.get_value("CASEROOT") + OCN_GRID = case.get_value("OCN_GRID") + BLOM_VCOORD = case.get_value("BLOM_VCOORD") + BLOM_UNIT = case.get_value("BLOM_UNIT") + DIN_LOC_ROOT = case.get_value("DIN_LOC_ROOT") + RUN_TYPE = case.get_value("RUN_TYPE") + CONTINUE_RUN = case.get_value("CONTINUE_RUN") + CASEBUILD = case.get_value("CASEBUILD") + CCSM_CO2_PPMV = case.get_value("CCSM_CO2_PPMV") + OCN_NCPL = case.get_value("OCN_NCPL") + BLOM_COUPLING = case.get_value("BLOM_COUPLING") + RUNDIR = case.get_value("RUNDIR") + BLOM_TRACER_MODULES = case.get_value("BLOM_TRACER_MODULES") + BLOM_RIVER_NUTRIENTS = case.get_value("BLOM_RIVER_NUTRIENTS") + BLOM_N_DEPOSITION = case.get_value("BLOM_N_DEPOSITION") + BLOM_NDEP_SCENARIO = case.get_value("BLOM_NDEP_SCENARIO") + HAMOCC_VSLS = case.get_value("HAMOCC_VSLS") + HAMOCC_CISO = case.get_value("HAMOCC_CISO") + HAMOCC_SEDSPINUP = case.get_value("HAMOCC_SEDSPINUP") + HAMOCC_SEDSPINUP_YR_START = case.get_value("HAMOCC_SEDSPINUP_YR_START") + HAMOCC_SEDSPINUP_YR_END = case.get_value("HAMOCC_SEDSPINUP_YR_END") + HAMOCC_SEDSPINUP_NCYCLE = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") + RUN_STARTDATE = case.get_value("RUN_STARTDATE") + PIO_TYPENAME_OCN = case.get_value("PIO_TYPENAME_OCN") + PIO_NETCDF_FORMAT_OCN = case.get_value("PIO_NETCDF_FORMAT_OCN") + NINST_OCN = case.get_value("NINST_OCN") + TEST = case.get_value("TEST") + + config['ocn_comp'] = case.get_value("COMP_OCN") + + YEAR0 = `echo $RUN_STARTDATE | cut -c1-4 ` + MONTH0 = `echo $RUN_STARTDATE | cut -c6-7 ` + DAY0 = `echo $RUN_STARTDATE | cut -c9-10` + + #---------------------------------------------------- + # Initialize namelist defaults + #---------------------------------------------------- + nmlgen.init_defaults(infile, config) + + #---------------------------------------------------- + # Write out namelist groups + #---------------------------------------------------- + groups=['limit'] + + namelist_file = os.path.join(confdir, "ocn_in") + nmlgen.write_output_file(namelist_file, data_list_path, groups=groups, sorted_groups=False) + + #logger.debug("blom: grid is %s" %(hgrid)) + #logger.debug("blom: physics is %s "%phys) + +############################################################################### +def buildnml(case, caseroot, compname): +############################################################################### + """Build the blom namelist """ + + # Build the component namelist + if compname != "blom": + raise AttributeError + comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN") + srcroot = case.get_value("SRCROOT") + rundir = case.get_value("RUNDIR") + ninst = case.get_value("NINST_OCN") + + #---------------------------------------------------- + # Construct the namelist generator + #---------------------------------------------------- + # determine directory for user modified namelist_definitions.xml and namelist_defaults.xml + user_xml_dir = os.path.join(caseroot, "SourceMods", "src.blom") + expect (os.path.isdir(user_xml_dir), + "user_xml_dir %s does not exist " %user_xml_dir) + + # user definition *replaces* existing definition. + namelist_xml_dir = os.path.join(comp_root_dir_ocn, "cime_config") + definition_file = [os.path.join(namelist_xml_dir, "namelist_definition_blom.xml")] + user_definition = os.path.join(user_xml_dir, "namelist_definition_blom.xml") + if os.path.isfile(user_definition): + definition_file = [user_definition] + for file_ in definition_file: + expect(os.path.isfile(file_), "Namelist XML file %s not found!" % file_) + + # Create the namelist generator object - independent of instance + nmlgen = NamelistGenerator(case, definition_file) + + #---------------------------------------------------- + # Loop over instances + #---------------------------------------------------- + for inst_counter in range(1, ninst+1): + + # determine instance string + inst_string = "" + if ninst > 1: + inst_string = '_' + '%04d' % inst_counter + + # If multi-instance case does not have restart file, use + # single-case restart for each instance + rpointer = "rpointer.ice" + if (os.path.isfile(os.path.join(rundir,rpointer)) and + (not os.path.isfile(os.path.join(rundir,rpointer + inst_string)))): + shutil.copy(os.path.join(rundir, rpointer), + os.path.join(rundir, rpointer + inst_string)) + + inst_string_label = inst_string + if not inst_string_label: + inst_string_label = "\"\"" + + # create namelist_infile using user_nl_file as input + user_nl_file = os.path.join(caseroot, "user_nl_blom" + inst_string) + expect(os.path.isfile(user_nl_file), + "Missing required user_nl_file %s " %(user_nl_file)) + infile = os.path.join(confdir, "namelist_infile") + create_namelist_infile(case, user_nl_file, infile) + namelist_infile = [infile] + + # create namelist + _create_namelists(case, confdir, namelist_infile, nmlgen) + + # copy namelist files to rundir + if os.path.isdir(rundir): + file1 = os.path.join(confdir, "ice_in") + file2 = os.path.join(rundir, "ice_in") + if inst_string: + file2 += inst_string + logger.debug("BLOM namelist copy: file1 %s file2 %s " %(file1, file2)) + shutil.copy2(file1, file2) + +def _strip_comments(fh, token="!"): + ''' strip anything after token in each line of fh ''' + for line in fh: + s = line.split(token, 1)[0].strip() + if s: + yield s + + +############################################################################### +def _main_func(): + + caseroot = parse_input(sys.argv) + with Case(caseroot, read_only=False) as case: + buildnml(case, caseroot, "blom") + +if __name__ == "__main__": + _main_func() diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml new file mode 100644 index 00000000..e237bb9d --- /dev/null +++ b/cime_config/namelist_definition_blom.xml @@ -0,0 +1,691 @@ + + + + + + + + + + integer + limits + limits + + 0 + + + + + + integer + limits + limits + + 0 + + + + + + integer + limits + limits + + 9999999 + + + + + + integer + limits + limits + + 9999999 + + + + + + limits + limits + + unset + + + char + + + + char + limits + limits + + cesm + + + + + + char + limits + limits + + initial + + + + + + char + limits + limits + + unset + + + + + + char + limits + limits + + unset + + + + + + real + limits + limits + + 2000.e4 + 2000.e5 + + + + + + real + limits + limits + + 1800. + + + + + + real + limits + limits + + 36. + + + + + + real + limits + limits + + .02 + 2. + + + + + + real + limits + limits + + .004 + .4 + + + + + + real + limits + limits + + 0. + 0. + + + + + + real + limits + limits + + 0. + 0. + + + + + + real + limits + limits + + 5000. + 5000.e4 + + + + + + real + limits + limits + + 300. + 300.e4 + + + + + + real + limits + limits + + .5 + + + + + + real + limits + limits + + .5 + + + + + + real + limits + limits + + 0. + + + + + + real + limits + limits + + 0. + + + + + + real + limits + limits + + .05 + 5. + + + + + + real + limits + limits + + .002 + + + + + + real + limits + limits + + 5.e-5 + + + + + + real + limits + limits + + 25. + + + + + + char + limits + limits + + enscon + + + + + + char + limits + limits + + uc + + + + + + char + limits + limits + + eitvel + + + + + + char + limits + limits + + constant + + + + + + real + limits + limits + + 1.2 + + + + + + real + limits + limits + + 0. + + + + + + real + limits + limits + + .06 + + + + + + char + limits + limits + + unset + + + + + + real + limits + limits + + 0. + + + + + + real + limits + limits + + .35 + + + + + + real + limits + limits + + .5 + + + + + + char + limits + limits + + jerlov + + + + + + integer + limits + limits + + 3 + + + + + + char + limits + limits + + climatology + + + + + + char + limits + limits + + unset + + + + + + real + limits + limits + + 0. + + + + + + real + limits + limits + + 0. + + + + + + real + limits + limits + + 1. + + + + + + real + limits + limits + + 1. + + + + + + real + limits + limits + + 1.5 + + + + + + real + limits + limits + + .5 + + + + + + logical + limits + limits + + .false. + + + + + + logical + limits + limits + + .false. + + + + + + logical + limits + limits + + .false. + + + + + + logical + limits + limits + + .false. + + + + + + logical + limits + limits + + .false. + + + + + + char + limits + limits + + unset + + + + + + char + limits + limits + + none + + + + + + logical + limits + limits + + .true. + + + + + + logical + limits + limits + + .false. + + + + + + char + limits + limits + + unset + + + + + + integer + limits + limits + + 60 + + + + + + integer + limits + limits + + 60 + + + + + + logical + limits + limits + + .false. + + + + + + logical + limits + limits + + .false. + + + + + + integer + limits + limits + + 1 + + + + + + integer + limits + limits + + 0 + 1 + + + + + + integer + limits + limits + + 0 + + + + + + integer + limits + limits + + 0 + 1 + + + + + From 43322209ccac9f1e2227c76db1259c48963179fd Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 14 Jul 2023 16:17:00 +0200 Subject: [PATCH 02/33] rename files --- cime_config/buildnml | 1946 ++++++-------------------------------- cime_config/buildnml.csh | 1636 ++++++++++++++++++++++++++++++++ cime_config/buildnml.py | 182 ---- 3 files changed, 1908 insertions(+), 1856 deletions(-) mode change 100644 => 100755 cime_config/buildnml create mode 100644 cime_config/buildnml.csh delete mode 100644 cime_config/buildnml.py diff --git a/cime_config/buildnml b/cime_config/buildnml old mode 100644 new mode 100755 index caf1f533..d725d2b3 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -1,1674 +1,272 @@ -#! /bin/csh -f - -#------------------------------------------------------------------------------ -# Get variables from Case XML-files -#------------------------------------------------------------------------------ - -set CASEROOT = `./xmlquery CASEROOT --value` -set OCN_GRID = `./xmlquery OCN_GRID --value` -set BLOM_VCOORD = `./xmlquery BLOM_VCOORD --value` -set BLOM_UNIT = `./xmlquery BLOM_UNIT --value` -set DIN_LOC_ROOT = `./xmlquery DIN_LOC_ROOT --value` -set RUN_TYPE = `./xmlquery RUN_TYPE --value` -set CONTINUE_RUN = `./xmlquery CONTINUE_RUN --value` -set CASEBUILD = `./xmlquery CASEBUILD --value` -set CCSM_CO2_PPMV = `./xmlquery CCSM_CO2_PPMV --value` -set OCN_NCPL = `./xmlquery OCN_NCPL --value` -set BLOM_COUPLING = `./xmlquery BLOM_COUPLING --value` -set RUNDIR = `./xmlquery RUNDIR --value` -set BLOM_TRACER_MODULES = `./xmlquery BLOM_TRACER_MODULES --value` -set BLOM_RIVER_NUTRIENTS = `./xmlquery BLOM_RIVER_NUTRIENTS --value` -set BLOM_N_DEPOSITION = `./xmlquery BLOM_N_DEPOSITION --value` -set BLOM_NDEP_SCENARIO = `./xmlquery BLOM_NDEP_SCENARIO --value` -set HAMOCC_VSLS = `./xmlquery HAMOCC_VSLS --value` -set HAMOCC_CISO = `./xmlquery HAMOCC_CISO --value` -set HAMOCC_SEDSPINUP = `./xmlquery HAMOCC_SEDSPINUP --value` -set HAMOCC_SEDSPINUP_YR_START = `./xmlquery HAMOCC_SEDSPINUP_YR_START --value` -set HAMOCC_SEDSPINUP_YR_END = `./xmlquery HAMOCC_SEDSPINUP_YR_END --value` -set HAMOCC_SEDSPINUP_NCYCLE = `./xmlquery HAMOCC_SEDSPINUP_NCYCLE --value` -set RUN_STARTDATE = `./xmlquery RUN_STARTDATE --value` -set PIO_TYPENAME_OCN = `./xmlquery PIO_TYPENAME_OCN --value` -set PIO_NETCDF_FORMAT_OCN = `./xmlquery PIO_NETCDF_FORMAT_OCN --value` -set NINST_OCN = `./xmlquery NINST_OCN --value` -set TEST=`./xmlquery TEST --value` - -#------------------------------------------------------------------------------ -# Check if HAMOCC is requested -#------------------------------------------------------------------------------ - -set ecosys = FALSE -set tracers = (`echo $BLOM_TRACER_MODULES`) -if ($#tracers != 0) then - foreach module ($tracers) - if ($module == ecosys) then - set ecosys = TRUE - endif - end -endif - -#------------------------------------------------------------------------------ -# Set RUN_TYPE to 'continue' if CONTINUE_RUN equals TRUE -#------------------------------------------------------------------------------ - -if ("$CONTINUE_RUN" == TRUE) then - set RUN_TYPE = continue -endif - -#------------------------------------------------------------------------------ -# Get start date -#------------------------------------------------------------------------------ - -set YEAR0 = `echo $RUN_STARTDATE | cut -c1-4 ` -set MONTH0 = `echo $RUN_STARTDATE | cut -c6-7 ` -set DAY0 = `echo $RUN_STARTDATE | cut -c9-10` - -#------------------------------------------------------------------------------ -# Set namelist variables -#------------------------------------------------------------------------------ - -#------------------------------ -# set LIMITS defaults -#------------------------------ -set NDAY1 = 0 -set NDAY2 = 0 -set IDATE = $YEAR0$MONTH0$DAY0 -set IDATE0 = $YEAR0$MONTH0$DAY0 -set RUNID = "'unset'" -set EXPCNF = "'cesm'" -set RUNTYP = "'$RUN_TYPE'" -set GRFILE = "'unset'" -set ICFILE = "'unset'" -if ("$BLOM_UNIT" == cgs) then - set PREF = 2000.e5 -else - set PREF = 2000.e4 -endif -set BACLIN = 1800. -set BATROP = 36. -if ("$BLOM_UNIT" == cgs) then - set MDV2HI = 2. - set MDV2LO = .4 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 5000.e4 - set MDC2LO = 300.e4 -else - set MDV2HI = .02 - set MDV2LO = .004 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 5000. - set MDC2LO = 300. -endif -set VSC2HI = .5 -set VSC2LO = .5 -set VSC4HI = 0. -set VSC4LO = 0. -if ("$BLOM_UNIT" == cgs) then - set CBAR = 5. -else - set CBAR = .05 -endif -set CB = .002 -set CWBDTS = 5.e-5 -set CWBDLS = 25. -set MOMMTH = "'enscon'" -set BMCMTH = "'uc'" -set RMPMTH = "'eitvel'" -set MLRTTP = "'constant'" -set RM0 = 1.2 -set RM5 = 0. -set CE = .06 -set TDFILE = "'unset'" -set NIWGF = 0. -set NIWBF = .35 -set NIWLF = .5 -set SWAMTH = "'jerlov'" -set JWTYPE = 3 -set CHLOPT = "'climatology'" -set CCFILE = "'unset'" -set TRXDAY = 0. -set SRXDAY = 0. -set TRXDPT = 1. -set SRXDPT = 1. -set TRXLIM = 1.5 -set SRXLIM = .5 -set APTFLX = .false. -set APSFLX = .false. -set DITFLX = .false. -set DISFLX = .false. -set SRXBAL = .false. -set SCFILE = "'unset'" -set WAVSRC = "'none'" -set SMTFRC = .true. -set SPRFAC = .false. -set ATM_PATH = "'unset'" -set ITEST = 60 -set JTEST = 60 -set CNSVDI = .false. -set CSDIAG = .false. -set RSTFRQ = 1 -if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then - set RSTFMT = 1 -else - set RSTFMT = 0 -endif -set RSTCMP = 0 -if ("$PIO_TYPENAME_OCN" == pnetcdf) then - set IOTYPE = 1 -else - set IOTYPE = 0 -endif - -#------------------------------ -# set VCOORD defaults -#------------------------------ -set VCOORD_TYPE = "'$BLOM_VCOORD'" -set RECONSTRUCTION_METHOD = "'ppm'" -set DENSITY_LIMITING = "'monotonic'" -set TRACER_LIMITING = "'non_oscillatory'" -set VELOCITY_LIMITING = "'non_oscillatory'" -set DENSITY_PC_UPPER_BNDR = .false. -set DENSITY_PC_LOWER_BNDR = .false. -set TRACER_PC_UPPER_BNDR = .true. -set TRACER_PC_LOWER_BNDR = .false. -set VELOCITY_PC_UPPER_BNDR = .true. -set VELOCITY_PC_LOWER_BNDR = .false. -set DPMIN_SURFACE = 2.5 -set DPMIN_INFLATION_FACTOR = 1.08 -set DPMIN_INTERIOR = .1 -set DKTZU = 4 -set DKTZL = 1 - -#------------------------------ -# set DIFFUSION defaults -#------------------------------ -set EITMTH = "'gm'" -set EDRITP = "'large scale'" -set EDWMTH = "'smooth'" -set EDDF2D = .false. -set EDSPRS = .true. -set EGC = 0.85 -set EGGAM = 200. -if ("$BLOM_UNIT" == cgs) then - set EGLSMN = 4000.e2 - set EGMNDF = 100.e4 - set EGMXDF = 1500.e4 -else - set EGLSMN = 4000. - set EGMNDF = 100. - set EGMXDF = 1500. -endif -set EGIDFQ = 1. -set TBFILE = "'unset'" -set RHISCF = 0. -set EDANIS = .false. -set REDI3D = .false. -set RHSCTP = .false. -set RI0 = 1.2 -set BDMTYP = 2 -if ("$BLOM_UNIT" == cgs) then - set BDMC1 = 5.e-4 - set BDMC2 = .1 -else - set BDMC1 = 5.e-8 - set BDMC2 = 1.e-5 -endif -set TKEPF = .006 -set SMOBLD = .true. -set LNGMTP = "'none'" -if ("$BLOM_VCOORD" == isopyc_bulkml) then - set BDMLDP = .true. - set LTEDTP = "'layer'" -else - set BDMLDP = .false. - set LTEDTP = "'neutral'" -endif - -#------------------------------ -# set BGCNML defaults -#------------------------------ -set ATM_CO2 = "$CCSM_CO2_PPMV" -if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set DO_RIVINPT = .true. -else - set DO_RIVINPT = .false. -endif -if ("$BLOM_N_DEPOSITION" == TRUE) then - set DO_NDEP = .true. - if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx2v1) then - set NDEPFNAME = ndep_1850_CMIP6_tnx2v1_20180321.nc - else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_1850_CMIP6_tnx1v4_20171106.nc - else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx0.25v4) then - set NDEPFNAME = ndep_1850_CMIP6_tnx0.25v4_20190912.nc - else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx0.125v4) then - set NDEPFNAME = ndep_1850_CMIP6_tnx0.125v4_20221013.nc - else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx2v1) then - set NDEPFNAME = ndep_2000_CMIP6_tnx2v1_20200826.nc - else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_2000_CMIP6_tnx1v4_20200826.nc - else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx0.25v4) then - set NDEPFNAME = ndep_2000_CMIP6_tnx0.25v4_20200826.nc - else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx2v1) then - set NDEPFNAME = ndep_185001-201412_tnx2v1_20190702.nc - else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_185001-201412_tnx1v4_20180613.nc - else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx0.25v4) then - set NDEPFNAME = ndep_185001-201412_tnx0.25v4_20190705.nc - else if( `echo $BLOM_NDEP_SCENARIO | cut -c1-3` == ssp && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc - else if( "$BLOM_NDEP_SCENARIO" == UNSET ) then - set DO_NDEP = .false. - set NDEPFNAME = "''" - endif -else - set DO_NDEP = .false. - set NDEPFNAME = "''" -endif -if ("$HAMOCC_SEDSPINUP" == TRUE) then - set DO_SEDSPINUP = .true. - set SEDSPIN_YR_S = $HAMOCC_SEDSPINUP_YR_START - set SEDSPIN_YR_E = $HAMOCC_SEDSPINUP_YR_END - set SEDSPIN_NCYC = $HAMOCC_SEDSPINUP_NCYCLE -else - set DO_SEDSPINUP = .false. - set SEDSPIN_YR_S = -1 - set SEDSPIN_YR_E = -1 - set SEDSPIN_NCYC = -1 -endif -# VSLS is currently only available for the tnx1v4 grid, since a climatlogy file for -# short wave radiation is needed. -if ("$HAMOCC_VSLS" == TRUE && "$OCN_GRID" != tnx1v4) then - echo "$0 ERROR: HAMOCC_VSLS == TRUE not possible with this grid resolution (no swa-climatology available) " - exit -1 -endif -# For the following options, there are currently no switches in Case-XML files. -# These options can be activated by expert users via user namelist. -set DO_OALK = .false. -set BGCOAFX_OALKSCEN = "''" -set BGCOAFX_OALKFILE = "''" -set BGCOAFX_ADDALK = 0.135 -set BGCOAFX_CDRMIP_LATMAX = 70.0 -set BGCOAFX_CDRMIP_LATMIN = -60.0 -set BGCOAFX_RAMP_START = 2025 -set BGCOAFX_RAMP_END = 2035 -set WITH_DMSPH = .false. -set PI_PH_FILE = "''" -set L_3DVARSEDPOR = .false. -set SEDPORFILE = "''" - - -#------------------------------ -# set DIAPHY defaults -#------------------------------ -set GLB_FNAMETAG = "'hd','hm','hy'" -set GLB_AVEPERIO = '1, 30, 365' -if ("$TEST" == TRUE) then - set GLB_FILEFREQ = '1, 30, 365' -else - set GLB_FILEFREQ = '30, 30, 365' -endif -set GLB_COMPFLAG = '0, 0, 0' -if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then - set GLB_NCFORMAT = '1, 1, 1' -else - set GLB_NCFORMAT = '0, 0, 0' -endif -set H2D_ABSWND = '0, 4, 0' - -set H2D_ALB = '0, 0, 0' - -set H2D_BTMSTR = '0, 4, 0' -set H2D_BRNFLX = '0, 4, 0' -set H2D_BRNPD = '0, 4, 0' - -set H2D_DFL = '0, 0, 0' - -set H2D_EVA = '0, 4, 0' -set H2D_FICE = '0, 4, 0' -set H2D_FMLTFZ = '0, 4, 0' - -set H2D_HICE = '0, 0, 0' - -set H2D_HMLTFZ = '0, 4, 0' - -set H2D_HSNW = '0, 0, 0' -set H2D_IAGE = '0, 0, 0' - -set H2D_IDKEDT = '0, 4, 0' -set H2D_LAMULT = '0, 4, 0' -set H2D_LASL = '0, 4, 0' -set H2D_LIP = '0, 4, 0' - -set H2D_MAXMLD = '4, 4, 0' - -set H2D_MLD = '0, 4, 0' - -set H2D_MLTS = '4, 4, 0' - -set H2D_MLTSMN = '0, 4, 0' -set H2D_MLTSMX = '0, 4, 0' -set H2D_MLTSSQ = '0, 4, 0' -set H2D_MTKEUS = '0, 4, 0' -set H2D_MTKENI = '0, 4, 0' -set H2D_MTKEBF = '0, 4, 0' -set H2D_MTKERS = '0, 4, 0' -set H2D_MTKEPE = '0, 4, 0' -set H2D_MTKEKE = '0, 4, 0' -set H2D_MTY = '0, 4, 0' -set H2D_NSF = '0, 4, 0' -set H2D_PBOT = '0, 4, 0' -set H2D_PSRF = '0, 4, 0' -set H2D_RFIFLX = '0, 4, 0' -set H2D_RNFFLX = '0, 4, 0' -set H2D_SALFLX = '0, 4, 0' -set H2D_SALRLX = '0, 4, 0' -set H2D_SBOT = '0, 4, 0' - -set H2D_SEALV = '4, 4, 0' - -set H2D_SLVSQ = '0, 4, 0' -set H2D_SFL = '0, 4, 0' -set H2D_SOP = '0, 4, 0' -set H2D_SIGMX = '0, 4, 0' - -set H2D_SSS = '4, 4, 0' -set H2D_SSSSQ = '4, 4, 0' -set H2D_SST = '4, 4, 0' -set H2D_SSTSQ = '4, 4, 0' - -set H2D_SURFLX = '0, 4, 0' -set H2D_SURRLX = '0, 4, 0' -set H2D_SWA = '0, 4, 0' - -set H2D_T20D = '4, 4, 0' - -set H2D_TAUX = '0, 4, 0' -set H2D_TAUY = '0, 4, 0' -set H2D_TBOT = '0, 4, 0' - -set H2D_TICE = '0, 0, 0' -set H2D_TSRF = '0, 0, 0' - -set H2D_UB = '0, 4, 0' - -set H2D_UICE = '0, 0, 0' - -set H2D_USTAR = '0, 4, 0' -set H2D_USTAR3 = '0, 4, 0' - -set H2D_USTOKES = '0, 0, 0' - -set H2D_VB = '0, 4, 0' - -set H2D_VICE = '0, 0, 0' -set H2D_VSTOKES = '0, 0, 0' - -set H2D_ZTX = '0, 4, 0' -set LYR_BFSQ = '0, 4, 0' -set LYR_DIFDIA = '0, 4, 0' -set LYR_DIFVMO = '0, 4, 0' -set LYR_DIFVHO = '0, 4, 0' -set LYR_DIFVSO = '0, 4, 0' -set LYR_DIFINT = '0, 4, 0' -set LYR_DIFISO = '0, 4, 0' -set LYR_DP = '0, 4, 0' -set LYR_DZ = '0, 4, 0' -set LYR_SALN = '0, 4, 0' -set LYR_TEMP = '0, 4, 0' - -set LYR_TRC = '0, 0, 0' - -set LYR_UFLX = '0, 4, 0' -set LYR_UTFLX = '0, 4, 0' -set LYR_USFLX = '0, 4, 0' - -set LYR_UMFLTD = '0, 0, 4' -set LYR_UMFLSM = '0, 0, 4' -set LYR_UTFLTD = '0, 0, 4' -set LYR_UTFLSM = '0, 0, 4' -set LYR_UTFLLD = '0, 0, 4' -set LYR_USFLTD = '0, 0, 4' -set LYR_USFLSM = '0, 0, 4' -set LYR_USFLLD = '0, 0, 4' - -set LYR_UVEL = '0, 4, 0' -set LYR_VFLX = '0, 4, 0' -set LYR_VTFLX = '0, 4, 0' -set LYR_VSFLX = '0, 4, 0' - -set LYR_VMFLTD = '0, 0, 4' -set LYR_VMFLSM = '0, 0, 4' -set LYR_VTFLTD = '0, 0, 4' -set LYR_VTFLSM = '0, 0, 4' -set LYR_VTFLLD = '0, 0, 4' -set LYR_VSFLTD = '0, 0, 4' -set LYR_VSFLSM = '0, 0, 4' -set LYR_VSFLLD = '0, 0, 4' - -set LYR_VVEL = '0, 4, 0' -set LYR_WFLX = '0, 4, 0' -set LYR_WFLX2 = '0, 4, 0' -set LYR_PV = '0, 4, 0' -set LYR_TKE = '0, 4, 0' -set LYR_GLS_PSI = '0, 4, 0' -set LYR_IDLAGE = '0, 4, 0' -set LVL_BFSQ = '0, 4, 0' -set LVL_DIFDIA = '0, 4, 0' -set LVL_DIFVMO = '0, 4, 0' -set LVL_DIFVHO = '0, 4, 0' -set LVL_DIFVSO = '0, 4, 0' -set LVL_DIFINT = '0, 4, 0' -set LVL_DIFISO = '0, 4, 0' -set LVL_DZ = '0, 4, 0' -set LVL_SALN = '0, 4, 0' -set LVL_TEMP = '0, 4, 0' - -set LVL_TRC = '0, 0, 0' - -set LVL_UFLX = '0, 4, 0' -set LVL_UTFLX = '0, 4, 0' -set LVL_USFLX = '0, 4, 0' - -set LVL_UMFLTD = '0, 0, 4' -set LVL_UMFLSM = '0, 0, 4' -set LVL_UTFLTD = '0, 0, 4' -set LVL_UTFLSM = '0, 0, 4' -set LVL_UTFLLD = '0, 0, 4' -set LVL_USFLTD = '0, 0, 4' -set LVL_USFLSM = '0, 0, 4' -set LVL_USFLLD = '0, 0, 4' - -set LVL_UVEL = '0, 4, 0' -set LVL_VFLX = '0, 4, 0' -set LVL_VTFLX = '0, 4, 0' -set LVL_VSFLX = '0, 4, 0' - -set LVL_VMFLTD = '0, 0, 4' -set LVL_VMFLSM = '0, 0, 4' -set LVL_VTFLTD = '0, 0, 4' -set LVL_VTFLSM = '0, 0, 4' -set LVL_VTFLLD = '0, 0, 4' -set LVL_VSFLTD = '0, 0, 4' -set LVL_VSFLSM = '0, 0, 4' -set LVL_VSFLLD = '0, 0, 4' - -set LVL_VVEL = '0, 4, 0' -set LVL_WFLX = '0, 4, 0' -set LVL_WFLX2 = '0, 4, 0' -set LVL_PV = '0, 4, 0' -set LVL_TKE = '0, 4, 0' -set LVL_GLS_PSI = '0, 4, 0' -set LVL_IDLAGE = '0, 4, 0' -set MSC_MMFLXL = '0, 4, 0' -set MSC_MMFLXD = '0, 4, 0' -set MSC_MMFTDL = '0, 4, 0' -set MSC_MMFSML = '0, 4, 0' -set MSC_MMFTDD = '0, 4, 0' -set MSC_MMFSMD = '0, 4, 0' -set MSC_MHFLX = '0, 4, 0' -set MSC_MHFTD = '0, 4, 0' -set MSC_MHFSM = '0, 4, 0' -set MSC_MHFLD = '0, 4, 0' -set MSC_MSFLX = '0, 4, 0' -set MSC_MSFTD = '0, 4, 0' -set MSC_MSFSM = '0, 4, 0' -set MSC_MSFLD = '0, 4, 0' -set MSC_VOLTR = '0, 4, 0' -set MSC_MASSGS = '0, 4, 0' -set MSC_VOLGS = '0, 4, 0' -set MSC_SALNGA = '0, 4, 0' -set MSC_TEMPGA = '0, 4, 0' -set MSC_SSSGA = '0, 4, 0' -set MSC_SSTGA = '0, 4, 0' - -#------------------------------ -# set DIABGC defaults -#------------------------------ -set BGC_FNAMETAG = "'hbgcd','hbgcm','hbgcy'" -set BGC_AVEPERIO = '1,30,365' -set BGC_FILEFREQ = '30,30,365' -if ("$TEST" == TRUE) then - set BGC_FILEFREQ = ' 1,30,365' -else - set BGC_FILEFREQ = '30,30,365' -endif -set BGC_COMPFLAG = '0, 0, 0' -if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then - set BGC_NCFORMAT = '1, 1, 1' -else - set BGC_NCFORMAT = '0, 0, 0' -endif -set BGC_INVENTORY = '0, 1, 0' -set SRF_PHOSPH = '0, 2, 2' -set SRF_OXYGEN = '0, 2, 2' -set SRF_IRON = '0, 2, 2' -set SRF_ANO3 = '0, 2, 2' -set SRF_ALKALI = '4, 2, 2' -set SRF_SILICA = '0, 2, 2' -set SRF_DIC = '4, 2, 2' -set SRF_PHYTO = '4, 2, 2' -set SRF_PH = '0, 2, 2' -set SRF_EXPORT = '0, 2, 2' -set SRF_EXPOSI = '0, 2, 2' -set SRF_EXPOCA = '0, 2, 2' -set SRF_KWCO2 = '0, 2, 2' -set SRF_KWCO2KHM = '0, 2, 2' -set SRF_CO2KH = '0, 2, 2' -set SRF_CO2KHM = '0, 2, 2' -set SRF_PCO2 = '0, 2, 2' -set SRF_PCO2M = '0, 2, 2' -set SRF_CO2FXD = '4, 2, 2' -set SRF_CO2FXU = '4, 2, 2' -set SRF_OXFLUX = '0, 2, 2' -set SRF_NIFLUX = '0, 2, 2' -set SRF_N2OFX = '0, 0, 2' -set SRF_DMSFLUX = '0, 2, 2' -set SRF_DMS = '0, 2, 2' -set SRF_DMSPROD = '0, 2, 2' -set SRF_DMS_BAC = '0, 2, 2' -set SRF_DMS_UV = '0, 2, 2' -set SRF_ATMCO2 = '0, 2, 2' -set SRF_ATMO2 = '0, 2, 2' -set SRF_ATMN2 = '0, 2, 2' -set SRF_NATDIC = '0, 2, 2' -set SRF_NATALKALI = '0, 2, 2' -set SRF_NATPH = '0, 2, 2' -set SRF_NATPCO2 = '0, 2, 2' -set SRF_NATCO2FX = '0, 2, 2' -set SRF_CO213FXD = '0, 2, 2' -set SRF_CO213FXU = '0, 2, 2' -set SRF_CO214FXD = '0, 2, 2' -set SRF_CO214FXU = '0, 2, 2' -set SRF_CFC11 = '0, 2, 2' -set SRF_CFC12 = '0, 2, 2' -set SRF_SF6 = '0, 2, 2' -set SRF_BROMO = '0, 2, 2' -set SRF_BROMOFX = '0, 2, 2' -set INT_BROMOPRO = '0, 2, 2' -set INT_BROMOUV = '0, 2, 2' -set INT_PHOSY = '4, 2, 2' -set INT_NFIX = '0, 2, 2' -set INT_DNIT = '0, 2, 2' -if ("$BLOM_N_DEPOSITION" == TRUE) then -set FLX_NDEP = '0, 2, 2' -else -set FLX_NDEP = '0, 0, 0' -endif -set FLX_OALK = '0, 0, 0' -set FLX_CAR0100 = '0, 2, 2' -set FLX_CAR0500 = '0, 2, 2' -set FLX_CAR1000 = '0, 2, 2' -set FLX_CAR2000 = '0, 2, 2' -set FLX_CAR4000 = '0, 2, 2' -set FLX_CAR_BOT = '0, 2, 2' -set FLX_BSI0100 = '0, 2, 2' -set FLX_BSI0500 = '0, 2, 2' -set FLX_BSI1000 = '0, 2, 2' -set FLX_BSI2000 = '0, 2, 2' -set FLX_BSI4000 = '0, 2, 2' -set FLX_BSI_BOT = '0, 2, 2' -set FLX_CAL0100 = '0, 2, 2' -set FLX_CAL0500 = '0, 2, 2' -set FLX_CAL1000 = '0, 2, 2' -set FLX_CAL2000 = '0, 2, 2' -set FLX_CAL4000 = '0, 2, 2' -set FLX_CAL_BOT = '0, 2, 2' -set LYR_PHYTO = '0, 0, 2' -set LYR_GRAZER = '0, 0, 2' -set LYR_DOC = '0, 0, 2' -set LYR_PHOSY = '0, 0, 2' -set LYR_PHOSPH = '0, 0, 2' -set LYR_OXYGEN = '0, 0, 4' -set LYR_IRON = '0, 0, 2' -set LYR_ANO3 = '0, 0, 2' -set LYR_ALKALI = '0, 0, 2' -set LYR_SILICA = '0, 0, 2' -set LYR_DIC = '0, 0, 2' -set LYR_POC = '0, 0, 2' -set LYR_CALC = '0, 0, 2' -set LYR_OPAL = '0, 0, 2' -set LYR_CO3 = '0, 0, 2' -set LYR_N2O = '0, 0, 0' -set LYR_PH = '0, 0, 2' -set LYR_OMEGAC = '0, 0, 2' -set LYR_OMEGAA = '0, 0, 2' -set LYR_PREFO2 = '0, 0, 4' -set LYR_O2SAT = '0, 0, 4' -set LYR_PREFPO4 = '0, 0, 2' -set LYR_PREFALK = '0, 0, 2' -set LYR_PREFDIC = '0, 0, 2' -set LYR_DICSAT = '0, 0, 2' -set LYR_NATDIC = '0, 0, 2' -set LYR_NATALKALI = '0, 0, 2' -set LYR_NATCO3 = '0, 0, 2' -set LYR_NATCALC = '0, 0, 2' -set LYR_NATPH = '0, 0, 2' -set LYR_NATOMEGAC = '0, 0, 2' -set LYR_NATOMEGAA = '0, 0, 2' -set LYR_DIC13 = '0, 0, 2' -set LYR_DIC14 = '0, 0, 2' -set LYR_D13C = '0, 0, 2' -set LYR_D14C = '0, 0, 2' -set LYR_BIGD14C = '0, 0, 2' -set LYR_POC13 = '0, 0, 2' -set LYR_DOC13 = '0, 0, 2' -set LYR_CALC13 = '0, 0, 2' -set LYR_PHYTO13 = '0, 0, 2' -set LYR_GRAZER13 = '0, 0, 2' -set LYR_CFC11 = '0, 0, 2' -set LYR_CFC12 = '0, 0, 2' -set LYR_SF6 = '0, 0, 2' -set LYR_NOS = '0, 0, 2' -set LYR_WPHY = '0, 0, 2' -set LYR_WNOS = '0, 0, 2' -set LYR_EPS = '0, 0, 0' -set LYR_ASIZE = '0, 0, 0' -set LYR_BROMO = '0, 0, 2' -set BGC_DP = '0, 2, 2' -set LVL_PHYTO = '0, 2, 2' -set LVL_GRAZER = '0, 2, 2' -set LVL_DOC = '0, 2, 2' -set LVL_PHOSY = '0, 2, 2' -set LVL_PHOSPH = '0, 2, 2' -set LVL_OXYGEN = '0, 4, 4' -set LVL_IRON = '0, 2, 2' -set LVL_ANO3 = '0, 2, 2' -set LVL_ALKALI = '0, 2, 2' -set LVL_SILICA = '0, 2, 2' -set LVL_DIC = '0, 2, 2' -set LVL_POC = '0, 2, 2' -set LVL_CALC = '0, 2, 2' -set LVL_OPAL = '0, 2, 2' -set LVL_CO3 = '0, 2, 2' -set LVL_N2O = '0, 0, 2' -set LVL_PH = '0, 2, 2' -set LVL_OMEGAC = '0, 2, 2' -set LVL_OMEGAA = '0, 2, 2' -set LVL_PREFO2 = '0, 4, 4' -set LVL_O2SAT = '0, 4, 4' -set LVL_PREFPO4 = '0, 2, 2' -set LVL_PREFALK = '0, 2, 2' -set LVL_PREFDIC = '0, 2, 2' -set LVL_DICSAT = '0, 2, 2' -set LVL_NATDIC = '0, 2, 2' -set LVL_NATALKALI = '0, 2, 2' -set LVL_NATCO3 = '0, 2, 2' -set LVL_NATCALC = '0, 2, 2' -set LVL_NATPH = '0, 2, 2' -set LVL_NATOMEGAC = '0, 2, 2' -set LVL_NATOMEGAA = '0, 2, 2' -set LVL_DIC13 = '0, 2, 2' -set LVL_DIC14 = '0, 2, 2' -set LVL_D13C = '0, 2, 2' -set LVL_POC13 = '0, 2, 2' -set LVL_DOC13 = '0, 2, 2' -set LVL_CALC13 = '0, 2, 2' -set LVL_PHYTO13 = '0, 2, 2' -set LVL_GRAZER13 = '0, 2, 2' -set LVL_CFC11 = '0, 2, 2' -set LVL_CFC12 = '0, 2, 2' -set LVL_SF6 = '0, 2, 2' -set LVL_NOS = '0, 2, 2' -set LVL_WPHY = '0, 2, 2' -set LVL_WNOS = '0, 2, 2' -set LVL_EPS = '0, 0, 0' -set LVL_ASIZE = '0, 0, 0' -set LVL_BROMO = '0, 2, 2' -set FLX_SEDIFFIC = '0, 0, 2' -set FLX_SEDIFFAL = '0, 0, 2' -set FLX_SEDIFFPH = '0, 0, 2' -set FLX_SEDIFFOX = '0, 0, 2' -set FLX_SEDIFFN2 = '0, 0, 2' -set FLX_SEDIFFNO3 = '0, 0, 2' -set FLX_SEDIFFSI = '0, 0, 2' -set SDM_POWAIC = '0, 0, 2' -set SDM_POWAAL = '0, 0, 2' -set SDM_POWAPH = '0, 0, 2' -set SDM_POWAOX = '0, 0, 2' -set SDM_POWN2 = '0, 0, 2' -set SDM_POWNO3 = '0, 0, 2' -set SDM_POWASI = '0, 0, 2' -set SDM_SSSO12 = '0, 0, 2' -set SDM_SSSSIL = '0, 0, 2' -set SDM_SSSC12 = '0, 0, 2' -set SDM_SSSTER = '0, 0, 2' -set BUR_SSSO12 = '0, 0, 2' -set BUR_SSSSIL = '0, 0, 2' -set BUR_SSSC12 = '0, 0, 2' -set BUR_SSSTER = '0, 0, 2' - -# if partial coupling, enable SSS relaxation -if ("$BLOM_COUPLING" =~ *partial*) then - if ("$BLOM_VCOORD" == isopyc_bulkml) then - set SRXDAY = 6. - else - set SRXDAY = 60. - set SRXDPT = 10. - endif - set SPRFAC = .true. - set SRXBAL = .true. -endif - -# set grid dependent parameters -if ("$OCN_GRID" == gx1v5 || "$OCN_GRID" == gx1v6) then - set BACLIN = 1800. - set BATROP = 36. -else if ("$OCN_GRID" == gx3v7) then - set BACLIN = 3600. - set BATROP = 72. -else if ("$OCN_GRID" == tnx2v1 ) then - set BACLIN = 4800. - set BATROP = 96. - set EGC = 0.5 - if ("$BLOM_UNIT" == cgs) then - set EGMXDF = 1000.e4 - else - set EGMXDF = 1000. - endif - set CWMTAG = "'Gibraltar','Gibraltar'" - set CWMEDG = " 'u', 'u'" - set CWMI = " 53, 54" - set CWMJ = " 137, 137" - set CWMWTH = " 30.e3, 30.e3" -else if ("$OCN_GRID" == tnx1.5v1 ) then - set BACLIN = 4800. - set BATROP = 96. - set EGC = 0.5 - if ("$BLOM_UNIT" == cgs) then - set EGMXDF = 1000.e4 - else - set EGMXDF = 1000. - endif -else if ("$OCN_GRID" == tnx1v1 || "$OCN_GRID" == tnx1v3 || "$OCN_GRID" == tnx1v4) then - if ("$OCN_NCPL" == 24) then - set BACLIN = 3600. - set BATROP = 60. - set CWBDTS = .75e-4 - set NIWGF = .4 - set SMTFRC = .false. - if ("$BLOM_VCOORD" == isopyc_bulkml) then - set CE = .5 - endif - else - set BACLIN = 3200. - set BATROP = 64. - endif - set CWMTAG = "'Gibraltar','Gibraltar'" - set CWMEDG = " 'u', 'u'" - set CWMI = " 105, 106" - set CWMJ = " 273, 273" - set CWMWTH = " 30.e3, 30.e3" -else if ("$OCN_GRID" == tnx0.25v1 || "$OCN_GRID" == tnx0.25v3 || "$OCN_GRID" == tnx0.25v4) then - set BACLIN = 900. - set BATROP = 15. - if ("$BLOM_UNIT" == cgs) then - set MDV2HI = .15 - set MDV2LO = .15 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300.e4 - set MDC2LO = 300.e4 - else - set MDV2HI = .0015 - set MDV2LO = .0015 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300. - set MDC2LO = 300. - endif - set VSC2HI = .15 - set VSC2LO = .15 - set VSC4HI = 0.0625 - set VSC4LO = 0.0625 - set CWBDTS = 0.75e-4 - set CWBDLS = 25. - set EDWMTH = "'step'" - set EGC = 0.85 - if ("$BLOM_UNIT" == cgs) then - set EGMXDF = 1500.e4 - else - set EGMXDF = 1500. - endif - if ("$BLOM_VCOORD" == isopyc_bulkml) then - set CE = 1.0 - endif -else if ("$OCN_GRID" == tnx0.125v4) then - set BACLIN = 300. - set BATROP = 6. - set EGMNDF = 0. - set EGMXDF = 0. - set EDWMTH = "'step'" - set CWBDTS = .75e-4 - set CWBDLS = 25 - if ("$BLOM_UNIT" == cgs) then - set MDV2HI = .1 - set MDV2LO = .1 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300.e4 - set MDC2LO = 100.e4 - else - set MDV2HI = .001 - set MDV2LO = .001 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300. - set MDC2LO = 100. - endif - set VSC2HI = 0. - set VSC2LO = 0. - set VSC4HI = .06 - set VSC4LO = .06 - set LTEDTP = "'layer'" -else - echo "OCN_GRID is $OCN_GRID \n" - echo "$0 ERROR: Cannot deal with GRID equal to $OCN_GRID " - exit -1 -endif - -# set grid independent input files (iHAMOCC initial conditions) -set INIDIC = "'$DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_Ct_preind_OMIPinit_20171107.nc'" -set INIALK = "'$DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_At_OMIPinit_20171107.nc'" -set INIPO4 = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_phosphate_OMIPinit_20171107.nc'" -set INIOXY = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_oxygen_OMIPinit_20171107.nc'" -set ININO3 = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_nitrate_OMIPinit_20171107.nc'" -set INISIL = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_silicate_OMIPinit_20171107.nc'" -if ("$HAMOCC_CISO" == TRUE) then -set INID13C = "'$DIN_LOC_ROOT/ocn/blom/inicon/d13C_permil_20180609.nc'" -set INID14C = "'$DIN_LOC_ROOT/ocn/blom/inicon/d14C_permil_20180609.nc'" -else -set INID13C = "''" -set INID14C = "''" -endif - -# set grid dependent input files -if ("$OCN_GRID" == tnx2v1) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx2v1_20130206.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx2v1_20130419.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx2v1_20130419.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx2v1_20190826.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx2v1_20190826.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx2v1_20190826.dat'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx2v1_20130927.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx2v1_20130506.nc'" - set SWACLIMFILE = "''" - set SEDPORFILE = "''" - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx2v1_20170915.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else if ("$OCN_GRID" == tnx1v4) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx1v4_20170622.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx1v4_20170622.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx1v4_20170605.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx1v4_20190729.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx1v4_20190615.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx1v4_20190611.dat'" - set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx1v4_20170608.nc'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx1v4_20170604.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx1v4_20171107.nc'" - set SEDPORFILE = "''" - if ("$HAMOCC_VSLS" == TRUE) then - set SWACLIMFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc'" - else - set SWACLIMFILE = "''" - endif - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx1v4_20170820.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else if ("$OCN_GRID" == tnx0.25v4) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.25v4_20170622.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.25v4_20170623.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.25v4_20170626.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.25v4_20190612.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.25v4_20190612.dat'" - set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.25v4_20170623.nc'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.25v4_20170623.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.25v4_20181004.nc'" - set SWACLIMFILE = "''" - set SEDPORFILE = "''" - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.25v4_20170821.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else if ("$OCN_GRID" == tnx0.125v4) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.125v4_20221013.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.125v4_20230318.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.125v4_20221013.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.125v4_20221013.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.125v4_20221013.dat'" - set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.125v4_20221013.nc'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20221013.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.125v4_20221013.nc'" - set SWACLIMFILE = "''" - set SEDPORFILE = "''" - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.125v4_20221013.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else - echo "$0 ERROR: Cannot deal with GRID = $OCN_GRID " - exit -1 -endif - - -#------------------------------------------------------------------------------ -# Create resolved namelist -#------------------------------------------------------------------------------ -foreach mem ("`seq $NINST_OCN`") - if ( ${NINST_OCN} == '1' ) then - set inststr = '' - else - set inststr = ("`printf '_%4.4d' $mem`") - endif - - # modify namelist variables as specified in user_nl_blom - foreach line ("`grep = $CASEROOT/user_nl_blom$inststr`") - if (`echo "$line" | tr -d ' ' | cut -c -1` != '#') then - set var = `echo "$line" | sed 's/=.*//' | tr '[a-z]' '[A-Z]'` - set val = `echo "$line" | sed 's/.*=//'` - eval 'set $var = "$val"' - endif - end - -cp ocn_in.readme $RUNDIR/. - -cat >! $RUNDIR/ocn_in$inststr << EOF -&LIMITS - NDAY1 = $NDAY1 - NDAY2 = $NDAY2 - IDATE = $IDATE - IDATE0 = $IDATE0 - RUNID = $RUNID - EXPCNF = $EXPCNF - RUNTYP = $RUNTYP - GRFILE = $GRFILE - ICFILE = $ICFILE - PREF = $PREF - BACLIN = $BACLIN - BATROP = $BATROP - MDV2HI = $MDV2HI - MDV2LO = $MDV2LO - MDV4HI = $MDV4HI - MDV4LO = $MDV4LO - MDC2HI = $MDC2HI - MDC2LO = $MDC2LO - VSC2HI = $VSC2HI - VSC2LO = $VSC2LO - VSC4HI = $VSC4HI - VSC4LO = $VSC4LO - CBAR = $CBAR - CB = $CB - CWBDTS = $CWBDTS - CWBDLS = $CWBDLS - MOMMTH = $MOMMTH - BMCMTH = $BMCMTH - RMPMTH = $RMPMTH - MLRTTP = $MLRTTP - RM0 = $RM0 - RM5 = $RM5 - CE = $CE - TDFILE = $TDFILE - NIWGF = $NIWGF - NIWBF = $NIWBF - NIWLF = $NIWLF - SWAMTH = $SWAMTH - JWTYPE = $JWTYPE - CHLOPT = $CHLOPT - CCFILE = $CCFILE - TRXDAY = $TRXDAY - SRXDAY = $SRXDAY - TRXDPT = $TRXDPT - SRXDPT = $SRXDPT - TRXLIM = $TRXLIM - SRXLIM = $SRXLIM - APTFLX = $APTFLX - APSFLX = $APSFLX - DITFLX = $DITFLX - DISFLX = $DISFLX - SRXBAL = $SRXBAL - SCFILE = $SCFILE - WAVSRC = $WAVSRC - SMTFRC = $SMTFRC - SPRFAC = $SPRFAC - ATM_PATH = $ATM_PATH - ITEST = $ITEST - JTEST = $JTEST - CNSVDI = $CNSVDI - CSDIAG = $CSDIAG - RSTFRQ = $RSTFRQ - RSTFMT = $RSTFMT - RSTCMP = $RSTCMP - IOTYPE = $IOTYPE -/ -EOF - -if ("$BLOM_VCOORD" == cntiso_hybrid) then -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&VCOORD - VCOORD_TYPE = $VCOORD_TYPE - RECONSTRUCTION_METHOD = $RECONSTRUCTION_METHOD - DENSITY_LIMITING = $DENSITY_LIMITING - TRACER_LIMITING = $TRACER_LIMITING - VELOCITY_LIMITING = $VELOCITY_LIMITING - DENSITY_PC_UPPER_BNDR = $DENSITY_PC_UPPER_BNDR - DENSITY_PC_LOWER_BNDR = $DENSITY_PC_LOWER_BNDR - TRACER_PC_UPPER_BNDR = $TRACER_PC_UPPER_BNDR - TRACER_PC_LOWER_BNDR = $TRACER_PC_LOWER_BNDR - VELOCITY_PC_UPPER_BNDR = $VELOCITY_PC_UPPER_BNDR - VELOCITY_PC_LOWER_BNDR = $VELOCITY_PC_LOWER_BNDR - DPMIN_SURFACE = $DPMIN_SURFACE - DPMIN_INFLATION_FACTOR = $DPMIN_INFLATION_FACTOR - DPMIN_INTERIOR = $DPMIN_INTERIOR - DKTZU = $DKTZU - DKTZL = $DKTZL -/ -EOF -endif - -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&DIFFUSION - EITMTH = $EITMTH - EDRITP = $EDRITP - EDWMTH = $EDWMTH - EDDF2D = $EDDF2D - EDSPRS = $EDSPRS - EGC = $EGC - EGGAM = $EGGAM - EGLSMN = $EGLSMN - EGMNDF = $EGMNDF - EGMXDF = $EGMXDF - EGIDFQ = $EGIDFQ - TBFILE = $TBFILE - RHISCF = $RHISCF - EDANIS = $EDANIS - REDI3D = $REDI3D - RHSCTP = $RHSCTP - RI0 = $RI0 - BDMTYP = $BDMTYP - BDMC1 = $BDMC1 - BDMC2 = $BDMC2 - BDMLDP = $BDMLDP - TKEPF = $TKEPF - SMOBLD = $SMOBLD - LNGMTP = $LNGMTP - LTEDTP = $LTEDTP -/ -EOF - -if ($?CWMTAG) then -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&CWMOD - CWMTAG = $CWMTAG - CWMEDG = $CWMEDG - CWMI = $CWMI - CWMJ = $CWMJ - CWMWTH = $CWMWTH -/ -EOF -endif - -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&MERDIA - MER_ORFILE = $MER_ORFILE - MER_MIFILE = $MER_MIFILE - MER_REGNAM = 'atlantic_arctic_ocean', 'atlantic_arctic_extended_ocean', 'indian_pacific_ocean', 'global_ocean' - MER_REGFLG(1,:) = 2, 4 - MER_REGFLG(2,:) = 2, 4, 6, 7, 8, 9 - MER_REGFLG(3,:) = 3, 5 - MER_REGFLG(4,:) = 0 - MER_MINLAT = -34., -34., -34., -90. - MER_MAXLAT = 90., 90., 90., 90. -/ - -&SECDIA - SEC_SIFILE = $SEC_SIFILE -/ - -&DIAPHY - GLB_FNAMETAG = $GLB_FNAMETAG - GLB_AVEPERIO = $GLB_AVEPERIO - GLB_FILEFREQ = $GLB_FILEFREQ - GLB_COMPFLAG = $GLB_COMPFLAG - GLB_NCFORMAT = $GLB_NCFORMAT - H2D_ABSWND = $H2D_ABSWND - H2D_ALB = $H2D_ALB - H2D_BTMSTR = $H2D_BTMSTR - H2D_BRNFLX = $H2D_BRNFLX - H2D_BRNPD = $H2D_BRNPD - H2D_DFL = $H2D_DFL - H2D_EVA = $H2D_EVA - H2D_FICE = $H2D_FICE - H2D_FMLTFZ = $H2D_FMLTFZ - H2D_HICE = $H2D_HICE - H2D_HMLTFZ = $H2D_HMLTFZ - H2D_HSNW = $H2D_HSNW - H2D_IAGE = $H2D_IAGE - H2D_IDKEDT = $H2D_IDKEDT - H2D_LAMULT = $H2D_LAMULT - H2D_LASL = $H2D_LASL - H2D_LIP = $H2D_LIP - H2D_MAXMLD = $H2D_MAXMLD - H2D_MLD = $H2D_MLD - H2D_MLTS = $H2D_MLTS - H2D_MLTSMN = $H2D_MLTSMN - H2D_MLTSMX = $H2D_MLTSMX - H2D_MLTSSQ = $H2D_MLTSSQ - H2D_MTKEUS = $H2D_MTKEUS - H2D_MTKENI = $H2D_MTKENI - H2D_MTKEBF = $H2D_MTKEBF - H2D_MTKERS = $H2D_MTKERS - H2D_MTKEPE = $H2D_MTKEPE - H2D_MTKEKE = $H2D_MTKEKE - H2D_MTY = $H2D_MTY - H2D_NSF = $H2D_NSF - H2D_PBOT = $H2D_PBOT - H2D_PSRF = $H2D_PSRF - H2D_RFIFLX = $H2D_RFIFLX - H2D_RNFFLX = $H2D_RNFFLX - H2D_SALFLX = $H2D_SALFLX - H2D_SALRLX = $H2D_SALRLX - H2D_SBOT = $H2D_SBOT - H2D_SEALV = $H2D_SEALV - H2D_SLVSQ = $H2D_SLVSQ - H2D_SFL = $H2D_SFL - H2D_SOP = $H2D_SOP - H2D_SIGMX = $H2D_SIGMX - H2D_SSS = $H2D_SSS - H2D_SSSSQ = $H2D_SSSSQ - H2D_SST = $H2D_SST - H2D_SSTSQ = $H2D_SSTSQ - H2D_SURFLX = $H2D_SURFLX - H2D_SURRLX = $H2D_SURRLX - H2D_SWA = $H2D_SWA - H2D_T20D = $H2D_T20D - H2D_TAUX = $H2D_TAUX - H2D_TAUY = $H2D_TAUY - H2D_TBOT = $H2D_TBOT - H2D_TICE = $H2D_TICE - H2D_TSRF = $H2D_TSRF - H2D_UB = $H2D_UB - H2D_UICE = $H2D_UICE - H2D_USTAR = $H2D_USTAR - H2D_USTAR3 = $H2D_USTAR3 - H2D_USTOKES = $H2D_USTOKES - H2D_VB = $H2D_VB - H2D_VICE = $H2D_VICE - H2D_VSTOKES = $H2D_VSTOKES - H2D_ZTX = $H2D_ZTX - LYR_BFSQ = $LYR_BFSQ - LYR_DIFDIA = $LYR_DIFDIA - LYR_DIFVMO = $LYR_DIFVMO - LYR_DIFVHO = $LYR_DIFVHO - LYR_DIFVSO = $LYR_DIFVSO - LYR_DIFINT = $LYR_DIFINT - LYR_DIFISO = $LYR_DIFISO - LYR_DP = $LYR_DP - LYR_DZ = $LYR_DZ - LYR_SALN = $LYR_SALN - LYR_TEMP = $LYR_TEMP - LYR_TRC = $LYR_TRC - LYR_UFLX = $LYR_UFLX - LYR_UTFLX = $LYR_UTFLX - LYR_USFLX = $LYR_USFLX - LYR_UMFLTD = $LYR_UMFLTD - LYR_UMFLSM = $LYR_UMFLSM - LYR_UTFLTD = $LYR_UTFLTD - LYR_UTFLSM = $LYR_UTFLSM - LYR_UTFLLD = $LYR_UTFLLD - LYR_USFLTD = $LYR_USFLTD - LYR_USFLSM = $LYR_USFLSM - LYR_USFLLD = $LYR_USFLLD - LYR_UVEL = $LYR_UVEL - LYR_VFLX = $LYR_VFLX - LYR_VTFLX = $LYR_VTFLX - LYR_VSFLX = $LYR_VSFLX - LYR_VMFLTD = $LYR_VMFLTD - LYR_VMFLSM = $LYR_VMFLSM - LYR_VTFLTD = $LYR_VTFLTD - LYR_VTFLSM = $LYR_VTFLSM - LYR_VTFLLD = $LYR_VTFLLD - LYR_VSFLTD = $LYR_VSFLTD - LYR_VSFLSM = $LYR_VSFLSM - LYR_VSFLLD = $LYR_VSFLLD - LYR_VVEL = $LYR_VVEL - LYR_WFLX = $LYR_WFLX - LYR_WFLX2 = $LYR_WFLX2 - LYR_PV = $LYR_PV - LYR_TKE = $LYR_TKE - LYR_GLS_PSI = $LYR_GLS_PSI - LYR_IDLAGE = $LYR_IDLAGE - LVL_BFSQ = $LVL_BFSQ - LVL_DIFDIA = $LVL_DIFDIA - LVL_DIFVMO = $LVL_DIFVMO - LVL_DIFVHO = $LVL_DIFVHO - LVL_DIFVSO = $LVL_DIFVSO - LVL_DIFINT = $LVL_DIFINT - LVL_DIFISO = $LVL_DIFISO - LVL_DZ = $LVL_DZ - LVL_SALN = $LVL_SALN - LVL_TEMP = $LVL_TEMP - LVL_TRC = $LVL_TRC - LVL_UFLX = $LVL_UFLX - LVL_UTFLX = $LVL_UTFLX - LVL_USFLX = $LVL_USFLX - LVL_UMFLTD = $LVL_UMFLTD - LVL_UMFLSM = $LVL_UMFLSM - LVL_UTFLTD = $LVL_UTFLTD - LVL_UTFLSM = $LVL_UTFLSM - LVL_UTFLLD = $LVL_UTFLLD - LVL_USFLTD = $LVL_USFLTD - LVL_USFLSM = $LVL_USFLSM - LVL_USFLLD = $LVL_USFLLD - LVL_UVEL = $LVL_UVEL - LVL_VFLX = $LVL_VFLX - LVL_VTFLX = $LVL_VTFLX - LVL_VSFLX = $LVL_VSFLX - LVL_VMFLTD = $LVL_VMFLTD - LVL_VMFLSM = $LVL_VMFLSM - LVL_VTFLTD = $LVL_VTFLTD - LVL_VTFLSM = $LVL_VTFLSM - LVL_VTFLLD = $LVL_VTFLLD - LVL_VSFLTD = $LVL_VSFLTD - LVL_VSFLSM = $LVL_VSFLSM - LVL_VSFLLD = $LVL_VSFLLD - LVL_VVEL = $LVL_VVEL - LVL_WFLX = $LVL_WFLX - LVL_WFLX2 = $LVL_WFLX2 - LVL_PV = $LVL_PV - LVL_TKE = $LVL_TKE - LVL_GLS_PSI = $LVL_GLS_PSI - LVL_IDLAGE = $LVL_IDLAGE - MSC_MMFLXL = $MSC_MMFLXL - MSC_MMFLXD = $MSC_MMFLXD - MSC_MMFTDL = $MSC_MMFTDL - MSC_MMFSML = $MSC_MMFSML - MSC_MMFTDD = $MSC_MMFTDD - MSC_MMFSMD = $MSC_MMFSMD - MSC_MHFLX = $MSC_MHFLX - MSC_MHFTD = $MSC_MHFTD - MSC_MHFSM = $MSC_MHFSM - MSC_MHFLD = $MSC_MHFLD - MSC_MSFLX = $MSC_MSFLX - MSC_MSFTD = $MSC_MSFTD - MSC_MSFSM = $MSC_MSFSM - MSC_MSFLD = $MSC_MSFLD - MSC_VOLTR = $MSC_VOLTR - MSC_MASSGS = $MSC_MASSGS - MSC_VOLGS = $MSC_VOLGS - MSC_SALNGA = $MSC_SALNGA - MSC_TEMPGA = $MSC_TEMPGA - MSC_SSSGA = $MSC_SSSGA - MSC_SSTGA = $MSC_SSTGA -/ -EOF - -if ("$ecosys" == TRUE) then -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&BGCNML - ATM_CO2 = $CCSM_CO2_PPMV - FEDEPFILE = $FEDEPFILE - SWACLIMFILE = $SWACLIMFILE - DO_RIVINPT = $DO_RIVINPT - RIVINFILE = $RIVINFILE - DO_NDEP = $DO_NDEP - NDEPFILE = $NDEPFILE - DO_OALK = $DO_OALK - DO_SEDSPINUP = $DO_SEDSPINUP - SEDSPIN_YR_S = $SEDSPIN_YR_S - SEDSPIN_YR_E = $SEDSPIN_YR_E - SEDSPIN_NCYC = $SEDSPIN_NCYC - INIDIC = $INIDIC - INIALK = $INIALK - INIPO4 = $INIPO4 - INIOXY = $INIOXY - ININO3 = $ININO3 - INISIL = $INISIL - INID13C = $INID13C - INID14C = $INID14C - WITH_DMSPH = $WITH_DMSPH - PI_PH_FILE = $PI_PH_FILE - L_3DVARSEDPOR = $L_3DVARSEDPOR - SEDPORFILE = $SEDPORFILE -/ - -&BGCOAFX - OALKSCEN = $BGCOAFX_OALKSCEN - OALKFILE = $BGCOAFX_OALKFILE - ADDALK = $BGCOAFX_ADDALK - CDRMIP_LATMAX = $BGCOAFX_CDRMIP_LATMAX - CDRMIP_LATMIN = $BGCOAFX_CDRMIP_LATMIN - RAMP_START = $BGCOAFX_RAMP_START - RAMP_END = $BGCOAFX_RAMP_END -/ - -&DIABGC - GLB_FNAMETAG = $BGC_FNAMETAG - GLB_AVEPERIO = $BGC_AVEPERIO - GLB_FILEFREQ = $BGC_FILEFREQ - GLB_COMPFLAG = $BGC_COMPFLAG - GLB_NCFORMAT = $BGC_NCFORMAT - GLB_INVENTORY = $BGC_INVENTORY - SRF_PHOSPH = $SRF_PHOSPH - SRF_OXYGEN = $SRF_OXYGEN - SRF_IRON = $SRF_IRON - SRF_ANO3 = $SRF_ANO3 - SRF_ALKALI = $SRF_ALKALI - SRF_SILICA = $SRF_SILICA - SRF_DIC = $SRF_DIC - SRF_PHYTO = $SRF_PHYTO - SRF_PH = $SRF_PH - SRF_EXPORT = $SRF_EXPORT - SRF_EXPOSI = $SRF_EXPOSI - SRF_EXPOCA = $SRF_EXPOCA - SRF_KWCO2 = $SRF_KWCO2 - SRF_KWCO2KHM = $SRF_KWCO2KHM - SRF_CO2KH = $SRF_CO2KH - SRF_CO2KHM = $SRF_CO2KHM - SRF_PCO2 = $SRF_PCO2 - SRF_PCO2M = $SRF_PCO2M - SRF_CO2FXD = $SRF_CO2FXD - SRF_CO2FXU = $SRF_CO2FXU - SRF_OXFLUX = $SRF_OXFLUX - SRF_NIFLUX = $SRF_NIFLUX - SRF_N2OFX = $SRF_N2OFX - SRF_DMSFLUX = $SRF_DMSFLUX - SRF_DMS = $SRF_DMS - SRF_DMSPROD = $SRF_DMSPROD - SRF_DMS_BAC = $SRF_DMS_BAC - SRF_DMS_UV = $SRF_DMS_UV - SRF_ATMCO2 = $SRF_ATMCO2 - SRF_ATMO2 = $SRF_ATMO2 - SRF_ATMN2 = $SRF_ATMN2 - SRF_NATDIC = $SRF_NATDIC - SRF_NATALKALI = $SRF_NATALKALI - SRF_NATPH = $SRF_NATPH - SRF_NATPCO2 = $SRF_NATPCO2 - SRF_NATCO2FX = $SRF_NATCO2FX - SRF_CO213FXD = $SRF_CO213FXD - SRF_CO213FXU = $SRF_CO213FXU - SRF_CO214FXD = $SRF_CO214FXD - SRF_CO214FXU = $SRF_CO214FXU - SRF_CFC11 = $SRF_CFC11 - SRF_CFC12 = $SRF_CFC12 - SRF_SF6 = $SRF_SF6 - SRF_BROMO = $SRF_BROMO - SRF_BROMOFX = $SRF_BROMOFX - INT_BROMOPRO = $INT_BROMOPRO - INT_BROMOUV = $INT_BROMOUV - INT_PHOSY = $INT_PHOSY - INT_NFIX = $INT_NFIX - INT_DNIT = $INT_DNIT - FLX_NDEP = $FLX_NDEP - FLX_OALK = $FLX_OALK - FLX_CAR0100 = $FLX_CAR0100 - FLX_CAR0500 = $FLX_CAR0500 - FLX_CAR1000 = $FLX_CAR1000 - FLX_CAR2000 = $FLX_CAR2000 - FLX_CAR4000 = $FLX_CAR4000 - FLX_CAR_BOT = $FLX_CAR_BOT - FLX_BSI0100 = $FLX_BSI0100 - FLX_BSI0500 = $FLX_BSI0500 - FLX_BSI1000 = $FLX_BSI1000 - FLX_BSI2000 = $FLX_BSI2000 - FLX_BSI4000 = $FLX_BSI4000 - FLX_BSI_BOT = $FLX_BSI_BOT - FLX_CAL0100 = $FLX_CAL0100 - FLX_CAL0500 = $FLX_CAL0500 - FLX_CAL1000 = $FLX_CAL1000 - FLX_CAL2000 = $FLX_CAL2000 - FLX_CAL4000 = $FLX_CAL4000 - FLX_CAL_BOT = $FLX_CAL_BOT - LYR_PHYTO = $LYR_PHYTO - LYR_GRAZER = $LYR_GRAZER - LYR_DOC = $LYR_DOC - LYR_PHOSY = $LYR_PHOSY - LYR_PHOSPH = $LYR_PHOSPH - LYR_OXYGEN = $LYR_OXYGEN - LYR_IRON = $LYR_IRON - LYR_ANO3 = $LYR_ANO3 - LYR_ALKALI = $LYR_ALKALI - LYR_SILICA = $LYR_SILICA - LYR_DIC = $LYR_DIC - LYR_POC = $LYR_POC - LYR_CALC = $LYR_CALC - LYR_OPAL = $LYR_OPAL - LYR_CO3 = $LYR_CO3 - LYR_N2O = $LYR_N2O - LYR_PH = $LYR_PH - LYR_OMEGAC = $LYR_OMEGAC - LYR_OMEGAA = $LYR_OMEGAA - LYR_PREFO2 = $LYR_PREFO2 - LYR_O2SAT = $LYR_O2SAT - LYR_PREFPO4 = $LYR_PREFPO4 - LYR_PREFALK = $LYR_PREFALK - LYR_PREFDIC = $LYR_PREFDIC - LYR_DICSAT = $LYR_DICSAT - LYR_NATDIC = $LYR_NATDIC - LYR_NATALKALI = $LYR_NATALKALI - LYR_NATCO3 = $LYR_NATCO3 - LYR_NATCALC = $LYR_NATCALC - LYR_NATPH = $LYR_NATPH - LYR_NATOMEGAC = $LYR_NATOMEGAC - LYR_NATOMEGAA = $LYR_NATOMEGAA - LYR_DIC13 = $LYR_DIC13 - LYR_DIC14 = $LYR_DIC14 - LYR_D13C = $LYR_D13C - LYR_D14C = $LYR_D14C - LYR_BIGD14C = $LYR_BIGD14C - LYR_POC13 = $LYR_POC13 - LYR_DOC13 = $LYR_DOC13 - LYR_CALC13 = $LYR_CALC13 - LYR_PHYTO13 = $LYR_PHYTO13 - LYR_GRAZER13 = $LYR_GRAZER13 - LYR_CFC11 = $LYR_CFC11 - LYR_CFC12 = $LYR_CFC12 - LYR_SF6 = $LYR_SF6 - LYR_NOS = $LYR_NOS - LYR_WPHY = $LYR_WPHY - LYR_WNOS = $LYR_WNOS - LYR_EPS = $LYR_EPS - LYR_ASIZE = $LYR_ASIZE - LYR_DP = $BGC_DP - LYR_BROMO = $LYR_BROMO - LVL_PHYTO = $LVL_PHYTO - LVL_GRAZER = $LVL_GRAZER - LVL_DOC = $LVL_DOC - LVL_PHOSY = $LVL_PHOSY - LVL_PHOSPH = $LVL_PHOSPH - LVL_OXYGEN = $LVL_OXYGEN - LVL_IRON = $LVL_IRON - LVL_ANO3 = $LVL_ANO3 - LVL_ALKALI = $LVL_ALKALI - LVL_SILICA = $LVL_SILICA - LVL_DIC = $LVL_DIC - LVL_POC = $LVL_POC - LVL_CALC = $LVL_CALC - LVL_OPAL = $LVL_OPAL - LVL_CO3 = $LVL_CO3 - LVL_N2O = $LVL_N2O - LVL_PH = $LVL_PH - LVL_OMEGAC = $LVL_OMEGAC - LVL_OMEGAA = $LVL_OMEGAA - LVL_PREFO2 = $LVL_PREFO2 - LVL_O2SAT = $LVL_O2SAT - LVL_PREFPO4 = $LVL_PREFPO4 - LVL_PREFALK = $LVL_PREFALK - LVL_PREFDIC = $LVL_PREFDIC - LVL_DICSAT = $LVL_DICSAT - LVL_NATDIC = $LVL_NATDIC - LVL_NATALKALI = $LVL_NATALKALI - LVL_NATCO3 = $LVL_NATCO3 - LVL_NATCALC = $LVL_NATCALC - LVL_NATPH = $LVL_NATPH - LVL_NATOMEGAC = $LVL_NATOMEGAC - LVL_NATOMEGAA = $LVL_NATOMEGAA - LVL_DIC13 = $LVL_DIC13 - LVL_DIC14 = $LVL_DIC14 - LVL_D13C = $LVL_D13C - LVL_POC13 = $LVL_POC13 - LVL_DOC13 = $LVL_DOC13 - LVL_CALC13 = $LVL_CALC13 - LVL_PHYTO13 = $LVL_PHYTO13 - LVL_GRAZER13 = $LVL_GRAZER13 - LVL_CFC11 = $LVL_CFC11 - LVL_CFC12 = $LVL_CFC12 - LVL_SF6 = $LVL_SF6 - LVL_NOS = $LVL_NOS - LVL_WPHY = $LVL_WPHY - LVL_WNOS = $LVL_WNOS - LVL_EPS = $LVL_EPS - LVL_ASIZE = $LVL_ASIZE - LVL_BROMO = $LVL_BROMO - FLX_SEDIFFIC = $FLX_SEDIFFIC - FLX_SEDIFFAL = $FLX_SEDIFFAL - FLX_SEDIFFPH = $FLX_SEDIFFPH - FLX_SEDIFFOX = $FLX_SEDIFFOX - FLX_SEDIFFN2 = $FLX_SEDIFFN2 - FLX_SEDIFFNO3 = $FLX_SEDIFFNO3 - FLX_SEDIFFSI = $FLX_SEDIFFSI - SDM_POWAIC = $SDM_POWAIC - SDM_POWAAL = $SDM_POWAAL - SDM_POWAPH = $SDM_POWAPH - SDM_POWAOX = $SDM_POWAOX - SDM_POWN2 = $SDM_POWN2 - SDM_POWNO3 = $SDM_POWNO3 - SDM_POWASI = $SDM_POWASI - SDM_SSSO12 = $SDM_SSSO12 - SDM_SSSSIL = $SDM_SSSSIL - SDM_SSSC12 = $SDM_SSSC12 - SDM_SSSTER = $SDM_SSSTER - BUR_SSSO12 = $BUR_SSSO12 - BUR_SSSSIL = $BUR_SSSSIL - BUR_SSSC12 = $BUR_SSSC12 - BUR_SSSTER = $BUR_SSSTER -/ -EOF -endif - -end ## foreach mem ("`seq $NINST_OCN`") - -#------------------------------------------------------------------------------ -# Generate blom.input_data_list -#------------------------------------------------------------------------------ - -cat > $CASEBUILD/blom.input_data_list << EOF -grid_file = `echo $GRFILE | tr -d '"' | tr -d "'"` -meridional_transport_index_file = `echo $MER_MIFILE | tr -d '"' | tr -d "'"` -meridional_transport_basin_file = `echo $MER_ORFILE | tr -d '"' | tr -d "'"` -section_index_file = `echo $SEC_SIFILE | tr -d '"' | tr -d "'"` -tidal_dissipation_file = `echo $TDFILE | tr -d '"' | tr -d "'"` -EOF -if ($SWAMTH == "'chlorophyll'") then -cat >> $CASEBUILD/blom.input_data_list << EOF -chlorophyll_concentration_file = `echo $CCFILE | tr -d '"' | tr -d "'"` -EOF -endif -if ($SRXDAY != "0.") then -cat >> $CASEBUILD/blom.input_data_list << EOF -sss_climatology_file = `echo $SCFILE | tr -d '"' | tr -d "'"` -EOF -endif - -# iHAMOCC boundary conditions -if ($ecosys == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -dust_file = `echo $FEDEPFILE | tr -d '"' | tr -d "'"` -EOF - if ($BLOM_RIVER_NUTRIENTS == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -river_file = `echo $RIVINFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($BLOM_N_DEPOSITION == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -n_deposition_file = `echo $NDEPFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($BGCOAFX_OALKFILE != "''") then -cat >> $CASEBUILD/blom.input_data_list << EOF -oafx_file = `echo $BGCOAFX_OALKFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($HAMOCC_VSLS == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -swa_clim_file = `echo $SWACLIMFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($L_3DVARSEDPOR == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -sed_porosity_file = `echo $SEDPORFILE | tr -d '"' | tr -d "'"` -EOF - endif -endif - -# BLOM initial conditions -cat >> $CASEBUILD/blom.input_data_list << EOF -inicon_file = `echo $ICFILE | tr -d '"' | tr -d "'"` -EOF - - -# iHAMOCC initial conditions -if ($ecosys == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inidic_file = `echo $INIDIC | tr -d '"' | tr -d "'"` -inialk_file = `echo $INIALK | tr -d '"' | tr -d "'"` -inipo4_file = `echo $INIPO4 | tr -d '"' | tr -d "'"` -inioxy_file = `echo $INIOXY | tr -d '"' | tr -d "'"` -inino3_file = `echo $ININO3 | tr -d '"' | tr -d "'"` -inisil_file = `echo $INISIL | tr -d '"' | tr -d "'"` -EOF - if ($HAMOCC_CISO == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inic13_file = `echo $INID13C | tr -d '"' | tr -d "'"` -inic14_file = `echo $INID14C | tr -d '"' | tr -d "'"` -EOF - endif - if ($RUN_TYPE == startup) then - if ($ICFILE =~ *.blom.r.*) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inicon_bgc_file = `echo $ICFILE | sed 's/.blom.r./.blom.rbgc./' | tr -d '"' | tr -d "'"` -EOF - else if ($ICFILE =~ *.micom.r.*) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inicon_bgc_file = `echo $ICFILE | sed 's/.micom.r./.micom.rbgc./' | tr -d '"' | tr -d "'"` -EOF - endif - endif -endif - - +#!/usr/bin/env python3 + +"""BLOM namelist creator +""" + +# Typically ignore this. +# pylint: disable=invalid-name + +# Disable these because this is our standard setup +# pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-position + +import os, shutil, sys, glob, filecmp, imp, re + +CIMEROOT = os.environ.get("CIMEROOT") +if CIMEROOT is None: + raise SystemExit("ERROR: must set CIMEROOT environment variable") +sys.path.append(os.path.join(CIMEROOT, "CIME", "Tools")) + +from standard_script_setup import * +from CIME.case import Case +from CIME.nmlgen import NamelistGenerator +from CIME.utils import expect +from CIME.utils import run_cmd_no_fail, expect +from CIME.utils import run_cmd +from CIME.buildnml import create_namelist_infile, parse_input + +import glob, shutil +logger = logging.getLogger(__name__) + +# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements +#################################################################################### +def _create_namelists(case, confdir, infile, nmlgen): +#################################################################################### + + """Write out the namelist for this component. + + Most arguments are the same as those for `NamelistGenerator`. + The `confdir` argument is used to specify the directory in which output files will be placed. + """ + rundir = case.get_value("RUNDIR") + srcroot = case.get_value("SRCROOT") + din_loc_root = case.get_value("DIN_LOC_ROOT") + caseroot = case.get_value("CASEROOT") + continue_run = case.get_value("CONTINUE_RUN") + ocn_grid = case.get_value("OCN_GRID") + ocn_ncpl = case.get_value("OCN_NCPL") + blom_unit = case.get_value("BLOM_UNIT") + blom_vcoord = case.get_value("BLOM_VCOORD") + pio_typename_ocn = case.get_value("PIO_TYPENAME_OCN") + pio_netcdf_format_ocn = case.get_value("PIO_NETCDF_FORMAT_OCN") + is_test = case.get_value("TEST") + blom_river_nutrients = case.get_value("BLOM_RIVER_NUTRIENTS") + blom_n_deposition = case.get_value("BLOM_N_DEPOSITION") + blom_ndep_scenario = case.get_value("BLOM_NDEP_SCENARIO") + blom_coupling = case.get_value("BLOM_COUPLING") + blom_tracer_modules = case.get_value("BLOM_TRACER_MODULES") + hamocc_vsls = case.get_value("HAMOCC_VSLS") + hamocc_ciso = case.get_value("HAMOCC_CISO") + hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP") + hamocc_sedspinup_yr_start = case.get_value("HAMOCC_SEDSPINUP_YR_START") + hamocc_sedspinup_yr_end = case.get_value("HAMOCC_SEDSPINUP_YR_END") + hamocc_sedspinup_ncycle = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") + + # error checks + if hamocc_vsls and ocn_grid != "tnx1v4": + expect(False, + "HAMOCC_VSLS is not supported at this grid resolution (no swa-climatology available)") + + # create config dictionary - used in namelist_definition_blom.xml + config = {} + + config['ocn_grid'] = ocn_grid + config['ocn_ncpl'] = str(ocn_ncpl) + config['pio_typename_ocn'] = pio_typename_ocn + config['pio_netcdf_format_ocn'] = pio_netcdf_format_ocn + config["continue_run"] = "yes" if continue_run else "no" + config["is_test"] = "yes" if is_test else "no" + if is_test: + testcase = case.get_value("TESTCASE") + config["is_test_pfs"] = "yes" if testcase == "PFS" else "no" + config["empty_hist"] = "yes" if testcase == "PFS" else "no" + + config['blom_unit'] = blom_unit if blom_unit else "unset" + config['blom_vcoord'] = blom_vcoord + config["blom_river_nutrients"] = "yes" if blom_river_nutrients else "no" + config["blom_ndep_scenario"] = "ssp" if "ssp" in blom_ndep_scenario else blom_ndep_scenario + config["blom_n_deposition"] = "yes" if blom_n_deposition else "no" + config["blom_coupling"] = blom_coupling + config["blom_tracer_modules"] = blom_tracer_modules + + config["hamocc_vsls"] = "yes" if hamocc_vsls else "no" + config["hamocc_ciso"] = "yes" if hamocc_ciso else "no" + config["hamocc_sedspinup"] = "yes" if hamocc_sedspinup else "no" + config["hamocc_sedspinup_yr_start"] = hamocc_sedspinup_yr_start + config["hamocc_sedspinup_yr_end"] = hamocc_sedspinup_yr_end + config["hamocc_sedspinup_ncycle"] = hamocc_sedspinup_ncycle + + #---------------------------------------------------- + # initialize namelist defaults + #---------------------------------------------------- + nmlgen.init_defaults(infile, config) + + if nmlgen.get_value('swaclimfile') == 'UNSET': + nmlgen.set_value('swaclimfile', value="") + + if nmlgen.get_value('inid13c') == 'UNSET': + nmlgen.set_value('inid13c', value="") + + if nmlgen.get_value('inid14c') == 'UNSET': + nmlgen.set_value('inid14c', value="") + + run_startdate = case.get_value("RUN_STARTDATE") + idate = run_startdate.replace('-','') + nmlgen.set_value("idate", idate) + nmlgen.set_value("idate0", idate) + + #---------------------------------------------------- + # Write out namelist groups + #---------------------------------------------------- + groups=['limits','diffusion'] + + cwmtag = nmlgen.get_default('cwmtag', config=config) + if cwmtag[0] != 'unset': + groups.append('cwmod') + + groups.append('merdia') + groups.append('secdia') + groups.append('diaphy') + + if case.get_value("BLOM_VCOORD") == "cntiso_hybrid": + groups.append('vcoord') + + if "ecosys" in case.get_value("BLOM_TRACER_MODULES"): + groups.append("bgcnml") + groups.append("bgcoafx") + groups.append("diabgc") + + data_list_path = os.path.join(case.get_case_root(), "Buildconf", "blom.input_data_list") + if os.path.exists(data_list_path): + os.remove(data_list_path) + + # Create initial ocn_in + namelist_file = os.path.join(confdir, "ocn_in") + nmlgen.write_output_file(namelist_file, data_list_path, groups=groups, sorted_groups=False) + + # Replace MER_REGFLAG1 -> MER_REGFLAG4 with array syntax in ocn_in + from pathlib import Path + file = Path(namelist_file) + file.write_text(file.read_text().replace('mer_regflg1','mer_regflg(1,:)')) + file.write_text(file.read_text().replace('mer_regflg2','mer_regflg(2,:)')) + file.write_text(file.read_text().replace('mer_regflg3','mer_regflg(3,:)')) + file.write_text(file.read_text().replace('mer_regflg4','mer_regflg(4,:)')) + + # To compare with previous namelist generation, make namelist variable uppercase and + # use single quotes instead of back quotes and make sure that file variables set to UNSET + # get changed to blank quotes + namelist_file_temp = os.path.join(confdir, "ocn_in_temp") + with open(namelist_file, "r") as fread: + with open(namelist_file_temp, "w") as fwrite: + for line_read in fread: + # replace single quote with double quote to generate same namelist as using + # csh buildnml + line = line_read.replace('"',"'") + # make all namelists upper case to generate same namelist as using csh buildnml + tokens = line.split('=',maxsplit=1) + if len(tokens) == 2: + # Change UNSET values for files to lower case + if 'UNSET' in tokens[1]: + tokens[1] = "'unset'" + fwrite.write(f" {tokens[0].upper().strip()} = {tokens[1].strip()}\n") + else: + fwrite.write(line) + shutil.move(namelist_file_temp, namelist_file) + + # Copy ocn_in.readme to $RUNDIR + src_filename = os.path.join(srcroot,"components","blom","cime_config","ocn_in.readme") + dst_filename = os.path.join(rundir,"ocn_in.readme") + + if not os.path.exists(dst_filename): + shutil.copy(src_filename, dst_filename) + + logger.debug(f"blom: grid is {ocn_grid}") + +############################################################################### +def buildnml(case, caseroot, compname): +############################################################################### + """Build the blom namelist """ + + # Build the component namelist + if compname != "blom": + raise AttributeError + comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN") + srcroot = case.get_value("SRCROOT") + rundir = case.get_value("RUNDIR") + ninst = case.get_value("NINST_OCN") + + # determine the confdir directory + confdir = os.path.join(caseroot,"Buildconf","blomconf") + if not os.path.isdir(confdir): + os.makedirs(confdir) + + #---------------------------------------------------- + # Construct the namelist generator + #---------------------------------------------------- + # determine directory for user modified namelist_definitions.xml and namelist_defaults.xml + user_xml_dir = os.path.join(caseroot, "SourceMods", "src.blom") + expect (os.path.isdir(user_xml_dir), + "user_xml_dir %s does not exist " %user_xml_dir) + + # user definition *replaces* existing definition. + namelist_xml_dir = os.path.join(comp_root_dir_ocn, "cime_config") + definition_file = [os.path.join(namelist_xml_dir, "namelist_definition_blom.xml")] + user_definition = os.path.join(user_xml_dir, "namelist_definition_blom.xml") + if os.path.isfile(user_definition): + definition_file = [user_definition] + for file_ in definition_file: + expect(os.path.isfile(file_), "Namelist XML file %s not found!" % file_) + + # Create the namelist generator object - independent of instance + nmlgen = NamelistGenerator(case, definition_file) + + #---------------------------------------------------- + # Loop over instances + #---------------------------------------------------- + for inst_counter in range(1, ninst+1): + + # determine instance string + inst_string = "" + if ninst > 1: + inst_string = '_' + '%04d' % inst_counter + + # If multi-instance case does not have restart file, use + # single-case restart for each instance + rpointer = "rpointer.ice" + if (os.path.isfile(os.path.join(rundir,rpointer)) and + (not os.path.isfile(os.path.join(rundir,rpointer + inst_string)))): + shutil.copy(os.path.join(rundir, rpointer), + os.path.join(rundir, rpointer + inst_string)) + + inst_string_label = inst_string + if not inst_string_label: + inst_string_label = "\"\"" + + # create namelist_infile using user_nl_file as input + user_nl_file = os.path.join(caseroot, "user_nl_blom" + inst_string) + expect(os.path.isfile(user_nl_file), + "Missing required user_nl_file %s " %(user_nl_file)) + infile = os.path.join(confdir, "namelist_infile") + create_namelist_infile(case, user_nl_file, infile) + namelist_infile = [infile] + + # create namelist + _create_namelists(case, confdir, namelist_infile, nmlgen) + + # copy namelist files to rundir + if os.path.isdir(rundir): + file1 = os.path.join(confdir, "ocn_in") + file2 = os.path.join(rundir, "ocn_in") + if inst_string: + file2 += inst_string + logger.debug("BLOM namelist copy: file1 %s file2 %s " %(file1, file2)) + shutil.copy2(file1, file2) + +############################################################################### +def _main_func(): + + caseroot = parse_input(sys.argv) + with Case(caseroot, read_only=False) as case: + buildnml(case, caseroot, "blom") + +if __name__ == "__main__": + _main_func() diff --git a/cime_config/buildnml.csh b/cime_config/buildnml.csh new file mode 100644 index 00000000..46388741 --- /dev/null +++ b/cime_config/buildnml.csh @@ -0,0 +1,1636 @@ +#! /bin/csh -f + +#------------------------------------------------------------------------------ +# Get variables from Case XML-files +#------------------------------------------------------------------------------ + +set CASEROOT = `./xmlquery CASEROOT --value` +set OCN_GRID = `./xmlquery OCN_GRID --value` +set BLOM_VCOORD = `./xmlquery BLOM_VCOORD --value` +set BLOM_UNIT = `./xmlquery BLOM_UNIT --value` +set DIN_LOC_ROOT = `./xmlquery DIN_LOC_ROOT --value` +set RUN_TYPE = `./xmlquery RUN_TYPE --value` +set CONTINUE_RUN = `./xmlquery CONTINUE_RUN --value` +set CASEBUILD = `./xmlquery CASEBUILD --value` +set CCSM_CO2_PPMV = `./xmlquery CCSM_CO2_PPMV --value` +set OCN_NCPL = `./xmlquery OCN_NCPL --value` +set BLOM_COUPLING = `./xmlquery BLOM_COUPLING --value` +set RUNDIR = `./xmlquery RUNDIR --value` +set BLOM_TRACER_MODULES = `./xmlquery BLOM_TRACER_MODULES --value` +set BLOM_RIVER_NUTRIENTS = `./xmlquery BLOM_RIVER_NUTRIENTS --value` +set BLOM_N_DEPOSITION = `./xmlquery BLOM_N_DEPOSITION --value` +set BLOM_NDEP_SCENARIO = `./xmlquery BLOM_NDEP_SCENARIO --value` +set HAMOCC_VSLS = `./xmlquery HAMOCC_VSLS --value` +set HAMOCC_CISO = `./xmlquery HAMOCC_CISO --value` +set HAMOCC_SEDSPINUP = `./xmlquery HAMOCC_SEDSPINUP --value` +set HAMOCC_SEDSPINUP_YR_START = `./xmlquery HAMOCC_SEDSPINUP_YR_START --value` +set HAMOCC_SEDSPINUP_YR_END = `./xmlquery HAMOCC_SEDSPINUP_YR_END --value` +set HAMOCC_SEDSPINUP_NCYCLE = `./xmlquery HAMOCC_SEDSPINUP_NCYCLE --value` +set RUN_STARTDATE = `./xmlquery RUN_STARTDATE --value` +set PIO_TYPENAME_OCN = `./xmlquery PIO_TYPENAME_OCN --value` +set PIO_NETCDF_FORMAT_OCN = `./xmlquery PIO_NETCDF_FORMAT_OCN --value` +set NINST_OCN = `./xmlquery NINST_OCN --value` +set TEST=`./xmlquery TEST --value` + +#------------------------------------------------------------------------------ +# Check if HAMOCC is requested +#------------------------------------------------------------------------------ + +set ecosys = FALSE +set tracers = (`echo $BLOM_TRACER_MODULES`) +if ($#tracers != 0) then + foreach module ($tracers) + if ($module == ecosys) then + set ecosys = TRUE + endif + end +endif + +#------------------------------------------------------------------------------ +# Set RUN_TYPE to 'continue' if CONTINUE_RUN equals TRUE +#------------------------------------------------------------------------------ + +if ("$CONTINUE_RUN" == TRUE) then + set RUN_TYPE = continue +endif + +#------------------------------------------------------------------------------ +# Get start date +#------------------------------------------------------------------------------ + +set YEAR0 = `echo $RUN_STARTDATE | cut -c1-4 ` +set MONTH0 = `echo $RUN_STARTDATE | cut -c6-7 ` +set DAY0 = `echo $RUN_STARTDATE | cut -c9-10` + +#------------------------------------------------------------------------------ +# Set namelist variables +#------------------------------------------------------------------------------ + +#------------------------------ +# set LIMITS defaults +#------------------------------ +set NDAY1 = 0 +set NDAY2 = 0 +set IDATE = $YEAR0$MONTH0$DAY0 +set IDATE0 = $YEAR0$MONTH0$DAY0 +set RUNID = "'unset'" +set EXPCNF = "'cesm'" +set RUNTYP = "'$RUN_TYPE'" +set GRFILE = "'unset'" +set ICFILE = "'unset'" +if ("$BLOM_UNIT" == cgs) then + set PREF = 2000.e5 +else + set PREF = 2000.e4 +endif +set BACLIN = 1800. +set BATROP = 36. +if ("$BLOM_UNIT" == cgs) then + set MDV2HI = 2. + set MDV2LO = .4 + set MDV4HI = 0. + set MDV4LO = 0. + set MDC2HI = 5000.e4 + set MDC2LO = 300.e4 +else + set MDV2HI = .02 + set MDV2LO = .004 + set MDV4HI = 0. + set MDV4LO = 0. + set MDC2HI = 5000. + set MDC2LO = 300. +endif +set VSC2HI = .5 +set VSC2LO = .5 +set VSC4HI = 0. +set VSC4LO = 0. +if ("$BLOM_UNIT" == cgs) then + set CBAR = 5. +else + set CBAR = .05 +endif +set CB = .002 +set CWBDTS = 5.e-5 +set CWBDLS = 25. +set MOMMTH = "'enscon'" +set BMCMTH = "'uc'" +set RMPMTH = "'eitvel'" +set MLRTTP = "'constant'" +set RM0 = 1.2 +set RM5 = 0. +set CE = .06 +set TDFILE = "'unset'" +set NIWGF = 0. +set NIWBF = .35 +set NIWLF = .5 +set SWAMTH = "'jerlov'" +set JWTYPE = 3 +set CHLOPT = "'climatology'" +set CCFILE = "'unset'" +set TRXDAY = 0. +set SRXDAY = 0. +set TRXDPT = 1. +set SRXDPT = 1. +set TRXLIM = 1.5 +set SRXLIM = .5 +set APTFLX = .false. +set APSFLX = .false. +set DITFLX = .false. +set DISFLX = .false. +set SRXBAL = .false. +set SCFILE = "'unset'" +set WAVSRC = "'none'" +set SMTFRC = .true. +set SPRFAC = .false. +set ATM_PATH = "'unset'" +set ITEST = 60 +set JTEST = 60 +set CNSVDI = .false. +set CSDIAG = .false. +set RSTFRQ = 1 +if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then + set RSTFMT = 1 +else + set RSTFMT = 0 +endif +set RSTCMP = 0 +if ("$PIO_TYPENAME_OCN" == pnetcdf) then + set IOTYPE = 1 +else + set IOTYPE = 0 +endif + +#------------------------------ +# set VCOORD defaults +#------------------------------ +set VCOORD_TYPE = "'$BLOM_VCOORD'" +set RECONSTRUCTION_METHOD = "'ppm'" +set DENSITY_LIMITING = "'monotonic'" +set TRACER_LIMITING = "'non_oscillatory'" +set VELOCITY_LIMITING = "'non_oscillatory'" +set DENSITY_PC_UPPER_BNDR = .false. +set DENSITY_PC_LOWER_BNDR = .false. +set TRACER_PC_UPPER_BNDR = .true. +set TRACER_PC_LOWER_BNDR = .false. +set VELOCITY_PC_UPPER_BNDR = .true. +set VELOCITY_PC_LOWER_BNDR = .false. +set DPMIN_SURFACE = 2.5 +set DPMIN_INFLATION_FACTOR = 1.08 +set DPMIN_INTERIOR = .1 +set DKTZU = 4 +set DKTZL = 1 + +#------------------------------ +# set DIFFUSION defaults +#------------------------------ +set EITMTH = "'gm'" +set EDRITP = "'large scale'" +set EDWMTH = "'smooth'" +set EDDF2D = .false. +set EDSPRS = .true. +set EGC = 0.85 +set EGGAM = 200. +if ("$BLOM_UNIT" == cgs) then + set EGLSMN = 4000.e2 + set EGMNDF = 100.e4 + set EGMXDF = 1500.e4 +else + set EGLSMN = 4000. + set EGMNDF = 100. + set EGMXDF = 1500. +endif +set EGIDFQ = 1. +set TBFILE = "'unset'" +set RHISCF = 0. +set EDANIS = .false. +set REDI3D = .false. +set RHSCTP = .false. +set RI0 = 1.2 +set BDMTYP = 2 +if ("$BLOM_UNIT" == cgs) then + set BDMC1 = 5.e-4 + set BDMC2 = .1 +else + set BDMC1 = 5.e-8 + set BDMC2 = 1.e-5 +endif +set TKEPF = .006 +set SMOBLD = .true. +set LNGMTP = "'none'" +if ("$BLOM_VCOORD" == isopyc_bulkml) then + set BDMLDP = .true. + set LTEDTP = "'layer'" +else + set BDMLDP = .false. + set LTEDTP = "'neutral'" +endif + +#------------------------------ +# set BGCNML defaults +#------------------------------ +set ATM_CO2 = "$CCSM_CO2_PPMV" +if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then + set DO_RIVINPT = .true. +else + set DO_RIVINPT = .false. +endif +if ("$BLOM_N_DEPOSITION" == TRUE) then + set DO_NDEP = .true. + if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx2v1) then + set NDEPFNAME = ndep_1850_CMIP6_tnx2v1_20180321.nc + else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx1v4) then + set NDEPFNAME = ndep_1850_CMIP6_tnx1v4_20171106.nc + else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx0.25v4) then + set NDEPFNAME = ndep_1850_CMIP6_tnx0.25v4_20190912.nc + else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx0.125v4) then + set NDEPFNAME = ndep_1850_CMIP6_tnx0.125v4_20221013.nc + else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx2v1) then + set NDEPFNAME = ndep_2000_CMIP6_tnx2v1_20200826.nc + else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx1v4) then + set NDEPFNAME = ndep_2000_CMIP6_tnx1v4_20200826.nc + else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx0.25v4) then + set NDEPFNAME = ndep_2000_CMIP6_tnx0.25v4_20200826.nc + else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx2v1) then + set NDEPFNAME = ndep_185001-201412_tnx2v1_20190702.nc + else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx1v4) then + set NDEPFNAME = ndep_185001-201412_tnx1v4_20180613.nc + else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx0.25v4) then + set NDEPFNAME = ndep_185001-201412_tnx0.25v4_20190705.nc + else if( `echo $BLOM_NDEP_SCENARIO | cut -c1-3` == ssp && "$OCN_GRID" == tnx1v4) then + set NDEPFNAME = ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc + else if( "$BLOM_NDEP_SCENARIO" == UNSET ) then + set DO_NDEP = .false. + set NDEPFNAME = "''" + endif +else + set DO_NDEP = .false. + set NDEPFNAME = "''" +endif +if ("$HAMOCC_SEDSPINUP" == TRUE) then + set DO_SEDSPINUP = .true. + set SEDSPIN_YR_S = $HAMOCC_SEDSPINUP_YR_START + set SEDSPIN_YR_E = $HAMOCC_SEDSPINUP_YR_END + set SEDSPIN_NCYC = $HAMOCC_SEDSPINUP_NCYCLE +else + set DO_SEDSPINUP = .false. + set SEDSPIN_YR_S = -1 + set SEDSPIN_YR_E = -1 + set SEDSPIN_NCYC = -1 +endif +# VSLS is currently only available for the tnx1v4 grid, since a climatlogy file for +# short wave radiation is needed. +if ("$HAMOCC_VSLS" == TRUE && "$OCN_GRID" != tnx1v4) then + echo "$0 ERROR: HAMOCC_VSLS == TRUE not possible with this grid resolution (no swa-climatology available) " + exit -1 +endif +# For the following options, there are currently no switches in Case-XML files. +# These options can be activated by expert users via user namelist. +set DO_OALK = .false. +set BGCOAFX_OALKSCEN = "''" +set BGCOAFX_OALKFILE = "''" +set BGCOAFX_ADDALK = 0.135 +set BGCOAFX_CDRMIP_LATMAX = 70.0 +set BGCOAFX_CDRMIP_LATMIN = -60.0 +set BGCOAFX_RAMP_START = 2025 +set BGCOAFX_RAMP_END = 2035 +set WITH_DMSPH = .false. +set PI_PH_FILE = "''" +set L_3DVARSEDPOR = .false. +set SEDPORFILE = "''" + + +#------------------------------ +# set DIAPHY defaults +#------------------------------ +set GLB_FNAMETAG = "'hd','hm','hy'" +set GLB_AVEPERIO = '1, 30, 365' +if ("$TEST" == TRUE) then + set GLB_FILEFREQ = '1, 30, 365' +else + set GLB_FILEFREQ = '30, 30, 365' +endif +set GLB_COMPFLAG = '0, 0, 0' +if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then + set GLB_NCFORMAT = '1, 1, 1' +else + set GLB_NCFORMAT = '0, 0, 0' +endif +set H2D_ABSWND = '0, 4, 0' +set H2D_ALB = '0, 0, 0' +set H2D_BTMSTR = '0, 4, 0' +set H2D_BRNFLX = '0, 4, 0' +set H2D_BRNPD = '0, 4, 0' +set H2D_DFL = '0, 0, 0' +set H2D_EVA = '0, 4, 0' +set H2D_FICE = '0, 4, 0' +set H2D_FMLTFZ = '0, 4, 0' +set H2D_HICE = '0, 0, 0' +set H2D_HMLTFZ = '0, 4, 0' +set H2D_HSNW = '0, 0, 0' +set H2D_IAGE = '0, 0, 0' +set H2D_IDKEDT = '0, 4, 0' +set H2D_LAMULT = '0, 4, 0' +set H2D_LASL = '0, 4, 0' +set H2D_LIP = '0, 4, 0' +set H2D_MAXMLD = '4, 4, 0' +set H2D_MLD = '0, 4, 0' +set H2D_MLTS = '4, 4, 0' +set H2D_MLTSMN = '0, 4, 0' +set H2D_MLTSMX = '0, 4, 0' +set H2D_MLTSSQ = '0, 4, 0' +set H2D_MTKEUS = '0, 4, 0' +set H2D_MTKENI = '0, 4, 0' +set H2D_MTKEBF = '0, 4, 0' +set H2D_MTKERS = '0, 4, 0' +set H2D_MTKEPE = '0, 4, 0' +set H2D_MTKEKE = '0, 4, 0' +set H2D_MTY = '0, 4, 0' +set H2D_NSF = '0, 4, 0' +set H2D_PBOT = '0, 4, 0' +set H2D_PSRF = '0, 4, 0' +set H2D_RFIFLX = '0, 4, 0' +set H2D_RNFFLX = '0, 4, 0' +set H2D_SALFLX = '0, 4, 0' +set H2D_SALRLX = '0, 4, 0' +set H2D_SBOT = '0, 4, 0' +set H2D_SEALV = '4, 4, 0' +set H2D_SLVSQ = '0, 4, 0' +set H2D_SFL = '0, 4, 0' +set H2D_SOP = '0, 4, 0' +set H2D_SIGMX = '0, 4, 0' +set H2D_SSS = '4, 4, 0' +set H2D_SSSSQ = '4, 4, 0' +set H2D_SST = '4, 4, 0' +set H2D_SSTSQ = '4, 4, 0' +set H2D_SURFLX = '0, 4, 0' +set H2D_SURRLX = '0, 4, 0' +set H2D_SWA = '0, 4, 0' +set H2D_T20D = '4, 4, 0' +set H2D_TAUX = '0, 4, 0' +set H2D_TAUY = '0, 4, 0' +set H2D_TBOT = '0, 4, 0' +set H2D_TICE = '0, 0, 0' +set H2D_TSRF = '0, 0, 0' +set H2D_UB = '0, 4, 0' +set H2D_UICE = '0, 0, 0' +set H2D_USTAR = '0, 4, 0' +set H2D_USTAR3 = '0, 4, 0' +set H2D_USTOKES = '0, 0, 0' +set H2D_VB = '0, 4, 0' +set H2D_VICE = '0, 0, 0' +set H2D_VSTOKES = '0, 0, 0' +set H2D_ZTX = '0, 4, 0' +set LYR_BFSQ = '0, 4, 0' +set LYR_DIFDIA = '0, 4, 0' +set LYR_DIFVMO = '0, 4, 0' +set LYR_DIFVHO = '0, 4, 0' +set LYR_DIFVSO = '0, 4, 0' +set LYR_DIFINT = '0, 4, 0' +set LYR_DIFISO = '0, 4, 0' +set LYR_DP = '0, 4, 0' +set LYR_DZ = '0, 4, 0' +set LYR_SALN = '0, 4, 0' +set LYR_TEMP = '0, 4, 0' +set LYR_TRC = '0, 0, 0' +set LYR_UFLX = '0, 4, 0' +set LYR_UTFLX = '0, 4, 0' +set LYR_USFLX = '0, 4, 0' +set LYR_UMFLTD = '0, 0, 4' +set LYR_UMFLSM = '0, 0, 4' +set LYR_UTFLTD = '0, 0, 4' +set LYR_UTFLSM = '0, 0, 4' +set LYR_UTFLLD = '0, 0, 4' +set LYR_USFLTD = '0, 0, 4' +set LYR_USFLSM = '0, 0, 4' +set LYR_USFLLD = '0, 0, 4' +set LYR_UVEL = '0, 4, 0' +set LYR_VFLX = '0, 4, 0' +set LYR_VTFLX = '0, 4, 0' +set LYR_VSFLX = '0, 4, 0' +set LYR_VMFLTD = '0, 0, 4' +set LYR_VMFLSM = '0, 0, 4' +set LYR_VTFLTD = '0, 0, 4' +set LYR_VTFLSM = '0, 0, 4' +set LYR_VTFLLD = '0, 0, 4' +set LYR_VSFLTD = '0, 0, 4' +set LYR_VSFLSM = '0, 0, 4' +set LYR_VSFLLD = '0, 0, 4' +set LYR_VVEL = '0, 4, 0' +set LYR_WFLX = '0, 4, 0' +set LYR_WFLX2 = '0, 4, 0' +set LYR_PV = '0, 4, 0' +set LYR_TKE = '0, 4, 0' +set LYR_GLS_PSI = '0, 4, 0' +set LYR_IDLAGE = '0, 4, 0' +set LVL_BFSQ = '0, 4, 0' +set LVL_DIFDIA = '0, 4, 0' +set LVL_DIFVMO = '0, 4, 0' +set LVL_DIFVHO = '0, 4, 0' +set LVL_DIFVSO = '0, 4, 0' +set LVL_DIFINT = '0, 4, 0' +set LVL_DIFISO = '0, 4, 0' +set LVL_DZ = '0, 4, 0' +set LVL_SALN = '0, 4, 0' +set LVL_TEMP = '0, 4, 0' +set LVL_TRC = '0, 0, 0' +set LVL_UFLX = '0, 4, 0' +set LVL_UTFLX = '0, 4, 0' +set LVL_USFLX = '0, 4, 0' +set LVL_UMFLTD = '0, 0, 4' +set LVL_UMFLSM = '0, 0, 4' +set LVL_UTFLTD = '0, 0, 4' +set LVL_UTFLSM = '0, 0, 4' +set LVL_UTFLLD = '0, 0, 4' +set LVL_USFLTD = '0, 0, 4' +set LVL_USFLSM = '0, 0, 4' +set LVL_USFLLD = '0, 0, 4' +set LVL_UVEL = '0, 4, 0' +set LVL_VFLX = '0, 4, 0' +set LVL_VTFLX = '0, 4, 0' +set LVL_VSFLX = '0, 4, 0' +set LVL_VMFLTD = '0, 0, 4' +set LVL_VMFLSM = '0, 0, 4' +set LVL_VTFLTD = '0, 0, 4' +set LVL_VTFLSM = '0, 0, 4' +set LVL_VTFLLD = '0, 0, 4' +set LVL_VSFLTD = '0, 0, 4' +set LVL_VSFLSM = '0, 0, 4' +set LVL_VSFLLD = '0, 0, 4' +set LVL_VVEL = '0, 4, 0' +set LVL_WFLX = '0, 4, 0' +set LVL_WFLX2 = '0, 4, 0' +set LVL_PV = '0, 4, 0' +set LVL_TKE = '0, 4, 0' +set LVL_GLS_PSI = '0, 4, 0' +set LVL_IDLAGE = '0, 4, 0' +set MSC_MMFLXL = '0, 4, 0' +set MSC_MMFLXD = '0, 4, 0' +set MSC_MMFTDL = '0, 4, 0' +set MSC_MMFSML = '0, 4, 0' +set MSC_MMFTDD = '0, 4, 0' +set MSC_MMFSMD = '0, 4, 0' +set MSC_MHFLX = '0, 4, 0' +set MSC_MHFTD = '0, 4, 0' +set MSC_MHFSM = '0, 4, 0' +set MSC_MHFLD = '0, 4, 0' +set MSC_MSFLX = '0, 4, 0' +set MSC_MSFTD = '0, 4, 0' +set MSC_MSFSM = '0, 4, 0' +set MSC_MSFLD = '0, 4, 0' +set MSC_VOLTR = '0, 4, 0' +set MSC_MASSGS = '0, 4, 0' +set MSC_VOLGS = '0, 4, 0' +set MSC_SALNGA = '0, 4, 0' +set MSC_TEMPGA = '0, 4, 0' +set MSC_SSSGA = '0, 4, 0' +set MSC_SSTGA = '0, 4, 0' + +#------------------------------ +# set DIABGC defaults +#------------------------------ +set BGC_FNAMETAG = "'hbgcd','hbgcm','hbgcy'" +set BGC_AVEPERIO = '1,30,365' +set BGC_FILEFREQ = '30,30,365' +if ("$TEST" == TRUE) then + set BGC_FILEFREQ = ' 1,30,365' +else + set BGC_FILEFREQ = '30,30,365' +endif +set BGC_COMPFLAG = '0, 0, 0' +if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then + set BGC_NCFORMAT = '1, 1, 1' +else + set BGC_NCFORMAT = '0, 0, 0' +endif +set BGC_INVENTORY = '0, 1, 0' +set SRF_PHOSPH = '0, 2, 2' +set SRF_OXYGEN = '0, 2, 2' +set SRF_IRON = '0, 2, 2' +set SRF_ANO3 = '0, 2, 2' +set SRF_ALKALI = '4, 2, 2' +set SRF_SILICA = '0, 2, 2' +set SRF_DIC = '4, 2, 2' +set SRF_PHYTO = '4, 2, 2' +set SRF_PH = '0, 2, 2' +set SRF_EXPORT = '0, 2, 2' +set SRF_EXPOSI = '0, 2, 2' +set SRF_EXPOCA = '0, 2, 2' +set SRF_KWCO2 = '0, 2, 2' +set SRF_KWCO2KHM = '0, 2, 2' +set SRF_CO2KH = '0, 2, 2' +set SRF_CO2KHM = '0, 2, 2' +set SRF_PCO2 = '0, 2, 2' +set SRF_PCO2M = '0, 2, 2' +set SRF_CO2FXD = '4, 2, 2' +set SRF_CO2FXU = '4, 2, 2' +set SRF_OXFLUX = '0, 2, 2' +set SRF_NIFLUX = '0, 2, 2' +set SRF_N2OFX = '0, 0, 2' +set SRF_DMSFLUX = '0, 2, 2' +set SRF_DMS = '0, 2, 2' +set SRF_DMSPROD = '0, 2, 2' +set SRF_DMS_BAC = '0, 2, 2' +set SRF_DMS_UV = '0, 2, 2' +set SRF_ATMCO2 = '0, 2, 2' +set SRF_ATMO2 = '0, 2, 2' +set SRF_ATMN2 = '0, 2, 2' +set SRF_NATDIC = '0, 2, 2' +set SRF_NATALKALI = '0, 2, 2' +set SRF_NATPH = '0, 2, 2' +set SRF_NATPCO2 = '0, 2, 2' +set SRF_NATCO2FX = '0, 2, 2' +set SRF_CO213FXD = '0, 2, 2' +set SRF_CO213FXU = '0, 2, 2' +set SRF_CO214FXD = '0, 2, 2' +set SRF_CO214FXU = '0, 2, 2' +set SRF_CFC11 = '0, 2, 2' +set SRF_CFC12 = '0, 2, 2' +set SRF_SF6 = '0, 2, 2' +set SRF_BROMO = '0, 2, 2' +set SRF_BROMOFX = '0, 2, 2' +set INT_BROMOPRO = '0, 2, 2' +set INT_BROMOUV = '0, 2, 2' +set INT_PHOSY = '4, 2, 2' +set INT_NFIX = '0, 2, 2' +set INT_DNIT = '0, 2, 2' +if ("$BLOM_N_DEPOSITION" == TRUE) then +set FLX_NDEP = '0, 2, 2' +else +set FLX_NDEP = '0, 0, 0' +endif +set FLX_OALK = '0, 0, 0' +set FLX_CAR0100 = '0, 2, 2' +set FLX_CAR0500 = '0, 2, 2' +set FLX_CAR1000 = '0, 2, 2' +set FLX_CAR2000 = '0, 2, 2' +set FLX_CAR4000 = '0, 2, 2' +set FLX_CAR_BOT = '0, 2, 2' +set FLX_BSI0100 = '0, 2, 2' +set FLX_BSI0500 = '0, 2, 2' +set FLX_BSI1000 = '0, 2, 2' +set FLX_BSI2000 = '0, 2, 2' +set FLX_BSI4000 = '0, 2, 2' +set FLX_BSI_BOT = '0, 2, 2' +set FLX_CAL0100 = '0, 2, 2' +set FLX_CAL0500 = '0, 2, 2' +set FLX_CAL1000 = '0, 2, 2' +set FLX_CAL2000 = '0, 2, 2' +set FLX_CAL4000 = '0, 2, 2' +set FLX_CAL_BOT = '0, 2, 2' +set LYR_PHYTO = '0, 0, 2' +set LYR_GRAZER = '0, 0, 2' +set LYR_DOC = '0, 0, 2' +set LYR_PHOSY = '0, 0, 2' +set LYR_PHOSPH = '0, 0, 2' +set LYR_OXYGEN = '0, 0, 4' +set LYR_IRON = '0, 0, 2' +set LYR_ANO3 = '0, 0, 2' +set LYR_ALKALI = '0, 0, 2' +set LYR_SILICA = '0, 0, 2' +set LYR_DIC = '0, 0, 2' +set LYR_POC = '0, 0, 2' +set LYR_CALC = '0, 0, 2' +set LYR_OPAL = '0, 0, 2' +set LYR_CO3 = '0, 0, 2' +set LYR_N2O = '0, 0, 0' +set LYR_PH = '0, 0, 2' +set LYR_OMEGAC = '0, 0, 2' +set LYR_OMEGAA = '0, 0, 2' +set LYR_PREFO2 = '0, 0, 4' +set LYR_O2SAT = '0, 0, 4' +set LYR_PREFPO4 = '0, 0, 2' +set LYR_PREFALK = '0, 0, 2' +set LYR_PREFDIC = '0, 0, 2' +set LYR_DICSAT = '0, 0, 2' +set LYR_NATDIC = '0, 0, 2' +set LYR_NATALKALI = '0, 0, 2' +set LYR_NATCO3 = '0, 0, 2' +set LYR_NATCALC = '0, 0, 2' +set LYR_NATPH = '0, 0, 2' +set LYR_NATOMEGAC = '0, 0, 2' +set LYR_NATOMEGAA = '0, 0, 2' +set LYR_DIC13 = '0, 0, 2' +set LYR_DIC14 = '0, 0, 2' +set LYR_D13C = '0, 0, 2' +set LYR_D14C = '0, 0, 2' +set LYR_BIGD14C = '0, 0, 2' +set LYR_POC13 = '0, 0, 2' +set LYR_DOC13 = '0, 0, 2' +set LYR_CALC13 = '0, 0, 2' +set LYR_PHYTO13 = '0, 0, 2' +set LYR_GRAZER13 = '0, 0, 2' +set LYR_CFC11 = '0, 0, 2' +set LYR_CFC12 = '0, 0, 2' +set LYR_SF6 = '0, 0, 2' +set LYR_NOS = '0, 0, 2' +set LYR_WPHY = '0, 0, 2' +set LYR_WNOS = '0, 0, 2' +set LYR_EPS = '0, 0, 0' +set LYR_ASIZE = '0, 0, 0' +set LYR_BROMO = '0, 0, 2' +set BGC_DP = '0, 2, 2' +set LVL_PHYTO = '0, 2, 2' +set LVL_GRAZER = '0, 2, 2' +set LVL_DOC = '0, 2, 2' +set LVL_PHOSY = '0, 2, 2' +set LVL_PHOSPH = '0, 2, 2' +set LVL_OXYGEN = '0, 4, 4' +set LVL_IRON = '0, 2, 2' +set LVL_ANO3 = '0, 2, 2' +set LVL_ALKALI = '0, 2, 2' +set LVL_SILICA = '0, 2, 2' +set LVL_DIC = '0, 2, 2' +set LVL_POC = '0, 2, 2' +set LVL_CALC = '0, 2, 2' +set LVL_OPAL = '0, 2, 2' +set LVL_CO3 = '0, 2, 2' +set LVL_N2O = '0, 0, 2' +set LVL_PH = '0, 2, 2' +set LVL_OMEGAC = '0, 2, 2' +set LVL_OMEGAA = '0, 2, 2' +set LVL_PREFO2 = '0, 4, 4' +set LVL_O2SAT = '0, 4, 4' +set LVL_PREFPO4 = '0, 2, 2' +set LVL_PREFALK = '0, 2, 2' +set LVL_PREFDIC = '0, 2, 2' +set LVL_DICSAT = '0, 2, 2' +set LVL_NATDIC = '0, 2, 2' +set LVL_NATALKALI = '0, 2, 2' +set LVL_NATCO3 = '0, 2, 2' +set LVL_NATCALC = '0, 2, 2' +set LVL_NATPH = '0, 2, 2' +set LVL_NATOMEGAC = '0, 2, 2' +set LVL_NATOMEGAA = '0, 2, 2' +set LVL_DIC13 = '0, 2, 2' +set LVL_DIC14 = '0, 2, 2' +set LVL_D13C = '0, 2, 2' +set LVL_POC13 = '0, 2, 2' +set LVL_DOC13 = '0, 2, 2' +set LVL_CALC13 = '0, 2, 2' +set LVL_PHYTO13 = '0, 2, 2' +set LVL_GRAZER13 = '0, 2, 2' +set LVL_CFC11 = '0, 2, 2' +set LVL_CFC12 = '0, 2, 2' +set LVL_SF6 = '0, 2, 2' +set LVL_NOS = '0, 2, 2' +set LVL_WPHY = '0, 2, 2' +set LVL_WNOS = '0, 2, 2' +set LVL_EPS = '0, 0, 0' +set LVL_ASIZE = '0, 0, 0' +set LVL_BROMO = '0, 2, 2' +set FLX_SEDIFFIC = '0, 0, 2' +set FLX_SEDIFFAL = '0, 0, 2' +set FLX_SEDIFFPH = '0, 0, 2' +set FLX_SEDIFFOX = '0, 0, 2' +set FLX_SEDIFFN2 = '0, 0, 2' +set FLX_SEDIFFNO3 = '0, 0, 2' +set FLX_SEDIFFSI = '0, 0, 2' +set SDM_POWAIC = '0, 0, 2' +set SDM_POWAAL = '0, 0, 2' +set SDM_POWAPH = '0, 0, 2' +set SDM_POWAOX = '0, 0, 2' +set SDM_POWN2 = '0, 0, 2' +set SDM_POWNO3 = '0, 0, 2' +set SDM_POWASI = '0, 0, 2' +set SDM_SSSO12 = '0, 0, 2' +set SDM_SSSSIL = '0, 0, 2' +set SDM_SSSC12 = '0, 0, 2' +set SDM_SSSTER = '0, 0, 2' +set BUR_SSSO12 = '0, 0, 2' +set BUR_SSSSIL = '0, 0, 2' +set BUR_SSSC12 = '0, 0, 2' +set BUR_SSSTER = '0, 0, 2' + +# if partial coupling, enable SSS relaxation +if ("$BLOM_COUPLING" =~ *partial*) then + if ("$BLOM_VCOORD" == isopyc_bulkml) then + set SRXDAY = 6. + else + set SRXDAY = 60. + set SRXDPT = 10. + endif + set SPRFAC = .true. + set SRXBAL = .true. +endif + +# set grid dependent parameters +if ("$OCN_GRID" == gx1v5 || "$OCN_GRID" == gx1v6) then + set BACLIN = 1800. + set BATROP = 36. +else if ("$OCN_GRID" == gx3v7) then + set BACLIN = 3600. + set BATROP = 72. +else if ("$OCN_GRID" == tnx2v1 ) then + set BACLIN = 4800. + set BATROP = 96. + set EGC = 0.5 + if ("$BLOM_UNIT" == cgs) then + set EGMXDF = 1000.e4 + else + set EGMXDF = 1000. + endif + set CWMTAG = "'Gibraltar','Gibraltar'" + set CWMEDG = " 'u', 'u'" + set CWMI = " 53, 54" + set CWMJ = " 137, 137" + set CWMWTH = " 30.e3, 30.e3" +else if ("$OCN_GRID" == tnx1.5v1 ) then + set BACLIN = 4800. + set BATROP = 96. + set EGC = 0.5 + if ("$BLOM_UNIT" == cgs) then + set EGMXDF = 1000.e4 + else + set EGMXDF = 1000. + endif +else if ("$OCN_GRID" == tnx1v1 || "$OCN_GRID" == tnx1v3 || "$OCN_GRID" == tnx1v4) then + if ("$OCN_NCPL" == 24) then + set BACLIN = 3600. + set BATROP = 60. + set CWBDTS = .75e-4 + set NIWGF = .4 + set SMTFRC = .false. + if ("$BLOM_VCOORD" == isopyc_bulkml) then + set CE = .5 + endif + else + set BACLIN = 3200. + set BATROP = 64. + endif + set CWMTAG = "'Gibraltar','Gibraltar'" + set CWMEDG = " 'u', 'u'" + set CWMI = " 105, 106" + set CWMJ = " 273, 273" + set CWMWTH = " 30.e3, 30.e3" +else if ("$OCN_GRID" == tnx0.25v1 || "$OCN_GRID" == tnx0.25v3 || "$OCN_GRID" == tnx0.25v4) then + set BACLIN = 900. + set BATROP = 15. + if ("$BLOM_UNIT" == cgs) then + set MDV2HI = .15 + set MDV2LO = .15 + set MDV4HI = 0. + set MDV4LO = 0. + set MDC2HI = 300.e4 + set MDC2LO = 300.e4 + else + set MDV2HI = .0015 + set MDV2LO = .0015 + set MDV4HI = 0. + set MDV4LO = 0. + set MDC2HI = 300. + set MDC2LO = 300. + endif + set VSC2HI = .15 + set VSC2LO = .15 + set VSC4HI = 0.0625 + set VSC4LO = 0.0625 + set CWBDTS = 0.75e-4 + set CWBDLS = 25. + set EDWMTH = "'step'" + set EGC = 0.85 + if ("$BLOM_UNIT" == cgs) then + set EGMXDF = 1500.e4 + else + set EGMXDF = 1500. + endif + if ("$BLOM_VCOORD" == isopyc_bulkml) then + set CE = 1.0 + endif +else if ("$OCN_GRID" == tnx0.125v4) then + set BACLIN = 300. + set BATROP = 6. + set EGMNDF = 0. + set EGMXDF = 0. + set EDWMTH = "'step'" + set CWBDTS = .75e-4 + set CWBDLS = 25 + if ("$BLOM_UNIT" == cgs) then + set MDV2HI = .1 + set MDV2LO = .1 + set MDV4HI = 0. + set MDV4LO = 0. + set MDC2HI = 300.e4 + set MDC2LO = 100.e4 + else + set MDV2HI = .001 + set MDV2LO = .001 + set MDV4HI = 0. + set MDV4LO = 0. + set MDC2HI = 300. + set MDC2LO = 100. + endif + set VSC2HI = 0. + set VSC2LO = 0. + set VSC4HI = .06 + set VSC4LO = .06 + set LTEDTP = "'layer'" +else + echo "OCN_GRID is $OCN_GRID \n" + echo "$0 ERROR: Cannot deal with GRID equal to $OCN_GRID " + exit -1 +endif + +# set grid independent input files (iHAMOCC initial conditions) +set INIDIC = "'$DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_Ct_preind_OMIPinit_20171107.nc'" +set INIALK = "'$DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_At_OMIPinit_20171107.nc'" +set INIPO4 = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_phosphate_OMIPinit_20171107.nc'" +set INIOXY = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_oxygen_OMIPinit_20171107.nc'" +set ININO3 = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_nitrate_OMIPinit_20171107.nc'" +set INISIL = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_silicate_OMIPinit_20171107.nc'" +if ("$HAMOCC_CISO" == TRUE) then +set INID13C = "'$DIN_LOC_ROOT/ocn/blom/inicon/d13C_permil_20180609.nc'" +set INID14C = "'$DIN_LOC_ROOT/ocn/blom/inicon/d14C_permil_20180609.nc'" +else +set INID13C = "''" +set INID14C = "''" +endif + +# set grid dependent input files +if ("$OCN_GRID" == tnx2v1) then + set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx2v1_20130206.nc'" + set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx2v1_20130419.nc'" + set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx2v1_20130419.nc'" + set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx2v1_20190826.nc'" + set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx2v1_20190826.dat'" + set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx2v1_20190826.dat'" + set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx2v1_20130927.nc'" + set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx2v1_20130506.nc'" + set SWACLIMFILE = "''" + set SEDPORFILE = "''" + if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then + set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx2v1_20170915.nc'" + else + set RIVINFILE = "''" + endif + if ("$BLOM_N_DEPOSITION" == TRUE) then + set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" + else + set NDEPFILE = "''" + endif +else if ("$OCN_GRID" == tnx1v4) then + set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx1v4_20170622.nc'" + set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx1v4_20170622.nc'" + set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx1v4_20170605.nc'" + set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx1v4_20190729.nc'" + set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx1v4_20190615.dat'" + set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx1v4_20190611.dat'" + set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx1v4_20170608.nc'" + set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx1v4_20170604.nc'" + set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx1v4_20171107.nc'" + set SEDPORFILE = "''" + if ("$HAMOCC_VSLS" == TRUE) then + set SWACLIMFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc'" + else + set SWACLIMFILE = "''" + endif + if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then + set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx1v4_20170820.nc'" + else + set RIVINFILE = "''" + endif + if ("$BLOM_N_DEPOSITION" == TRUE) then + set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" + else + set NDEPFILE = "''" + endif +else if ("$OCN_GRID" == tnx0.25v4) then + set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.25v4_20170622.nc'" + set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.25v4_20170623.nc'" + set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.25v4_20170626.nc'" + set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.25v4_20190612.nc'" + set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat'" + set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.25v4_20190612.dat'" + set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.25v4_20170623.nc'" + set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.25v4_20170623.nc'" + set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.25v4_20181004.nc'" + set SWACLIMFILE = "''" + set SEDPORFILE = "''" + if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then + set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.25v4_20170821.nc'" + else + set RIVINFILE = "''" + endif + if ("$BLOM_N_DEPOSITION" == TRUE) then + set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" + else + set NDEPFILE = "''" + endif +else if ("$OCN_GRID" == tnx0.125v4) then + set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.125v4_20221013.nc'" + set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.125v4_20230318.nc'" + set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.125v4_20221013.nc'" + set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.125v4_20221013.nc'" + set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat'" + set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.125v4_20221013.dat'" + set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.125v4_20221013.nc'" + set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20221013.nc'" + set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.125v4_20221013.nc'" + set SWACLIMFILE = "''" + set SEDPORFILE = "''" + if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then + set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.125v4_20221013.nc'" + else + set RIVINFILE = "''" + endif + if ("$BLOM_N_DEPOSITION" == TRUE) then + set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" + else + set NDEPFILE = "''" + endif +else + echo "$0 ERROR: Cannot deal with GRID = $OCN_GRID " + exit -1 +endif + + +#------------------------------------------------------------------------------ +# Create resolved namelist +#------------------------------------------------------------------------------ +foreach mem ("`seq $NINST_OCN`") + if ( ${NINST_OCN} == '1' ) then + set inststr = '' + else + set inststr = ("`printf '_%4.4d' $mem`") + endif + + # modify namelist variables as specified in user_nl_blom + foreach line ("`grep = $CASEROOT/user_nl_blom$inststr`") + if (`echo "$line" | tr -d ' ' | cut -c -1` != '#') then + set var = `echo "$line" | sed 's/=.*//' | tr '[a-z]' '[A-Z]'` + set val = `echo "$line" | sed 's/.*=//'` + eval 'set $var = "$val"' + endif + end + +cp ocn_in.readme $RUNDIR/. + +cat >! $RUNDIR/ocn_in$inststr << EOF +&LIMITS + NDAY1 = $NDAY1 + NDAY2 = $NDAY2 + IDATE = $IDATE + IDATE0 = $IDATE0 + RUNID = $RUNID + EXPCNF = $EXPCNF + RUNTYP = $RUNTYP + GRFILE = $GRFILE + ICFILE = $ICFILE + PREF = $PREF + BACLIN = $BACLIN + BATROP = $BATROP + MDV2HI = $MDV2HI + MDV2LO = $MDV2LO + MDV4HI = $MDV4HI + MDV4LO = $MDV4LO + MDC2HI = $MDC2HI + MDC2LO = $MDC2LO + VSC2HI = $VSC2HI + VSC2LO = $VSC2LO + VSC4HI = $VSC4HI + VSC4LO = $VSC4LO + CBAR = $CBAR + CB = $CB + CWBDTS = $CWBDTS + CWBDLS = $CWBDLS + MOMMTH = $MOMMTH + BMCMTH = $BMCMTH + RMPMTH = $RMPMTH + MLRTTP = $MLRTTP + RM0 = $RM0 + RM5 = $RM5 + CE = $CE + TDFILE = $TDFILE + NIWGF = $NIWGF + NIWBF = $NIWBF + NIWLF = $NIWLF + SWAMTH = $SWAMTH + JWTYPE = $JWTYPE + CHLOPT = $CHLOPT + CCFILE = $CCFILE + TRXDAY = $TRXDAY + SRXDAY = $SRXDAY + TRXDPT = $TRXDPT + SRXDPT = $SRXDPT + TRXLIM = $TRXLIM + SRXLIM = $SRXLIM + APTFLX = $APTFLX + APSFLX = $APSFLX + DITFLX = $DITFLX + DISFLX = $DISFLX + SRXBAL = $SRXBAL + SCFILE = $SCFILE + WAVSRC = $WAVSRC + SMTFRC = $SMTFRC + SPRFAC = $SPRFAC + ATM_PATH = $ATM_PATH + ITEST = $ITEST + JTEST = $JTEST + CNSVDI = $CNSVDI + CSDIAG = $CSDIAG + RSTFRQ = $RSTFRQ + RSTFMT = $RSTFMT + RSTCMP = $RSTCMP + IOTYPE = $IOTYPE +/ +EOF + +if ("$BLOM_VCOORD" == cntiso_hybrid) then +cat >>! $RUNDIR/ocn_in$inststr << EOF + +&VCOORD + VCOORD_TYPE = $VCOORD_TYPE + RECONSTRUCTION_METHOD = $RECONSTRUCTION_METHOD + DENSITY_LIMITING = $DENSITY_LIMITING + TRACER_LIMITING = $TRACER_LIMITING + VELOCITY_LIMITING = $VELOCITY_LIMITING + DENSITY_PC_UPPER_BNDR = $DENSITY_PC_UPPER_BNDR + DENSITY_PC_LOWER_BNDR = $DENSITY_PC_LOWER_BNDR + TRACER_PC_UPPER_BNDR = $TRACER_PC_UPPER_BNDR + TRACER_PC_LOWER_BNDR = $TRACER_PC_LOWER_BNDR + VELOCITY_PC_UPPER_BNDR = $VELOCITY_PC_UPPER_BNDR + VELOCITY_PC_LOWER_BNDR = $VELOCITY_PC_LOWER_BNDR + DPMIN_SURFACE = $DPMIN_SURFACE + DPMIN_INFLATION_FACTOR = $DPMIN_INFLATION_FACTOR + DPMIN_INTERIOR = $DPMIN_INTERIOR + DKTZU = $DKTZU + DKTZL = $DKTZL +/ +EOF +endif + +cat >>! $RUNDIR/ocn_in$inststr << EOF + +&DIFFUSION + EITMTH = $EITMTH + EDRITP = $EDRITP + EDWMTH = $EDWMTH + EDDF2D = $EDDF2D + EDSPRS = $EDSPRS + EGC = $EGC + EGGAM = $EGGAM + EGLSMN = $EGLSMN + EGMNDF = $EGMNDF + EGMXDF = $EGMXDF + EGIDFQ = $EGIDFQ + TBFILE = $TBFILE + RHISCF = $RHISCF + EDANIS = $EDANIS + REDI3D = $REDI3D + RHSCTP = $RHSCTP + RI0 = $RI0 + BDMTYP = $BDMTYP + BDMC1 = $BDMC1 + BDMC2 = $BDMC2 + BDMLDP = $BDMLDP + TKEPF = $TKEPF + SMOBLD = $SMOBLD + LNGMTP = $LNGMTP + LTEDTP = $LTEDTP +/ +EOF + +if ($?CWMTAG) then +cat >>! $RUNDIR/ocn_in$inststr << EOF + +&CWMOD + CWMTAG = $CWMTAG + CWMEDG = $CWMEDG + CWMI = $CWMI + CWMJ = $CWMJ + CWMWTH = $CWMWTH +/ +EOF +endif + +cat >>! $RUNDIR/ocn_in$inststr << EOF + +&MERDIA + MER_ORFILE = $MER_ORFILE + MER_MIFILE = $MER_MIFILE + MER_REGNAM = 'atlantic_arctic_ocean', 'atlantic_arctic_extended_ocean', 'indian_pacific_ocean', 'global_ocean' + MER_REGFLG(1,:) = 2, 4 + MER_REGFLG(2,:) = 2, 4, 6, 7, 8, 9 + MER_REGFLG(3,:) = 3, 5 + MER_REGFLG(4,:) = 0 + MER_MINLAT = -34., -34., -34., -90. + MER_MAXLAT = 90., 90., 90., 90. +/ + +&SECDIA + SEC_SIFILE = $SEC_SIFILE +/ + +&DIAPHY + GLB_FNAMETAG = $GLB_FNAMETAG + GLB_AVEPERIO = $GLB_AVEPERIO + GLB_FILEFREQ = $GLB_FILEFREQ + GLB_COMPFLAG = $GLB_COMPFLAG + GLB_NCFORMAT = $GLB_NCFORMAT + H2D_ABSWND = $H2D_ABSWND + H2D_ALB = $H2D_ALB + H2D_BTMSTR = $H2D_BTMSTR + H2D_BRNFLX = $H2D_BRNFLX + H2D_BRNPD = $H2D_BRNPD + H2D_DFL = $H2D_DFL + H2D_EVA = $H2D_EVA + H2D_FICE = $H2D_FICE + H2D_FMLTFZ = $H2D_FMLTFZ + H2D_HICE = $H2D_HICE + H2D_HMLTFZ = $H2D_HMLTFZ + H2D_HSNW = $H2D_HSNW + H2D_IAGE = $H2D_IAGE + H2D_IDKEDT = $H2D_IDKEDT + H2D_LAMULT = $H2D_LAMULT + H2D_LASL = $H2D_LASL + H2D_LIP = $H2D_LIP + H2D_MAXMLD = $H2D_MAXMLD + H2D_MLD = $H2D_MLD + H2D_MLTS = $H2D_MLTS + H2D_MLTSMN = $H2D_MLTSMN + H2D_MLTSMX = $H2D_MLTSMX + H2D_MLTSSQ = $H2D_MLTSSQ + H2D_MTKEUS = $H2D_MTKEUS + H2D_MTKENI = $H2D_MTKENI + H2D_MTKEBF = $H2D_MTKEBF + H2D_MTKERS = $H2D_MTKERS + H2D_MTKEPE = $H2D_MTKEPE + H2D_MTKEKE = $H2D_MTKEKE + H2D_MTY = $H2D_MTY + H2D_NSF = $H2D_NSF + H2D_PBOT = $H2D_PBOT + H2D_PSRF = $H2D_PSRF + H2D_RFIFLX = $H2D_RFIFLX + H2D_RNFFLX = $H2D_RNFFLX + H2D_SALFLX = $H2D_SALFLX + H2D_SALRLX = $H2D_SALRLX + H2D_SBOT = $H2D_SBOT + H2D_SEALV = $H2D_SEALV + H2D_SLVSQ = $H2D_SLVSQ + H2D_SFL = $H2D_SFL + H2D_SOP = $H2D_SOP + H2D_SIGMX = $H2D_SIGMX + H2D_SSS = $H2D_SSS + H2D_SSSSQ = $H2D_SSSSQ + H2D_SST = $H2D_SST + H2D_SSTSQ = $H2D_SSTSQ + H2D_SURFLX = $H2D_SURFLX + H2D_SURRLX = $H2D_SURRLX + H2D_SWA = $H2D_SWA + H2D_T20D = $H2D_T20D + H2D_TAUX = $H2D_TAUX + H2D_TAUY = $H2D_TAUY + H2D_TBOT = $H2D_TBOT + H2D_TICE = $H2D_TICE + H2D_TSRF = $H2D_TSRF + H2D_UB = $H2D_UB + H2D_UICE = $H2D_UICE + H2D_USTAR = $H2D_USTAR + H2D_USTAR3 = $H2D_USTAR3 + H2D_USTOKES = $H2D_USTOKES + H2D_VB = $H2D_VB + H2D_VICE = $H2D_VICE + H2D_VSTOKES = $H2D_VSTOKES + H2D_ZTX = $H2D_ZTX + LYR_BFSQ = $LYR_BFSQ + LYR_DIFDIA = $LYR_DIFDIA + LYR_DIFVMO = $LYR_DIFVMO + LYR_DIFVHO = $LYR_DIFVHO + LYR_DIFVSO = $LYR_DIFVSO + LYR_DIFINT = $LYR_DIFINT + LYR_DIFISO = $LYR_DIFISO + LYR_DP = $LYR_DP + LYR_DZ = $LYR_DZ + LYR_SALN = $LYR_SALN + LYR_TEMP = $LYR_TEMP + LYR_TRC = $LYR_TRC + LYR_UFLX = $LYR_UFLX + LYR_UTFLX = $LYR_UTFLX + LYR_USFLX = $LYR_USFLX + LYR_UMFLTD = $LYR_UMFLTD + LYR_UMFLSM = $LYR_UMFLSM + LYR_UTFLTD = $LYR_UTFLTD + LYR_UTFLSM = $LYR_UTFLSM + LYR_UTFLLD = $LYR_UTFLLD + LYR_USFLTD = $LYR_USFLTD + LYR_USFLSM = $LYR_USFLSM + LYR_USFLLD = $LYR_USFLLD + LYR_UVEL = $LYR_UVEL + LYR_VFLX = $LYR_VFLX + LYR_VTFLX = $LYR_VTFLX + LYR_VSFLX = $LYR_VSFLX + LYR_VMFLTD = $LYR_VMFLTD + LYR_VMFLSM = $LYR_VMFLSM + LYR_VTFLTD = $LYR_VTFLTD + LYR_VTFLSM = $LYR_VTFLSM + LYR_VTFLLD = $LYR_VTFLLD + LYR_VSFLTD = $LYR_VSFLTD + LYR_VSFLSM = $LYR_VSFLSM + LYR_VSFLLD = $LYR_VSFLLD + LYR_VVEL = $LYR_VVEL + LYR_WFLX = $LYR_WFLX + LYR_WFLX2 = $LYR_WFLX2 + LYR_PV = $LYR_PV + LYR_TKE = $LYR_TKE + LYR_GLS_PSI = $LYR_GLS_PSI + LYR_IDLAGE = $LYR_IDLAGE + LVL_BFSQ = $LVL_BFSQ + LVL_DIFDIA = $LVL_DIFDIA + LVL_DIFVMO = $LVL_DIFVMO + LVL_DIFVHO = $LVL_DIFVHO + LVL_DIFVSO = $LVL_DIFVSO + LVL_DIFINT = $LVL_DIFINT + LVL_DIFISO = $LVL_DIFISO + LVL_DZ = $LVL_DZ + LVL_SALN = $LVL_SALN + LVL_TEMP = $LVL_TEMP + LVL_TRC = $LVL_TRC + LVL_UFLX = $LVL_UFLX + LVL_UTFLX = $LVL_UTFLX + LVL_USFLX = $LVL_USFLX + LVL_UMFLTD = $LVL_UMFLTD + LVL_UMFLSM = $LVL_UMFLSM + LVL_UTFLTD = $LVL_UTFLTD + LVL_UTFLSM = $LVL_UTFLSM + LVL_UTFLLD = $LVL_UTFLLD + LVL_USFLTD = $LVL_USFLTD + LVL_USFLSM = $LVL_USFLSM + LVL_USFLLD = $LVL_USFLLD + LVL_UVEL = $LVL_UVEL + LVL_VFLX = $LVL_VFLX + LVL_VTFLX = $LVL_VTFLX + LVL_VSFLX = $LVL_VSFLX + LVL_VMFLTD = $LVL_VMFLTD + LVL_VMFLSM = $LVL_VMFLSM + LVL_VTFLTD = $LVL_VTFLTD + LVL_VTFLSM = $LVL_VTFLSM + LVL_VTFLLD = $LVL_VTFLLD + LVL_VSFLTD = $LVL_VSFLTD + LVL_VSFLSM = $LVL_VSFLSM + LVL_VSFLLD = $LVL_VSFLLD + LVL_VVEL = $LVL_VVEL + LVL_WFLX = $LVL_WFLX + LVL_WFLX2 = $LVL_WFLX2 + LVL_PV = $LVL_PV + LVL_TKE = $LVL_TKE + LVL_GLS_PSI = $LVL_GLS_PSI + LVL_IDLAGE = $LVL_IDLAGE + MSC_MMFLXL = $MSC_MMFLXL + MSC_MMFLXD = $MSC_MMFLXD + MSC_MMFTDL = $MSC_MMFTDL + MSC_MMFSML = $MSC_MMFSML + MSC_MMFTDD = $MSC_MMFTDD + MSC_MMFSMD = $MSC_MMFSMD + MSC_MHFLX = $MSC_MHFLX + MSC_MHFTD = $MSC_MHFTD + MSC_MHFSM = $MSC_MHFSM + MSC_MHFLD = $MSC_MHFLD + MSC_MSFLX = $MSC_MSFLX + MSC_MSFTD = $MSC_MSFTD + MSC_MSFSM = $MSC_MSFSM + MSC_MSFLD = $MSC_MSFLD + MSC_VOLTR = $MSC_VOLTR + MSC_MASSGS = $MSC_MASSGS + MSC_VOLGS = $MSC_VOLGS + MSC_SALNGA = $MSC_SALNGA + MSC_TEMPGA = $MSC_TEMPGA + MSC_SSSGA = $MSC_SSSGA + MSC_SSTGA = $MSC_SSTGA +/ +EOF + +if ("$ecosys" == TRUE) then +cat >>! $RUNDIR/ocn_in$inststr << EOF + +&BGCNML + ATM_CO2 = $CCSM_CO2_PPMV + FEDEPFILE = $FEDEPFILE + SWACLIMFILE = $SWACLIMFILE + DO_RIVINPT = $DO_RIVINPT + RIVINFILE = $RIVINFILE + DO_NDEP = $DO_NDEP + NDEPFILE = $NDEPFILE + DO_OALK = $DO_OALK + DO_SEDSPINUP = $DO_SEDSPINUP + SEDSPIN_YR_S = $SEDSPIN_YR_S + SEDSPIN_YR_E = $SEDSPIN_YR_E + SEDSPIN_NCYC = $SEDSPIN_NCYC + INIDIC = $INIDIC + INIALK = $INIALK + INIPO4 = $INIPO4 + INIOXY = $INIOXY + ININO3 = $ININO3 + INISIL = $INISIL + INID13C = $INID13C + INID14C = $INID14C + WITH_DMSPH = $WITH_DMSPH + PI_PH_FILE = $PI_PH_FILE + L_3DVARSEDPOR = $L_3DVARSEDPOR + SEDPORFILE = $SEDPORFILE +/ + +&BGCOAFX + OALKSCEN = $BGCOAFX_OALKSCEN + OALKFILE = $BGCOAFX_OALKFILE + ADDALK = $BGCOAFX_ADDALK + CDRMIP_LATMAX = $BGCOAFX_CDRMIP_LATMAX + CDRMIP_LATMIN = $BGCOAFX_CDRMIP_LATMIN + RAMP_START = $BGCOAFX_RAMP_START + RAMP_END = $BGCOAFX_RAMP_END +/ + +&DIABGC + GLB_FNAMETAG = $BGC_FNAMETAG + GLB_AVEPERIO = $BGC_AVEPERIO + GLB_FILEFREQ = $BGC_FILEFREQ + GLB_COMPFLAG = $BGC_COMPFLAG + GLB_NCFORMAT = $BGC_NCFORMAT + GLB_INVENTORY = $BGC_INVENTORY + SRF_PHOSPH = $SRF_PHOSPH + SRF_OXYGEN = $SRF_OXYGEN + SRF_IRON = $SRF_IRON + SRF_ANO3 = $SRF_ANO3 + SRF_ALKALI = $SRF_ALKALI + SRF_SILICA = $SRF_SILICA + SRF_DIC = $SRF_DIC + SRF_PHYTO = $SRF_PHYTO + SRF_PH = $SRF_PH + SRF_EXPORT = $SRF_EXPORT + SRF_EXPOSI = $SRF_EXPOSI + SRF_EXPOCA = $SRF_EXPOCA + SRF_KWCO2 = $SRF_KWCO2 + SRF_KWCO2KHM = $SRF_KWCO2KHM + SRF_CO2KH = $SRF_CO2KH + SRF_CO2KHM = $SRF_CO2KHM + SRF_PCO2 = $SRF_PCO2 + SRF_PCO2M = $SRF_PCO2M + SRF_CO2FXD = $SRF_CO2FXD + SRF_CO2FXU = $SRF_CO2FXU + SRF_OXFLUX = $SRF_OXFLUX + SRF_NIFLUX = $SRF_NIFLUX + SRF_N2OFX = $SRF_N2OFX + SRF_DMSFLUX = $SRF_DMSFLUX + SRF_DMS = $SRF_DMS + SRF_DMSPROD = $SRF_DMSPROD + SRF_DMS_BAC = $SRF_DMS_BAC + SRF_DMS_UV = $SRF_DMS_UV + SRF_ATMCO2 = $SRF_ATMCO2 + SRF_ATMO2 = $SRF_ATMO2 + SRF_ATMN2 = $SRF_ATMN2 + SRF_NATDIC = $SRF_NATDIC + SRF_NATALKALI = $SRF_NATALKALI + SRF_NATPH = $SRF_NATPH + SRF_NATPCO2 = $SRF_NATPCO2 + SRF_NATCO2FX = $SRF_NATCO2FX + SRF_CO213FXD = $SRF_CO213FXD + SRF_CO213FXU = $SRF_CO213FXU + SRF_CO214FXD = $SRF_CO214FXD + SRF_CO214FXU = $SRF_CO214FXU + SRF_CFC11 = $SRF_CFC11 + SRF_CFC12 = $SRF_CFC12 + SRF_SF6 = $SRF_SF6 + SRF_BROMO = $SRF_BROMO + SRF_BROMOFX = $SRF_BROMOFX + INT_BROMOPRO = $INT_BROMOPRO + INT_BROMOUV = $INT_BROMOUV + INT_PHOSY = $INT_PHOSY + INT_NFIX = $INT_NFIX + INT_DNIT = $INT_DNIT + FLX_NDEP = $FLX_NDEP + FLX_OALK = $FLX_OALK + FLX_CAR0100 = $FLX_CAR0100 + FLX_CAR0500 = $FLX_CAR0500 + FLX_CAR1000 = $FLX_CAR1000 + FLX_CAR2000 = $FLX_CAR2000 + FLX_CAR4000 = $FLX_CAR4000 + FLX_CAR_BOT = $FLX_CAR_BOT + FLX_BSI0100 = $FLX_BSI0100 + FLX_BSI0500 = $FLX_BSI0500 + FLX_BSI1000 = $FLX_BSI1000 + FLX_BSI2000 = $FLX_BSI2000 + FLX_BSI4000 = $FLX_BSI4000 + FLX_BSI_BOT = $FLX_BSI_BOT + FLX_CAL0100 = $FLX_CAL0100 + FLX_CAL0500 = $FLX_CAL0500 + FLX_CAL1000 = $FLX_CAL1000 + FLX_CAL2000 = $FLX_CAL2000 + FLX_CAL4000 = $FLX_CAL4000 + FLX_CAL_BOT = $FLX_CAL_BOT + LYR_PHYTO = $LYR_PHYTO + LYR_GRAZER = $LYR_GRAZER + LYR_DOC = $LYR_DOC + LYR_PHOSY = $LYR_PHOSY + LYR_PHOSPH = $LYR_PHOSPH + LYR_OXYGEN = $LYR_OXYGEN + LYR_IRON = $LYR_IRON + LYR_ANO3 = $LYR_ANO3 + LYR_ALKALI = $LYR_ALKALI + LYR_SILICA = $LYR_SILICA + LYR_DIC = $LYR_DIC + LYR_POC = $LYR_POC + LYR_CALC = $LYR_CALC + LYR_OPAL = $LYR_OPAL + LYR_CO3 = $LYR_CO3 + LYR_N2O = $LYR_N2O + LYR_PH = $LYR_PH + LYR_OMEGAC = $LYR_OMEGAC + LYR_OMEGAA = $LYR_OMEGAA + LYR_PREFO2 = $LYR_PREFO2 + LYR_O2SAT = $LYR_O2SAT + LYR_PREFPO4 = $LYR_PREFPO4 + LYR_PREFALK = $LYR_PREFALK + LYR_PREFDIC = $LYR_PREFDIC + LYR_DICSAT = $LYR_DICSAT + LYR_NATDIC = $LYR_NATDIC + LYR_NATALKALI = $LYR_NATALKALI + LYR_NATCO3 = $LYR_NATCO3 + LYR_NATCALC = $LYR_NATCALC + LYR_NATPH = $LYR_NATPH + LYR_NATOMEGAC = $LYR_NATOMEGAC + LYR_NATOMEGAA = $LYR_NATOMEGAA + LYR_DIC13 = $LYR_DIC13 + LYR_DIC14 = $LYR_DIC14 + LYR_D13C = $LYR_D13C + LYR_D14C = $LYR_D14C + LYR_BIGD14C = $LYR_BIGD14C + LYR_POC13 = $LYR_POC13 + LYR_DOC13 = $LYR_DOC13 + LYR_CALC13 = $LYR_CALC13 + LYR_PHYTO13 = $LYR_PHYTO13 + LYR_GRAZER13 = $LYR_GRAZER13 + LYR_CFC11 = $LYR_CFC11 + LYR_CFC12 = $LYR_CFC12 + LYR_SF6 = $LYR_SF6 + LYR_NOS = $LYR_NOS + LYR_WPHY = $LYR_WPHY + LYR_WNOS = $LYR_WNOS + LYR_EPS = $LYR_EPS + LYR_ASIZE = $LYR_ASIZE + LYR_DP = $BGC_DP + LYR_BROMO = $LYR_BROMO + LVL_PHYTO = $LVL_PHYTO + LVL_GRAZER = $LVL_GRAZER + LVL_DOC = $LVL_DOC + LVL_PHOSY = $LVL_PHOSY + LVL_PHOSPH = $LVL_PHOSPH + LVL_OXYGEN = $LVL_OXYGEN + LVL_IRON = $LVL_IRON + LVL_ANO3 = $LVL_ANO3 + LVL_ALKALI = $LVL_ALKALI + LVL_SILICA = $LVL_SILICA + LVL_DIC = $LVL_DIC + LVL_POC = $LVL_POC + LVL_CALC = $LVL_CALC + LVL_OPAL = $LVL_OPAL + LVL_CO3 = $LVL_CO3 + LVL_N2O = $LVL_N2O + LVL_PH = $LVL_PH + LVL_OMEGAC = $LVL_OMEGAC + LVL_OMEGAA = $LVL_OMEGAA + LVL_PREFO2 = $LVL_PREFO2 + LVL_O2SAT = $LVL_O2SAT + LVL_PREFPO4 = $LVL_PREFPO4 + LVL_PREFALK = $LVL_PREFALK + LVL_PREFDIC = $LVL_PREFDIC + LVL_DICSAT = $LVL_DICSAT + LVL_NATDIC = $LVL_NATDIC + LVL_NATALKALI = $LVL_NATALKALI + LVL_NATCO3 = $LVL_NATCO3 + LVL_NATCALC = $LVL_NATCALC + LVL_NATPH = $LVL_NATPH + LVL_NATOMEGAC = $LVL_NATOMEGAC + LVL_NATOMEGAA = $LVL_NATOMEGAA + LVL_DIC13 = $LVL_DIC13 + LVL_DIC14 = $LVL_DIC14 + LVL_D13C = $LVL_D13C + LVL_POC13 = $LVL_POC13 + LVL_DOC13 = $LVL_DOC13 + LVL_CALC13 = $LVL_CALC13 + LVL_PHYTO13 = $LVL_PHYTO13 + LVL_GRAZER13 = $LVL_GRAZER13 + LVL_CFC11 = $LVL_CFC11 + LVL_CFC12 = $LVL_CFC12 + LVL_SF6 = $LVL_SF6 + LVL_NOS = $LVL_NOS + LVL_WPHY = $LVL_WPHY + LVL_WNOS = $LVL_WNOS + LVL_EPS = $LVL_EPS + LVL_ASIZE = $LVL_ASIZE + LVL_BROMO = $LVL_BROMO + FLX_SEDIFFIC = $FLX_SEDIFFIC + FLX_SEDIFFAL = $FLX_SEDIFFAL + FLX_SEDIFFPH = $FLX_SEDIFFPH + FLX_SEDIFFOX = $FLX_SEDIFFOX + FLX_SEDIFFN2 = $FLX_SEDIFFN2 + FLX_SEDIFFNO3 = $FLX_SEDIFFNO3 + FLX_SEDIFFSI = $FLX_SEDIFFSI + SDM_POWAIC = $SDM_POWAIC + SDM_POWAAL = $SDM_POWAAL + SDM_POWAPH = $SDM_POWAPH + SDM_POWAOX = $SDM_POWAOX + SDM_POWN2 = $SDM_POWN2 + SDM_POWNO3 = $SDM_POWNO3 + SDM_POWASI = $SDM_POWASI + SDM_SSSO12 = $SDM_SSSO12 + SDM_SSSSIL = $SDM_SSSSIL + SDM_SSSC12 = $SDM_SSSC12 + SDM_SSSTER = $SDM_SSSTER + BUR_SSSO12 = $BUR_SSSO12 + BUR_SSSSIL = $BUR_SSSSIL + BUR_SSSC12 = $BUR_SSSC12 + BUR_SSSTER = $BUR_SSSTER +/ +EOF +endif + +end ## foreach mem ("`seq $NINST_OCN`") + +#------------------------------------------------------------------------------ +# Generate blom.input_data_list +#------------------------------------------------------------------------------ + +cat > $CASEBUILD/blom.input_data_list << EOF +grid_file = `echo $GRFILE | tr -d '"' | tr -d "'"` +meridional_transport_index_file = `echo $MER_MIFILE | tr -d '"' | tr -d "'"` +meridional_transport_basin_file = `echo $MER_ORFILE | tr -d '"' | tr -d "'"` +section_index_file = `echo $SEC_SIFILE | tr -d '"' | tr -d "'"` +tidal_dissipation_file = `echo $TDFILE | tr -d '"' | tr -d "'"` +EOF +if ($SWAMTH == "'chlorophyll'") then +cat >> $CASEBUILD/blom.input_data_list << EOF +chlorophyll_concentration_file = `echo $CCFILE | tr -d '"' | tr -d "'"` +EOF +endif +if ($SRXDAY != "0.") then +cat >> $CASEBUILD/blom.input_data_list << EOF +sss_climatology_file = `echo $SCFILE | tr -d '"' | tr -d "'"` +EOF +endif + +# iHAMOCC boundary conditions +if ($ecosys == TRUE) then +cat >> $CASEBUILD/blom.input_data_list << EOF +dust_file = `echo $FEDEPFILE | tr -d '"' | tr -d "'"` +EOF + if ($BLOM_RIVER_NUTRIENTS == TRUE) then +cat >> $CASEBUILD/blom.input_data_list << EOF +river_file = `echo $RIVINFILE | tr -d '"' | tr -d "'"` +EOF + endif + if ($BLOM_N_DEPOSITION == TRUE) then +cat >> $CASEBUILD/blom.input_data_list << EOF +n_deposition_file = `echo $NDEPFILE | tr -d '"' | tr -d "'"` +EOF + endif + if ($BGCOAFX_OALKFILE != "''") then +cat >> $CASEBUILD/blom.input_data_list << EOF +oafx_file = `echo $BGCOAFX_OALKFILE | tr -d '"' | tr -d "'"` +EOF + endif + if ($HAMOCC_VSLS == TRUE) then +cat >> $CASEBUILD/blom.input_data_list << EOF +swa_clim_file = `echo $SWACLIMFILE | tr -d '"' | tr -d "'"` +EOF + endif + if ($L_3DVARSEDPOR == TRUE) then +cat >> $CASEBUILD/blom.input_data_list << EOF +sed_porosity_file = `echo $SEDPORFILE | tr -d '"' | tr -d "'"` +EOF + endif +endif + +# BLOM initial conditions +cat >> $CASEBUILD/blom.input_data_list << EOF +inicon_file = `echo $ICFILE | tr -d '"' | tr -d "'"` +EOF + + +# iHAMOCC initial conditions +if ($ecosys == TRUE) then +cat >> $CASEBUILD/blom.input_data_list << EOF +inidic_file = `echo $INIDIC | tr -d '"' | tr -d "'"` +inialk_file = `echo $INIALK | tr -d '"' | tr -d "'"` +inipo4_file = `echo $INIPO4 | tr -d '"' | tr -d "'"` +inioxy_file = `echo $INIOXY | tr -d '"' | tr -d "'"` +inino3_file = `echo $ININO3 | tr -d '"' | tr -d "'"` +inisil_file = `echo $INISIL | tr -d '"' | tr -d "'"` +EOF + if ($HAMOCC_CISO == TRUE) then +cat >> $CASEBUILD/blom.input_data_list << EOF +inic13_file = `echo $INID13C | tr -d '"' | tr -d "'"` +inic14_file = `echo $INID14C | tr -d '"' | tr -d "'"` +EOF + endif + if ($RUN_TYPE == startup) then + if ($ICFILE =~ *.blom.r.*) then +cat >> $CASEBUILD/blom.input_data_list << EOF +inicon_bgc_file = `echo $ICFILE | sed 's/.blom.r./.blom.rbgc./' | tr -d '"' | tr -d "'"` +EOF + else if ($ICFILE =~ *.micom.r.*) then +cat >> $CASEBUILD/blom.input_data_list << EOF +inicon_bgc_file = `echo $ICFILE | sed 's/.micom.r./.micom.rbgc./' | tr -d '"' | tr -d "'"` +EOF + endif + endif +endif + + diff --git a/cime_config/buildnml.py b/cime_config/buildnml.py deleted file mode 100644 index 27924f2e..00000000 --- a/cime_config/buildnml.py +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env python3 - -"""BLOM namelist creator -""" - -# Typically ignore this. -# pylint: disable=invalid-name - -# Disable these because this is our standard setup -# pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-position - -import os, shutil, sys, glob, filecmp, imp, re - -CIMEROOT = os.environ.get("CIMEROOT") -if CIMEROOT is None: - raise SystemExit("ERROR: must set CIMEROOT environment variable") -sys.path.append(os.path.join(CIMEROOT, "CIME", "Tools")) - -from standard_script_setup import * -from CIME.case import Case -from CIME.nmlgen import NamelistGenerator -from CIME.utils import expect -from CIME.utils import run_cmd_no_fail, expect -from CIME.utils import run_cmd -from CIME.buildnml import create_namelist_infile, parse_input - -import glob, shutil -logger = logging.getLogger(__name__) - -# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements -#################################################################################### -def _create_namelists(case, confdir, infile, nmlgen): -#################################################################################### - - """Write out the namelist for this component. - - Most arguments are the same as those for `NamelistGenerator`. - The `confdir` argument is used to specify the directory in which output files will be placed. - """ - - CASEROOT = case.get_value("CASEROOT") - OCN_GRID = case.get_value("OCN_GRID") - BLOM_VCOORD = case.get_value("BLOM_VCOORD") - BLOM_UNIT = case.get_value("BLOM_UNIT") - DIN_LOC_ROOT = case.get_value("DIN_LOC_ROOT") - RUN_TYPE = case.get_value("RUN_TYPE") - CONTINUE_RUN = case.get_value("CONTINUE_RUN") - CASEBUILD = case.get_value("CASEBUILD") - CCSM_CO2_PPMV = case.get_value("CCSM_CO2_PPMV") - OCN_NCPL = case.get_value("OCN_NCPL") - BLOM_COUPLING = case.get_value("BLOM_COUPLING") - RUNDIR = case.get_value("RUNDIR") - BLOM_TRACER_MODULES = case.get_value("BLOM_TRACER_MODULES") - BLOM_RIVER_NUTRIENTS = case.get_value("BLOM_RIVER_NUTRIENTS") - BLOM_N_DEPOSITION = case.get_value("BLOM_N_DEPOSITION") - BLOM_NDEP_SCENARIO = case.get_value("BLOM_NDEP_SCENARIO") - HAMOCC_VSLS = case.get_value("HAMOCC_VSLS") - HAMOCC_CISO = case.get_value("HAMOCC_CISO") - HAMOCC_SEDSPINUP = case.get_value("HAMOCC_SEDSPINUP") - HAMOCC_SEDSPINUP_YR_START = case.get_value("HAMOCC_SEDSPINUP_YR_START") - HAMOCC_SEDSPINUP_YR_END = case.get_value("HAMOCC_SEDSPINUP_YR_END") - HAMOCC_SEDSPINUP_NCYCLE = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") - RUN_STARTDATE = case.get_value("RUN_STARTDATE") - PIO_TYPENAME_OCN = case.get_value("PIO_TYPENAME_OCN") - PIO_NETCDF_FORMAT_OCN = case.get_value("PIO_NETCDF_FORMAT_OCN") - NINST_OCN = case.get_value("NINST_OCN") - TEST = case.get_value("TEST") - - config['ocn_comp'] = case.get_value("COMP_OCN") - - YEAR0 = `echo $RUN_STARTDATE | cut -c1-4 ` - MONTH0 = `echo $RUN_STARTDATE | cut -c6-7 ` - DAY0 = `echo $RUN_STARTDATE | cut -c9-10` - - #---------------------------------------------------- - # Initialize namelist defaults - #---------------------------------------------------- - nmlgen.init_defaults(infile, config) - - #---------------------------------------------------- - # Write out namelist groups - #---------------------------------------------------- - groups=['limit'] - - namelist_file = os.path.join(confdir, "ocn_in") - nmlgen.write_output_file(namelist_file, data_list_path, groups=groups, sorted_groups=False) - - #logger.debug("blom: grid is %s" %(hgrid)) - #logger.debug("blom: physics is %s "%phys) - -############################################################################### -def buildnml(case, caseroot, compname): -############################################################################### - """Build the blom namelist """ - - # Build the component namelist - if compname != "blom": - raise AttributeError - comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN") - srcroot = case.get_value("SRCROOT") - rundir = case.get_value("RUNDIR") - ninst = case.get_value("NINST_OCN") - - #---------------------------------------------------- - # Construct the namelist generator - #---------------------------------------------------- - # determine directory for user modified namelist_definitions.xml and namelist_defaults.xml - user_xml_dir = os.path.join(caseroot, "SourceMods", "src.blom") - expect (os.path.isdir(user_xml_dir), - "user_xml_dir %s does not exist " %user_xml_dir) - - # user definition *replaces* existing definition. - namelist_xml_dir = os.path.join(comp_root_dir_ocn, "cime_config") - definition_file = [os.path.join(namelist_xml_dir, "namelist_definition_blom.xml")] - user_definition = os.path.join(user_xml_dir, "namelist_definition_blom.xml") - if os.path.isfile(user_definition): - definition_file = [user_definition] - for file_ in definition_file: - expect(os.path.isfile(file_), "Namelist XML file %s not found!" % file_) - - # Create the namelist generator object - independent of instance - nmlgen = NamelistGenerator(case, definition_file) - - #---------------------------------------------------- - # Loop over instances - #---------------------------------------------------- - for inst_counter in range(1, ninst+1): - - # determine instance string - inst_string = "" - if ninst > 1: - inst_string = '_' + '%04d' % inst_counter - - # If multi-instance case does not have restart file, use - # single-case restart for each instance - rpointer = "rpointer.ice" - if (os.path.isfile(os.path.join(rundir,rpointer)) and - (not os.path.isfile(os.path.join(rundir,rpointer + inst_string)))): - shutil.copy(os.path.join(rundir, rpointer), - os.path.join(rundir, rpointer + inst_string)) - - inst_string_label = inst_string - if not inst_string_label: - inst_string_label = "\"\"" - - # create namelist_infile using user_nl_file as input - user_nl_file = os.path.join(caseroot, "user_nl_blom" + inst_string) - expect(os.path.isfile(user_nl_file), - "Missing required user_nl_file %s " %(user_nl_file)) - infile = os.path.join(confdir, "namelist_infile") - create_namelist_infile(case, user_nl_file, infile) - namelist_infile = [infile] - - # create namelist - _create_namelists(case, confdir, namelist_infile, nmlgen) - - # copy namelist files to rundir - if os.path.isdir(rundir): - file1 = os.path.join(confdir, "ice_in") - file2 = os.path.join(rundir, "ice_in") - if inst_string: - file2 += inst_string - logger.debug("BLOM namelist copy: file1 %s file2 %s " %(file1, file2)) - shutil.copy2(file1, file2) - -def _strip_comments(fh, token="!"): - ''' strip anything after token in each line of fh ''' - for line in fh: - s = line.split(token, 1)[0].strip() - if s: - yield s - - -############################################################################### -def _main_func(): - - caseroot = parse_input(sys.argv) - with Case(caseroot, read_only=False) as case: - buildnml(case, caseroot, "blom") - -if __name__ == "__main__": - _main_func() From 1a68264b225a90ab7b7c791a08d9ff50619b13d7 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 16 Jul 2023 12:05:03 +0200 Subject: [PATCH 03/33] updates for python namelist generation --- cime_config/namelist_definition_blom.xml | 2566 +++++++++++++++++++++- 1 file changed, 2540 insertions(+), 26 deletions(-) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index e237bb9d..43166294 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -5,29 +5,45 @@ + + + + + + + + + + + + + + + + integer limits @@ -103,8 +119,13 @@ limits limits - unset + UNSET + $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx2v1_20130206.nc + $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx1v4_20170622.nc + $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.25v4_20170622.nc + $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.125v4_20221013.nc + abs @@ -113,8 +134,13 @@ limits limits - unset + UNSET + $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx2v1_20130419.nc + $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx1v4_20170622.nc + $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.25v4_20170623.nc + $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.125v4_20230318.nc + abs @@ -135,6 +161,11 @@ limits 1800. + 3600. + 4800. + 4800. + 3200. + 3600. @@ -145,6 +176,12 @@ limits 36. + 72. + 96. + 96. + 64. + 900. + 60. @@ -371,8 +408,13 @@ limits limits - unset + UNSET + $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx2v1_20130419.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx1v4_20170605.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.25v4_20170626.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.125v4_20221013.nc + abs @@ -441,8 +483,12 @@ limits limits - unset + UNSET + $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx1v4_20170608.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.25v4_20170623.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.125v4_20221013.nc + abs @@ -561,8 +607,13 @@ limits limits - unset + UNSET + $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx2v1_20130927.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx1v4_20170604.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.25v4_20170623.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20221013.nc + abs @@ -688,4 +739,2467 @@ + + + + + + + + + + + + + char + vcoord + vcoord + + $BLOM_VCOORD + + + + + + char + vcoord + vcoord + + ppm + + + + + + char + vcoord + vcoord + + monotonic + + + + + + char + vcoord + vcoord + + non_oscillatory + + + + + + char + vcoord + vcoord + + non_oscillatory + + + + + + logical + vcoord + vcoord + + .false. + + + + + + logical + vcoord + vcoord + + .false. + + + + + + logical + vcoord + vcoord + + .true. + + + + + + logical + vcoord + vcoord + + .false. + + + + + + logical + vcoord + vcoord + + .true. + + + + + + logical + vcoord + vcoord + + .false. + + + + + + real + vcoord + vcoord + + 2.5 + + + + + + real + vcoord + vcoord + + 1.08 + + + + + + real + vcoord + vcoord + + .1 + + + + + + integer + vcoord + vcoord + + 4 + + + + + + integer + vcoord + vcoord + + 1 + + + + + + + + + + char + diffusion + diffusion + + gm + + + + + + char + diffusion + diffusion + + "large scale" + + + + + + char + diffusion + diffusion + + smooth + + + + + + logical + diffusion + diffusion + + .false. + + + + + + logical + diffusion + diffusion + + .true. + + + + + + real + diffusion + diffusion + + 0.85 + 0.5 + + + + + + real + diffusion + diffusion + + 200. + + + + + + real + diffusion + diffusion + + 4000. + 4000.e2 + + + + + + real + diffusion + diffusion + + 100. + 100.e4 + + + + + + real + diffusion + diffusion + + 1500. + 1000. + 1000.e4 + + + + + + real + diffusion + diffusion + + 1. + + + + + + char + diffusion + diffusion + + UNSET + + + + + + real + diffusion + diffusion + + 0. + + + + + + logical + diffusion + diffusion + + .false. + + + + + + logical + diffusion + diffusion + + .false. + + + + + + logical + diffusion + diffusion + + .false. + + + + + + real + diffusion + diffusion + + + + + + + + integer + diffusion + diffusion + + 2 + + + + + + real + diffusion + diffusion + + 5.e-8 + 5.e-4 + + + + + + real + diffusion + diffusion + + 1.e-5 + .1 + + + + + + logical + diffusion + diffusion + + .false. + .true. + + + + + + real + diffusion + diffusion + + .006 + + + + + + logical + diffusion + diffusion + + .true. + + + + + + char + diffusion + diffusion + + none + + + + + + char + diffusion + diffusion + + layer + neutral + + + + + + + + + + char(2) + cwmod + cwmod + + UNSET + 'Gibraltar','Gibraltar' + 'Gibraltar','Gibraltar' + 'Gibraltar','Gibraltar' + 'Gibraltar','Gibraltar' + + + + + + char(2) + cwmod + cwmod + + 'u','u' + + + + + + integer(2) + cwmod + cwmod + + 53,54 + + + + + + integer(2) + cwmod + cwmod + + 137,137 + + + + + + real(2) + cwmod + cwmod + + 30.e3,30.e3 + + + + + + + + + + char + secdia + secdia + + UNSET + $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx2v1_20190826.dat + $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx1v4_20190611.dat + $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.25v4_20190612.dat + $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.125v4_20221013.dat + + abs + + + + + + + + + + char(3) + diaphy + diaphy + + 'hd','hm','hy' + + + + + + integer(3) + diaphy + diaphy + + 1,30,365 + + + + + + integer(3) + diaphy + diaphy + + 30,30,365 + 1,30,365 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + 1,1,1 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 4,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,0,4 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + integer(3) + diaphy + diaphy + + 0,4,0 + + + + + + + + + + + char + merdia + merdia + + UNSET + $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx2v1_20190826.nc + $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx1v4_20190729.nc + $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.25v4_20190612.nc + $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.125v4_20221013.nc + + abs + + + + + char + merdia + merdia + + UNSET + $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx2v1_20190826.dat + $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx1v4_20190615.dat + $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat + $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat + + abs + + + + + char(4) + merdia + merdia + + 'atlantic_arctic_ocean','atlantic_arctic_extended_ocean','indian_pacific_ocean','global_ocean' + + + + + + integer(20) + merdia + merdia + + 2, 4 + + Array of mask flags in ocean regions file to be included for region (1) + + + integer(20) + merdia + merdia + + 2,4,6,7,8,9 + + Array of mask flags in ocean regions file to be included for region (2) + + + integer(20) + merdia + merdia + + 3,5 + + Array of mask flags in ocean regions file to be included for region (3) + + + integer(20) + merdia + merdia + + 0 + + Array of mask flags in ocean regions file to be included for region (4) + + + + real(4) + merdia + merdia + + -34.,-34.,-34.,-90. + + Minimum latitude to be considered for each region (f) + + + + real(4) + merdia + merdia + + 90.,90.,90.,90. + + Maximum latitude to be considered for each region (f) + + + + + + + + real + bgcnml + bgcnml + + $CCSM_CO2_PPMV + + Atmospheric CO2 concentration [ppmv] + + + + char + bgcnml + bgcnml + + ' ' + $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx2v1_20130506.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx1v4_20171107.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.25v4_20181004.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.125v4_20221013.nc + + abs + 'File name (incl. full path) for iron (dust) deposition data' + + + + char + bgcnml + bgcnml + + UNSET + $DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc + + abs + File name (incl. full path) for swa climatology field (needed if bromoform scheme is activated) + + + + logical + bgcnml + bgcnml + + .false. + .true. + + Logical switch to activate riverine input + + + + char + bgcnml + bgcnml + + ' ' + $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx2v1_20170915.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx1v4_20170820.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.25v4_20170821.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.125v4_20221013.nc + + abs + File name (incl. full path) for riverine input data + + + + + + logical + bgcnml + bgcnml + + .false. + .true. + .false. + + Logical switch to activate N-deposition + + + + char + bgcnml + bgcnml + + ' ' + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx2v1_20180321.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx1v4_20171106.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.25v4_20190912.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.125v4_20221013.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx2v1_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx1v4_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx0.25v4_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx2v1_20190702.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx1v4_20180613.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx0.25v4_20190705.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc + + abs + File name (incl. full path) for atmopheric N-deposition data + + From d7a236cd2c6c76e4ce3c05822d94a294fe660058 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 16 Jul 2023 12:06:05 +0200 Subject: [PATCH 04/33] more cleanup --- cime_config/buildnml.csh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/cime_config/buildnml.csh b/cime_config/buildnml.csh index 46388741..caf1f533 100644 --- a/cime_config/buildnml.csh +++ b/cime_config/buildnml.csh @@ -316,25 +316,37 @@ else set GLB_NCFORMAT = '0, 0, 0' endif set H2D_ABSWND = '0, 4, 0' + set H2D_ALB = '0, 0, 0' + set H2D_BTMSTR = '0, 4, 0' set H2D_BRNFLX = '0, 4, 0' set H2D_BRNPD = '0, 4, 0' + set H2D_DFL = '0, 0, 0' + set H2D_EVA = '0, 4, 0' set H2D_FICE = '0, 4, 0' set H2D_FMLTFZ = '0, 4, 0' + set H2D_HICE = '0, 0, 0' + set H2D_HMLTFZ = '0, 4, 0' + set H2D_HSNW = '0, 0, 0' set H2D_IAGE = '0, 0, 0' + set H2D_IDKEDT = '0, 4, 0' set H2D_LAMULT = '0, 4, 0' set H2D_LASL = '0, 4, 0' set H2D_LIP = '0, 4, 0' + set H2D_MAXMLD = '4, 4, 0' + set H2D_MLD = '0, 4, 0' + set H2D_MLTS = '4, 4, 0' + set H2D_MLTSMN = '0, 4, 0' set H2D_MLTSMX = '0, 4, 0' set H2D_MLTSSQ = '0, 4, 0' @@ -353,32 +365,46 @@ set H2D_RNFFLX = '0, 4, 0' set H2D_SALFLX = '0, 4, 0' set H2D_SALRLX = '0, 4, 0' set H2D_SBOT = '0, 4, 0' + set H2D_SEALV = '4, 4, 0' + set H2D_SLVSQ = '0, 4, 0' set H2D_SFL = '0, 4, 0' set H2D_SOP = '0, 4, 0' set H2D_SIGMX = '0, 4, 0' + set H2D_SSS = '4, 4, 0' set H2D_SSSSQ = '4, 4, 0' set H2D_SST = '4, 4, 0' set H2D_SSTSQ = '4, 4, 0' + set H2D_SURFLX = '0, 4, 0' set H2D_SURRLX = '0, 4, 0' set H2D_SWA = '0, 4, 0' + set H2D_T20D = '4, 4, 0' + set H2D_TAUX = '0, 4, 0' set H2D_TAUY = '0, 4, 0' set H2D_TBOT = '0, 4, 0' + set H2D_TICE = '0, 0, 0' set H2D_TSRF = '0, 0, 0' + set H2D_UB = '0, 4, 0' + set H2D_UICE = '0, 0, 0' + set H2D_USTAR = '0, 4, 0' set H2D_USTAR3 = '0, 4, 0' + set H2D_USTOKES = '0, 0, 0' + set H2D_VB = '0, 4, 0' + set H2D_VICE = '0, 0, 0' set H2D_VSTOKES = '0, 0, 0' + set H2D_ZTX = '0, 4, 0' set LYR_BFSQ = '0, 4, 0' set LYR_DIFDIA = '0, 4, 0' @@ -391,10 +417,13 @@ set LYR_DP = '0, 4, 0' set LYR_DZ = '0, 4, 0' set LYR_SALN = '0, 4, 0' set LYR_TEMP = '0, 4, 0' + set LYR_TRC = '0, 0, 0' + set LYR_UFLX = '0, 4, 0' set LYR_UTFLX = '0, 4, 0' set LYR_USFLX = '0, 4, 0' + set LYR_UMFLTD = '0, 0, 4' set LYR_UMFLSM = '0, 0, 4' set LYR_UTFLTD = '0, 0, 4' @@ -403,10 +432,12 @@ set LYR_UTFLLD = '0, 0, 4' set LYR_USFLTD = '0, 0, 4' set LYR_USFLSM = '0, 0, 4' set LYR_USFLLD = '0, 0, 4' + set LYR_UVEL = '0, 4, 0' set LYR_VFLX = '0, 4, 0' set LYR_VTFLX = '0, 4, 0' set LYR_VSFLX = '0, 4, 0' + set LYR_VMFLTD = '0, 0, 4' set LYR_VMFLSM = '0, 0, 4' set LYR_VTFLTD = '0, 0, 4' @@ -415,6 +446,7 @@ set LYR_VTFLLD = '0, 0, 4' set LYR_VSFLTD = '0, 0, 4' set LYR_VSFLSM = '0, 0, 4' set LYR_VSFLLD = '0, 0, 4' + set LYR_VVEL = '0, 4, 0' set LYR_WFLX = '0, 4, 0' set LYR_WFLX2 = '0, 4, 0' @@ -432,10 +464,13 @@ set LVL_DIFISO = '0, 4, 0' set LVL_DZ = '0, 4, 0' set LVL_SALN = '0, 4, 0' set LVL_TEMP = '0, 4, 0' + set LVL_TRC = '0, 0, 0' + set LVL_UFLX = '0, 4, 0' set LVL_UTFLX = '0, 4, 0' set LVL_USFLX = '0, 4, 0' + set LVL_UMFLTD = '0, 0, 4' set LVL_UMFLSM = '0, 0, 4' set LVL_UTFLTD = '0, 0, 4' @@ -444,10 +479,12 @@ set LVL_UTFLLD = '0, 0, 4' set LVL_USFLTD = '0, 0, 4' set LVL_USFLSM = '0, 0, 4' set LVL_USFLLD = '0, 0, 4' + set LVL_UVEL = '0, 4, 0' set LVL_VFLX = '0, 4, 0' set LVL_VTFLX = '0, 4, 0' set LVL_VSFLX = '0, 4, 0' + set LVL_VMFLTD = '0, 0, 4' set LVL_VMFLSM = '0, 0, 4' set LVL_VTFLTD = '0, 0, 4' @@ -456,6 +493,7 @@ set LVL_VTFLLD = '0, 0, 4' set LVL_VSFLTD = '0, 0, 4' set LVL_VSFLSM = '0, 0, 4' set LVL_VSFLLD = '0, 0, 4' + set LVL_VVEL = '0, 4, 0' set LVL_WFLX = '0, 4, 0' set LVL_WFLX2 = '0, 4, 0' From 469c097a9c4d047a3431af1c3cce68522579b624 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 16 Jul 2023 12:17:06 +0200 Subject: [PATCH 05/33] udpates for bgcnml --- cime_config/buildnml | 6 + cime_config/namelist_definition_blom.xml | 185 ++++++++++++++++++++++- 2 files changed, 189 insertions(+), 2 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index d725d2b3..7b3a7c37 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -109,6 +109,12 @@ def _create_namelists(case, confdir, infile, nmlgen): if nmlgen.get_value('inid14c') == 'UNSET': nmlgen.set_value('inid14c', value="") + if nmlgen.get_value('INID13C') == 'UNSET': + nmlgen.set_value('INID13C', value="") + + if nmlgen.get_value('INID14C') == 'UNSET': + nmlgen.set_value('INID14C', value="") + run_startdate = case.get_value("RUN_STARTDATE") idate = run_startdate.replace('-','') nmlgen.set_value("idate", idate) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 43166294..d0dc8489 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -3166,8 +3166,6 @@ File name (incl. full path) for riverine input data - - logical bgcnml @@ -3202,4 +3200,187 @@ File name (incl. full path) for atmopheric N-deposition data + + logical + bgcnml + bgcnml + + .false. + + + + + + logical + bgcnml + bgcnml + + .false. + .true. + + Logical switch to activate sediment spin-up + + + + integer + bgcnml + bgcnml + + -1 + $HAMOCC_SEDSPINUP_YR_START + + + + + + integer + bgcnml + bgcnml + + -1 + $HAMOCC_SEDSPINUP_YR_END + + + + + + integer + bgcnml + bgcnml + + -1 + + + + + + char + bgcnml + bgcnml + + $DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_Ct_preind_OMIPinit_20171107.nc + + abs + + + + + char + bgcnml + bgcnml + + $DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_At_OMIPinit_20171107.nc + + abs + + + + + char + bgcnml + bgcnml + + $DIN_LOC_ROOT/ocn/blom/inicon/woa13_phosphate_OMIPinit_20171107.nc + + abs + + + + + char + bgcnml + bgcnml + + $DIN_LOC_ROOT/ocn/blom/inicon/woa13_oxygen_OMIPinit_20171107.nc + + abs + + + + + char + bgcnml + bgcnml + + $DIN_LOC_ROOT/ocn/blom/inicon/woa13_nitrate_OMIPinit_20171107.nc + + abs + + + + + char + bgcnml + bgcnml + + $DIN_LOC_ROOT/ocn/blom/inicon/woa13_silicate_OMIPinit_20171107.nc + + abs + + + + + char + bgcnml + bgcnml + + UNSET + $DIN_LOC_ROOT/ocn/blom/inicon/d13C_permil_20180609.nc + + abs + + + + + char + bgcnml + bgcnml + + UNSET + $DIN_LOC_ROOT/ocn/blom/inicon/d14C_permil_20180609.nc + + abs + + + + + logical + bgcnml + bgcnml + + .false. + + + + + + char + bgcnml + bgcnml + + ' ' + + + + + + logical + bgcnml + bgcnml + + .false. + + + + + + char + bgcnml + bgcnml + + ' ' + + + + From fd48a167098cbeb2ecb25d183c41b98862401bb5 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 16 Jul 2023 16:49:22 +0200 Subject: [PATCH 06/33] more extensions --- cime_config/buildnml | 6 -- cime_config/namelist_definition_blom.xml | 122 +++++++++++++++-------- 2 files changed, 80 insertions(+), 48 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 7b3a7c37..d725d2b3 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -109,12 +109,6 @@ def _create_namelists(case, confdir, infile, nmlgen): if nmlgen.get_value('inid14c') == 'UNSET': nmlgen.set_value('inid14c', value="") - if nmlgen.get_value('INID13C') == 'UNSET': - nmlgen.set_value('INID13C', value="") - - if nmlgen.get_value('INID14C') == 'UNSET': - nmlgen.set_value('INID14C', value="") - run_startdate = case.get_value("RUN_STARTDATE") idate = run_startdate.replace('-','') nmlgen.set_value("idate", idate) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index d0dc8489..66269cc6 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -121,8 +121,8 @@ UNSET $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx2v1_20130206.nc - $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx1v4_20170622.nc - $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.25v4_20170622.nc + $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx1v4_20170622.nc + $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.25v4_20170622.nc $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.125v4_20221013.nc abs @@ -136,8 +136,8 @@ UNSET $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx2v1_20130419.nc - $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx1v4_20170622.nc - $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.25v4_20170623.nc + $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx1v4_20170622.nc + $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.25v4_20170623.nc $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.125v4_20230318.nc abs @@ -161,11 +161,11 @@ limits 1800. - 3600. 4800. 4800. - 3200. - 3600. + 3200. + 900. + 300. @@ -176,12 +176,12 @@ limits 36. - 72. 96. 96. - 64. - 900. - 60. + 64. + 60. + 15. + 6. @@ -193,6 +193,10 @@ .02 2. + .0015 + .15 + .001 + .1 @@ -204,6 +208,10 @@ .004 .4 + .0015 + .15 + .001 + .1 @@ -214,7 +222,6 @@ limits 0. - 0. @@ -225,7 +232,6 @@ limits 0. - 0. @@ -237,6 +243,8 @@ 5000. 5000.e4 + 300. + 300.e4 @@ -248,6 +256,8 @@ 300. 300.e4 + 300. + 300.e4 @@ -258,6 +268,8 @@ limits .5 + .15 + 0. @@ -268,6 +280,8 @@ limits .5 + .15 + 0. @@ -278,6 +292,8 @@ limits 0. + 0.0625 + 0.06 @@ -288,6 +304,8 @@ limits 0. + 0.0625 + 0.06 @@ -319,6 +337,9 @@ limits 5.e-5 + 0.75e-4 + 0.75e-4 + 0.75e-4 @@ -399,6 +420,8 @@ limits .06 + .5 + 1.0 @@ -410,8 +433,8 @@ UNSET $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx2v1_20130419.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx1v4_20170605.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.25v4_20170626.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx1v4_20170605.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.25v4_20170626.nc $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.125v4_20221013.nc abs @@ -424,6 +447,7 @@ limits 0. + .4 @@ -483,9 +507,9 @@ limits limits - UNSET - $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx1v4_20170608.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.25v4_20170623.nc + unset + $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx1v4_20170608.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.25v4_20170623.nc $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.125v4_20221013.nc abs @@ -607,10 +631,10 @@ limits limits - UNSET + unset $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx2v1_20130927.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx1v4_20170604.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.25v4_20170623.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx1v4_20170604.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.25v4_20170623.nc $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20221013.nc abs @@ -633,6 +657,7 @@ limits .true. + .false. @@ -940,6 +965,8 @@ diffusion smooth + step + step @@ -971,6 +998,7 @@ 0.85 0.5 + 0.5 @@ -1003,6 +1031,7 @@ 100. 100.e4 + 0. @@ -1013,8 +1042,12 @@ diffusion 1500. + 1500.e4 1000. 1000.e4 + 1000. + 1000.e4 + 0. @@ -1167,8 +1200,10 @@ diffusion diffusion - layer - neutral + neutral + layer + layer + layer @@ -1184,8 +1219,6 @@ UNSET 'Gibraltar','Gibraltar' - 'Gibraltar','Gibraltar' - 'Gibraltar','Gibraltar' 'Gibraltar','Gibraltar' @@ -1196,7 +1229,8 @@ cwmod cwmod - 'u','u' + 'u','u' + 'u','u' @@ -1206,7 +1240,8 @@ cwmod cwmod - 53,54 + 53,54 + 105,106 @@ -1216,7 +1251,8 @@ cwmod cwmod - 137,137 + 137,137 + 273,273 @@ -1226,7 +1262,9 @@ cwmod cwmod - 30.e3,30.e3 + 30.e3,30.e3 + 30.e3,30.e3 + @@ -1240,10 +1278,10 @@ secdia secdia - UNSET + unset $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx2v1_20190826.dat - $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx1v4_20190611.dat - $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.25v4_20190612.dat + $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx1v4_20190611.dat + $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.25v4_20190612.dat $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.125v4_20221013.dat abs @@ -3009,8 +3047,8 @@ UNSET $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx2v1_20190826.nc - $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx1v4_20190729.nc - $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.25v4_20190612.nc + $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx1v4_20190729.nc + $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.25v4_20190612.nc $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.125v4_20221013.nc abs @@ -3024,8 +3062,8 @@ UNSET $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx2v1_20190826.dat - $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx1v4_20190615.dat - $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat + $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx1v4_20190615.dat + $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat abs @@ -3188,16 +3226,16 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx1v4_20171106.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.25v4_20190912.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.125v4_20221013.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx2v1_20200826.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx1v4_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx2v1_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx1v4_20200826.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx0.25v4_20200826.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx2v1_20190702.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx1v4_20180613.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx2v1_20190702.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx1v4_20180613.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx0.25v4_20190705.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc abs - File name (incl. full path) for atmopheric N-deposition data + File name (incl. full path) for atmopheric N-deposition data From 995cf1236dcac4cf1e276535d74cd48d8738560a Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 16 Jul 2023 18:46:27 +0200 Subject: [PATCH 07/33] update for bgc diag output --- cime_config/namelist_definition_blom.xml | 2069 +++++++++++++++++++++- 1 file changed, 2068 insertions(+), 1 deletion(-) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 66269cc6..8b39c987 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -532,6 +532,8 @@ limits 0. + 60. + 6. @@ -552,6 +554,8 @@ limits 1. + 1. + 10. @@ -622,6 +626,7 @@ limits .false. + .true. @@ -668,6 +673,7 @@ limits .false. + .true. @@ -3362,7 +3368,7 @@ bgcnml bgcnml - UNSET + UNSET $DIN_LOC_ROOT/ocn/blom/inicon/d13C_permil_20180609.nc abs @@ -3421,4 +3427,2065 @@ + + + + + + char + bgcoafx + bgcoafx + + ' ' + + + + + + char + bgcoafx + bgcoafx + + ' ' + + + + + + real + bgcoafx + bgcoafx + + 0.135 + + + + + + real + bgcoafx + bgcoafx + + 70.0 + + + + + + real + bgcoafx + bgcoafx + + -60.0 + + + + + + real + bgcoafx + bgcoafx + + 2025 + + + + + + real + bgcoafx + bgcoafx + + 2035 + + + + + + + + + + char(3) + diabgc + diabgc + + 'hbgcd','hbgcm','hbgcy' + + + + + + integer(3) + diabgc + diabgc + + 30,30,365 + 1,30,365 + + + + + + integer(3) + diabgc + diabgc + + 0,0,0 + + + + + + integer(3) + diaphy + diaphy + + 0,0,0 + 1,1,1 + + + + + + integer(3) + diabgc + diabgc + + 0, 1, 0 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 4, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 4, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 4, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 4, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 4, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 4, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0,0,0 + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 0 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 4 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 0 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 4 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 4 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 0 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 0 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 4, 4 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 4, 4 + + + + + + integer(3) + diabgc + diabgc + + 0, 4, 4 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 0 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 0 + + + + + + integer(3) + diabgc + diabgc + + 0, 2, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + + + integer(3) + diabgc + diabgc + + 0, 0, 2 + + + + From 73a1a1a7ee4cccd185a09071ad0392b408e7786c Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 17 Jul 2023 10:05:11 +0200 Subject: [PATCH 08/33] updates for user_nl_blom and copy of ocn_in.readme --- cime_config/buildcpp | 3 +- cime_config/namelist_definition_blom.xml | 1094 +++++++++++----------- cime_config/user_nl_blom | 32 +- 3 files changed, 575 insertions(+), 554 deletions(-) diff --git a/cime_config/buildcpp b/cime_config/buildcpp index dc6cd8e8..4799052a 100644 --- a/cime_config/buildcpp +++ b/cime_config/buildcpp @@ -91,7 +91,8 @@ def buildcpp(case): blom_unit = case.get_value("BLOM_UNIT") pio_typename = case.get_value("PIO_TYPENAME", subgroup="OCN") - expect(blom_vcoord != "cntiso_hybrid" or not turbclo, "BLOM_VCOORD == {} and BLOM_TURBULENT_CLOSURE == {} is not a valid combination".format(blom_vcoord, turbclo)) + expect(blom_vcoord != "cntiso_hybrid" or not turbclo, + f"BLOM_VCOORD == {blom_vcoord} and BLOM_TURBULENT_CLOSURE == {turblo} is not a valid combination") blom_cppdefs = "" diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 8b39c987..66defd0f 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -28,23 +28,11 @@ that have only a small number of allowed values. --> - - - - - - - - - - - - - + integer limits limits @@ -54,7 +42,7 @@ - + integer limits limits @@ -64,7 +52,7 @@ - + integer limits limits @@ -74,7 +62,7 @@ - + integer limits limits @@ -84,7 +72,7 @@ - + limits limits @@ -94,7 +82,7 @@ char - + char limits limits @@ -104,17 +92,18 @@ - + char limits limits - initial + $RUN_TYPE + continue - + char limits limits @@ -129,7 +118,7 @@ - + char limits limits @@ -144,7 +133,7 @@ - + real limits limits @@ -155,7 +144,7 @@ - + real limits limits @@ -164,13 +153,14 @@ 4800. 4800. 3200. + 3600. 900. 300. - + real limits limits @@ -186,7 +176,7 @@ - + real limits limits @@ -201,7 +191,7 @@ - + real limits limits @@ -216,7 +206,7 @@ - + real limits limits @@ -226,7 +216,7 @@ - + real limits limits @@ -236,7 +226,7 @@ - + real limits limits @@ -249,7 +239,7 @@ - + real limits limits @@ -262,7 +252,7 @@ - + real limits limits @@ -274,7 +264,7 @@ - + real limits limits @@ -286,7 +276,7 @@ - + real limits limits @@ -298,7 +288,7 @@ - + real limits limits @@ -310,7 +300,7 @@ - + real limits limits @@ -321,7 +311,7 @@ - + real limits limits @@ -331,20 +321,20 @@ - + real limits limits 5.e-5 - 0.75e-4 + .75e-4 0.75e-4 0.75e-4 - + real limits limits @@ -354,7 +344,7 @@ - + char limits limits @@ -364,7 +354,7 @@ - + char limits limits @@ -374,7 +364,7 @@ - + char limits limits @@ -384,7 +374,7 @@ - + char limits limits @@ -394,7 +384,7 @@ - + real limits limits @@ -404,7 +394,7 @@ - + real limits limits @@ -414,19 +404,19 @@ - + real limits limits .06 - .5 - 1.0 + .5 + 1.0 - + char limits limits @@ -441,7 +431,7 @@ - + real limits limits @@ -452,7 +442,7 @@ - + real limits limits @@ -462,7 +452,7 @@ - + real limits limits @@ -472,7 +462,7 @@ - + char limits limits @@ -482,7 +472,7 @@ - + integer limits limits @@ -492,7 +482,7 @@ - + char limits limits @@ -502,7 +492,7 @@ - + char limits limits @@ -516,7 +506,7 @@ - + real limits limits @@ -526,7 +516,7 @@ - + real limits limits @@ -538,7 +528,7 @@ - + real limits limits @@ -548,7 +538,7 @@ - + real limits limits @@ -560,7 +550,7 @@ - + real limits limits @@ -570,7 +560,7 @@ - + real limits limits @@ -580,7 +570,7 @@ - + logical limits limits @@ -590,7 +580,7 @@ - + logical limits limits @@ -600,7 +590,7 @@ - + logical limits limits @@ -610,7 +600,7 @@ - + logical limits limits @@ -620,7 +610,7 @@ - + logical limits limits @@ -631,7 +621,7 @@ - + char limits limits @@ -646,7 +636,7 @@ - + char limits limits @@ -656,7 +646,7 @@ - + logical limits limits @@ -667,7 +657,7 @@ - + logical limits limits @@ -678,7 +668,7 @@ - + char limits limits @@ -688,7 +678,7 @@ - + integer limits limits @@ -698,7 +688,7 @@ - + integer limits limits @@ -708,7 +698,7 @@ - + logical limits limits @@ -718,7 +708,7 @@ - + logical limits limits @@ -728,7 +718,7 @@ - + integer limits limits @@ -738,7 +728,7 @@ - + integer limits limits @@ -749,7 +739,7 @@ - + integer limits limits @@ -759,7 +749,7 @@ - + integer limits limits @@ -781,7 +771,7 @@ - + char vcoord vcoord @@ -791,7 +781,7 @@ - + char vcoord vcoord @@ -801,7 +791,7 @@ - + char vcoord vcoord @@ -811,7 +801,7 @@ - + char vcoord vcoord @@ -821,7 +811,7 @@ - + char vcoord vcoord @@ -831,7 +821,7 @@ - + logical vcoord vcoord @@ -841,7 +831,7 @@ - + logical vcoord vcoord @@ -851,7 +841,7 @@ - + logical vcoord vcoord @@ -861,7 +851,7 @@ - + logical vcoord vcoord @@ -871,7 +861,7 @@ - + logical vcoord vcoord @@ -881,7 +871,7 @@ - + logical vcoord vcoord @@ -891,7 +881,7 @@ - + real vcoord vcoord @@ -901,7 +891,7 @@ - + real vcoord vcoord @@ -911,7 +901,7 @@ - + real vcoord vcoord @@ -921,7 +911,7 @@ - + integer vcoord vcoord @@ -931,7 +921,7 @@ - + integer vcoord vcoord @@ -945,7 +935,7 @@ - + char diffusion diffusion @@ -955,7 +945,7 @@ - + char diffusion diffusion @@ -965,7 +955,7 @@ - + char diffusion diffusion @@ -977,7 +967,7 @@ - + logical diffusion diffusion @@ -987,7 +977,7 @@ - + logical diffusion diffusion @@ -997,7 +987,7 @@ - + real diffusion diffusion @@ -1009,7 +999,7 @@ - + real diffusion diffusion @@ -1019,7 +1009,7 @@ - + real diffusion diffusion @@ -1030,7 +1020,7 @@ - + real diffusion diffusion @@ -1042,7 +1032,7 @@ - + real diffusion diffusion @@ -1058,7 +1048,7 @@ - + real diffusion diffusion @@ -1068,17 +1058,17 @@ - + char diffusion diffusion - UNSET + unset - + real diffusion diffusion @@ -1088,7 +1078,7 @@ - + logical diffusion diffusion @@ -1098,7 +1088,7 @@ - + logical diffusion diffusion @@ -1108,7 +1098,7 @@ - + logical diffusion diffusion @@ -1118,17 +1108,17 @@ - + real diffusion diffusion - + 1.2 - + integer diffusion diffusion @@ -1138,7 +1128,7 @@ - + real diffusion diffusion @@ -1149,7 +1139,7 @@ - + real diffusion diffusion @@ -1160,7 +1150,7 @@ - + logical diffusion diffusion @@ -1171,7 +1161,7 @@ - + real diffusion diffusion @@ -1181,7 +1171,7 @@ - + logical diffusion diffusion @@ -1191,7 +1181,7 @@ - + char diffusion diffusion @@ -1201,7 +1191,7 @@ - + char diffusion diffusion @@ -1218,7 +1208,7 @@ - + char(2) cwmod cwmod @@ -1230,7 +1220,7 @@ - + char(2) cwmod cwmod @@ -1241,7 +1231,7 @@ - + integer(2) cwmod cwmod @@ -1252,7 +1242,7 @@ - + integer(2) cwmod cwmod @@ -1263,7 +1253,7 @@ - + real(2) cwmod cwmod @@ -1279,7 +1269,7 @@ - + char secdia secdia @@ -1299,7 +1289,7 @@ - + char(3) diaphy diaphy @@ -1309,7 +1299,7 @@ - + integer(3) diaphy diaphy @@ -1319,7 +1309,7 @@ - + integer(3) diaphy diaphy @@ -1330,7 +1320,7 @@ - + integer(3) diaphy diaphy @@ -1340,7 +1330,7 @@ - + integer(3) diaphy diaphy @@ -1351,7 +1341,7 @@ - + integer(3) diaphy diaphy @@ -1361,7 +1351,7 @@ - + integer(3) diaphy diaphy @@ -1371,7 +1361,7 @@ - + integer(3) diaphy diaphy @@ -1381,7 +1371,7 @@ - + integer(3) diaphy diaphy @@ -1391,7 +1381,7 @@ - + integer(3) diaphy diaphy @@ -1401,7 +1391,7 @@ - + integer(3) diaphy diaphy @@ -1411,7 +1401,7 @@ - + integer(3) diaphy diaphy @@ -1421,7 +1411,7 @@ - + integer(3) diaphy diaphy @@ -1431,7 +1421,7 @@ - + integer(3) diaphy diaphy @@ -1441,7 +1431,7 @@ - + integer(3) diaphy diaphy @@ -1451,7 +1441,7 @@ - + integer(3) diaphy diaphy @@ -1461,7 +1451,7 @@ - + integer(3) diaphy diaphy @@ -1471,7 +1461,7 @@ - + integer(3) diaphy diaphy @@ -1481,7 +1471,7 @@ - + integer(3) diaphy diaphy @@ -1491,7 +1481,7 @@ - + integer(3) diaphy diaphy @@ -1501,7 +1491,7 @@ - + integer(3) diaphy diaphy @@ -1511,7 +1501,7 @@ - + integer(3) diaphy diaphy @@ -1521,7 +1511,7 @@ - + integer(3) diaphy diaphy @@ -1531,7 +1521,7 @@ - + integer(3) diaphy diaphy @@ -1541,7 +1531,7 @@ - + integer(3) diaphy diaphy @@ -1551,7 +1541,7 @@ - + integer(3) diaphy diaphy @@ -1561,7 +1551,7 @@ - + integer(3) diaphy diaphy @@ -1571,7 +1561,7 @@ - + integer(3) diaphy diaphy @@ -1581,7 +1571,7 @@ - + integer(3) diaphy diaphy @@ -1591,7 +1581,7 @@ - + integer(3) diaphy diaphy @@ -1601,7 +1591,7 @@ - + integer(3) diaphy diaphy @@ -1611,7 +1601,7 @@ - + integer(3) diaphy diaphy @@ -1621,7 +1611,7 @@ - + integer(3) diaphy diaphy @@ -1631,7 +1621,7 @@ - + integer(3) diaphy diaphy @@ -1641,7 +1631,7 @@ - + integer(3) diaphy diaphy @@ -1651,7 +1641,7 @@ - + integer(3) diaphy diaphy @@ -1661,7 +1651,7 @@ - + integer(3) diaphy diaphy @@ -1671,7 +1661,7 @@ - + integer(3) diaphy diaphy @@ -1681,7 +1671,7 @@ - + integer(3) diaphy diaphy @@ -1691,7 +1681,7 @@ - + integer(3) diaphy diaphy @@ -1701,7 +1691,7 @@ - + integer(3) diaphy diaphy @@ -1711,7 +1701,7 @@ - + integer(3) diaphy diaphy @@ -1721,7 +1711,7 @@ - + integer(3) diaphy diaphy @@ -1731,7 +1721,7 @@ - + integer(3) diaphy diaphy @@ -1741,7 +1731,7 @@ - + integer(3) diaphy diaphy @@ -1751,7 +1741,7 @@ - + integer(3) diaphy diaphy @@ -1761,7 +1751,7 @@ - + integer(3) diaphy diaphy @@ -1771,7 +1761,7 @@ - + integer(3) diaphy diaphy @@ -1781,7 +1771,7 @@ - + integer(3) diaphy diaphy @@ -1791,7 +1781,7 @@ - + integer(3) diaphy diaphy @@ -1801,7 +1791,7 @@ - + integer(3) diaphy diaphy @@ -1811,7 +1801,7 @@ - + integer(3) diaphy diaphy @@ -1821,7 +1811,7 @@ - + integer(3) diaphy diaphy @@ -1831,7 +1821,7 @@ - + integer(3) diaphy diaphy @@ -1841,7 +1831,7 @@ - + integer(3) diaphy diaphy @@ -1851,7 +1841,7 @@ - + integer(3) diaphy diaphy @@ -1861,7 +1851,7 @@ - + integer(3) diaphy diaphy @@ -1871,7 +1861,7 @@ - + integer(3) diaphy diaphy @@ -1881,7 +1871,7 @@ - + integer(3) diaphy diaphy @@ -1891,7 +1881,7 @@ - + integer(3) diaphy diaphy @@ -1901,7 +1891,7 @@ - + integer(3) diaphy diaphy @@ -1911,7 +1901,7 @@ - + integer(3) diaphy diaphy @@ -1921,7 +1911,7 @@ - + integer(3) diaphy diaphy @@ -1931,7 +1921,7 @@ - + integer(3) diaphy diaphy @@ -1941,7 +1931,7 @@ - + integer(3) diaphy diaphy @@ -1951,7 +1941,7 @@ - + integer(3) diaphy diaphy @@ -1961,7 +1951,7 @@ - + integer(3) diaphy diaphy @@ -1971,7 +1961,7 @@ - + integer(3) diaphy diaphy @@ -1981,7 +1971,7 @@ - + integer(3) diaphy diaphy @@ -1991,7 +1981,7 @@ - + integer(3) diaphy diaphy @@ -2001,7 +1991,7 @@ - + integer(3) diaphy diaphy @@ -2011,7 +2001,7 @@ - + integer(3) diaphy diaphy @@ -2021,7 +2011,7 @@ - + integer(3) diaphy diaphy @@ -2031,7 +2021,7 @@ - + integer(3) diaphy diaphy @@ -2041,7 +2031,7 @@ - + integer(3) diaphy diaphy @@ -2051,7 +2041,7 @@ - + integer(3) diaphy diaphy @@ -2061,7 +2051,7 @@ - + integer(3) diaphy diaphy @@ -2071,7 +2061,7 @@ - + integer(3) diaphy diaphy @@ -2081,7 +2071,7 @@ - + integer(3) diaphy diaphy @@ -2091,7 +2081,7 @@ - + integer(3) diaphy diaphy @@ -2101,7 +2091,7 @@ - + integer(3) diaphy diaphy @@ -2111,7 +2101,7 @@ - + integer(3) diaphy diaphy @@ -2121,7 +2111,7 @@ - + integer(3) diaphy diaphy @@ -2131,7 +2121,7 @@ - + integer(3) diaphy diaphy @@ -2141,7 +2131,7 @@ - + integer(3) diaphy diaphy @@ -2151,7 +2141,7 @@ - + integer(3) diaphy diaphy @@ -2161,17 +2151,17 @@ - + integer(3) diaphy diaphy - 0,4,0 + 0,0,4 - + integer(3) diaphy diaphy @@ -2181,7 +2171,7 @@ - + integer(3) diaphy diaphy @@ -2191,7 +2181,7 @@ - + integer(3) diaphy diaphy @@ -2201,7 +2191,7 @@ - + integer(3) diaphy diaphy @@ -2211,7 +2201,7 @@ - + integer(3) diaphy diaphy @@ -2221,7 +2211,7 @@ - + integer(3) diaphy diaphy @@ -2231,7 +2221,7 @@ - + integer(3) diaphy diaphy @@ -2241,7 +2231,7 @@ - + integer(3) diaphy diaphy @@ -2251,7 +2241,7 @@ - + integer(3) diaphy diaphy @@ -2261,7 +2251,7 @@ - + integer(3) diaphy diaphy @@ -2271,7 +2261,7 @@ - + integer(3) diaphy diaphy @@ -2281,7 +2271,7 @@ - + integer(3) diaphy diaphy @@ -2291,7 +2281,7 @@ - + integer(3) diaphy diaphy @@ -2301,7 +2291,7 @@ - + integer(3) diaphy diaphy @@ -2311,17 +2301,17 @@ - + integer(3) diaphy diaphy - 0,4,0 + 0,0,4 - + integer(3) diaphy diaphy @@ -2331,7 +2321,7 @@ - + integer(3) diaphy diaphy @@ -2341,7 +2331,7 @@ - + integer(3) diaphy diaphy @@ -2351,7 +2341,7 @@ - + integer(3) diaphy diaphy @@ -2361,7 +2351,7 @@ - + integer(3) diaphy diaphy @@ -2371,7 +2361,7 @@ - + integer(3) diaphy diaphy @@ -2381,7 +2371,7 @@ - + integer(3) diaphy diaphy @@ -2391,7 +2381,7 @@ - + integer(3) diaphy diaphy @@ -2401,7 +2391,7 @@ - + integer(3) diaphy diaphy @@ -2411,7 +2401,7 @@ - + integer(3) diaphy diaphy @@ -2421,7 +2411,7 @@ - + integer(3) diaphy diaphy @@ -2431,7 +2421,7 @@ - + integer(3) diaphy diaphy @@ -2441,7 +2431,7 @@ - + integer(3) diaphy diaphy @@ -2451,7 +2441,7 @@ - + integer(3) diaphy diaphy @@ -2461,7 +2451,7 @@ - + integer(3) diaphy diaphy @@ -2471,7 +2461,7 @@ - + integer(3) diaphy diaphy @@ -2481,7 +2471,7 @@ - + integer(3) diaphy diaphy @@ -2491,7 +2481,7 @@ - + integer(3) diaphy diaphy @@ -2501,7 +2491,7 @@ - + integer(3) diaphy diaphy @@ -2511,7 +2501,7 @@ - + integer(3) diaphy diaphy @@ -2521,7 +2511,7 @@ - + integer(3) diaphy diaphy @@ -2531,7 +2521,7 @@ - + integer(3) diaphy diaphy @@ -2541,7 +2531,7 @@ - + integer(3) diaphy diaphy @@ -2551,7 +2541,7 @@ - + integer(3) diaphy diaphy @@ -2561,7 +2551,7 @@ - + integer(3) diaphy diaphy @@ -2571,7 +2561,7 @@ - + integer(3) diaphy diaphy @@ -2581,7 +2571,7 @@ - + integer(3) diaphy diaphy @@ -2591,7 +2581,7 @@ - + integer(3) diaphy diaphy @@ -2601,7 +2591,7 @@ - + integer(3) diaphy diaphy @@ -2611,7 +2601,7 @@ - + integer(3) diaphy diaphy @@ -2621,7 +2611,7 @@ - + integer(3) diaphy diaphy @@ -2631,7 +2621,7 @@ - + integer(3) diaphy diaphy @@ -2641,7 +2631,7 @@ - + integer(3) diaphy diaphy @@ -2651,7 +2641,7 @@ - + integer(3) diaphy diaphy @@ -2661,7 +2651,7 @@ - + integer(3) diaphy diaphy @@ -2671,7 +2661,7 @@ - + integer(3) diaphy diaphy @@ -2681,7 +2671,7 @@ - + integer(3) diaphy diaphy @@ -2691,7 +2681,7 @@ - + integer(3) diaphy diaphy @@ -2701,7 +2691,7 @@ - + integer(3) diaphy diaphy @@ -2711,7 +2701,7 @@ - + integer(3) diaphy diaphy @@ -2721,7 +2711,7 @@ - + integer(3) diaphy diaphy @@ -2731,7 +2721,7 @@ - + integer(3) diaphy diaphy @@ -2741,7 +2731,7 @@ - + integer(3) diaphy diaphy @@ -2751,7 +2741,7 @@ - + integer(3) diaphy diaphy @@ -2761,7 +2751,7 @@ - + integer(3) diaphy diaphy @@ -2771,7 +2761,7 @@ - + integer(3) diaphy diaphy @@ -2781,7 +2771,7 @@ - + integer(3) diaphy diaphy @@ -2791,7 +2781,7 @@ - + integer(3) diaphy diaphy @@ -2801,7 +2791,7 @@ - + integer(3) diaphy diaphy @@ -2811,7 +2801,7 @@ - + integer(3) diaphy diaphy @@ -2821,7 +2811,7 @@ - + integer(3) diaphy diaphy @@ -2831,7 +2821,7 @@ - + integer(3) diaphy diaphy @@ -2841,7 +2831,7 @@ - + integer(3) diaphy diaphy @@ -2851,7 +2841,7 @@ - + integer(3) diaphy diaphy @@ -2861,7 +2851,7 @@ - + integer(3) diaphy diaphy @@ -2871,7 +2861,7 @@ - + integer(3) diaphy diaphy @@ -2881,7 +2871,7 @@ - + integer(3) diaphy diaphy @@ -2891,7 +2881,7 @@ - + integer(3) diaphy diaphy @@ -2901,7 +2891,7 @@ - + integer(3) diaphy diaphy @@ -2911,7 +2901,7 @@ - + integer(3) diaphy diaphy @@ -2921,7 +2911,7 @@ - + integer(3) diaphy diaphy @@ -2931,7 +2921,7 @@ - + integer(3) diaphy diaphy @@ -2941,7 +2931,7 @@ - + integer(3) diaphy diaphy @@ -2951,7 +2941,7 @@ - + integer(3) diaphy diaphy @@ -2961,7 +2951,7 @@ - + integer(3) diaphy diaphy @@ -2971,7 +2961,7 @@ - + integer(3) diaphy diaphy @@ -2981,7 +2971,7 @@ - + integer(3) diaphy diaphy @@ -2991,7 +2981,7 @@ - + integer(3) diaphy diaphy @@ -3001,7 +2991,7 @@ - + integer(3) diaphy diaphy @@ -3011,7 +3001,7 @@ - + integer(3) diaphy diaphy @@ -3021,7 +3011,7 @@ - + integer(3) diaphy diaphy @@ -3031,7 +3021,7 @@ - + integer(3) diaphy diaphy @@ -3046,7 +3036,7 @@ - + char merdia merdia @@ -3061,7 +3051,7 @@ - + char merdia merdia @@ -3076,7 +3066,7 @@ - + char(4) merdia merdia @@ -3086,7 +3076,7 @@ - + integer(20) merdia merdia @@ -3095,7 +3085,7 @@ Array of mask flags in ocean regions file to be included for region (1) - + integer(20) merdia merdia @@ -3104,7 +3094,7 @@ Array of mask flags in ocean regions file to be included for region (2) - + integer(20) merdia merdia @@ -3113,7 +3103,7 @@ Array of mask flags in ocean regions file to be included for region (3) - + integer(20) merdia merdia @@ -3123,7 +3113,7 @@ Array of mask flags in ocean regions file to be included for region (4) - + real(4) merdia merdia @@ -3133,7 +3123,7 @@ Minimum latitude to be considered for each region (f) - + real(4) merdia merdia @@ -3147,7 +3137,7 @@ - + real bgcnml bgcnml @@ -3157,7 +3147,7 @@ Atmospheric CO2 concentration [ppmv] - + char bgcnml bgcnml @@ -3172,7 +3162,7 @@ 'File name (incl. full path) for iron (dust) deposition data' - + char bgcnml bgcnml @@ -3184,7 +3174,7 @@ File name (incl. full path) for swa climatology field (needed if bromoform scheme is activated) - + logical bgcnml bgcnml @@ -3195,7 +3185,7 @@ Logical switch to activate riverine input - + char bgcnml bgcnml @@ -3210,7 +3200,7 @@ File name (incl. full path) for riverine input data - + logical bgcnml bgcnml @@ -3222,14 +3212,14 @@ Logical switch to activate N-deposition - + char bgcnml bgcnml ' ' $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx2v1_20180321.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx1v4_20171106.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx1v4_20171106.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.25v4_20190912.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.125v4_20221013.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx2v1_20200826.nc @@ -3244,7 +3234,7 @@ File name (incl. full path) for atmopheric N-deposition data - + logical bgcnml bgcnml @@ -3254,7 +3244,7 @@ - + logical bgcnml bgcnml @@ -3265,7 +3255,7 @@ Logical switch to activate sediment spin-up - + integer bgcnml bgcnml @@ -3276,7 +3266,7 @@ - + integer bgcnml bgcnml @@ -3287,7 +3277,7 @@ - + integer bgcnml bgcnml @@ -3297,7 +3287,7 @@ - + char bgcnml bgcnml @@ -3308,7 +3298,7 @@ - + char bgcnml bgcnml @@ -3319,7 +3309,7 @@ - + char bgcnml bgcnml @@ -3330,7 +3320,7 @@ - + char bgcnml bgcnml @@ -3341,7 +3331,7 @@ - + char bgcnml bgcnml @@ -3352,7 +3342,7 @@ - + char bgcnml bgcnml @@ -3363,7 +3353,7 @@ - + char bgcnml bgcnml @@ -3375,7 +3365,7 @@ - + char bgcnml bgcnml @@ -3387,7 +3377,7 @@ - + logical bgcnml bgcnml @@ -3397,7 +3387,7 @@ - + char bgcnml bgcnml @@ -3407,7 +3397,7 @@ - + logical bgcnml bgcnml @@ -3417,7 +3407,7 @@ - + char bgcnml bgcnml @@ -3431,7 +3421,7 @@ - + char bgcoafx bgcoafx @@ -3441,7 +3431,7 @@ - + char bgcoafx bgcoafx @@ -3451,7 +3441,7 @@ - + real bgcoafx bgcoafx @@ -3461,7 +3451,7 @@ - + real bgcoafx bgcoafx @@ -3471,7 +3461,7 @@ - + real bgcoafx bgcoafx @@ -3481,7 +3471,7 @@ - + real bgcoafx bgcoafx @@ -3491,7 +3481,7 @@ - + real bgcoafx bgcoafx @@ -3505,7 +3495,7 @@ - + char(3) diabgc diabgc @@ -3515,7 +3505,17 @@ - + + integer(3) + diabgc + diabgc + + 1,30,365 + + + + + integer(3) diabgc diabgc @@ -3526,7 +3526,7 @@ - + integer(3) diabgc diabgc @@ -3536,10 +3536,10 @@ - + integer(3) - diaphy - diaphy + diabgc + diabgc 0,0,0 1,1,1 @@ -3547,7 +3547,7 @@ - + integer(3) diabgc diabgc @@ -3557,7 +3557,7 @@ - + integer(3) diabgc diabgc @@ -3567,7 +3567,7 @@ - + integer(3) diabgc diabgc @@ -3577,7 +3577,7 @@ - + integer(3) diabgc diabgc @@ -3587,7 +3587,7 @@ - + integer(3) diabgc diabgc @@ -3597,7 +3597,7 @@ - + integer(3) diabgc diabgc @@ -3607,7 +3607,7 @@ - + integer(3) diabgc diabgc @@ -3617,7 +3617,7 @@ - + integer(3) diabgc diabgc @@ -3627,7 +3627,7 @@ - + integer(3) diabgc diabgc @@ -3637,7 +3637,7 @@ - + integer(3) diabgc diabgc @@ -3647,7 +3647,7 @@ - + integer(3) diabgc diabgc @@ -3657,7 +3657,7 @@ - + integer(3) diabgc diabgc @@ -3667,7 +3667,7 @@ - + integer(3) diabgc diabgc @@ -3677,7 +3677,7 @@ - + integer(3) diabgc diabgc @@ -3687,7 +3687,7 @@ - + integer(3) diabgc diabgc @@ -3697,7 +3697,7 @@ - + integer(3) diabgc diabgc @@ -3707,7 +3707,7 @@ - + integer(3) diabgc diabgc @@ -3717,7 +3717,7 @@ - + integer(3) diabgc diabgc @@ -3727,7 +3727,7 @@ - + integer(3) diabgc diabgc @@ -3737,7 +3737,7 @@ - + integer(3) diabgc diabgc @@ -3747,7 +3747,7 @@ - + integer(3) diabgc diabgc @@ -3757,7 +3757,7 @@ - + integer(3) diabgc diabgc @@ -3767,7 +3767,7 @@ - + integer(3) diabgc diabgc @@ -3777,7 +3777,7 @@ - + integer(3) diabgc diabgc @@ -3787,7 +3787,7 @@ - + integer(3) diabgc diabgc @@ -3797,7 +3797,7 @@ - + integer(3) diabgc diabgc @@ -3807,7 +3807,7 @@ - + integer(3) diabgc diabgc @@ -3817,7 +3817,7 @@ - + integer(3) diabgc diabgc @@ -3827,7 +3827,7 @@ - + integer(3) diabgc diabgc @@ -3837,7 +3837,7 @@ - + integer(3) diabgc diabgc @@ -3847,7 +3847,7 @@ - + integer(3) diabgc diabgc @@ -3857,7 +3857,7 @@ - + integer(3) diabgc diabgc @@ -3867,7 +3867,7 @@ - + integer(3) diabgc diabgc @@ -3877,7 +3877,7 @@ - + integer(3) diabgc diabgc @@ -3887,7 +3887,7 @@ - + integer(3) diabgc diabgc @@ -3897,7 +3897,7 @@ - + integer(3) diabgc diabgc @@ -3907,7 +3907,7 @@ - + integer(3) diabgc diabgc @@ -3917,7 +3917,7 @@ - + integer(3) diabgc diabgc @@ -3927,7 +3927,7 @@ - + integer(3) diabgc diabgc @@ -3937,7 +3937,7 @@ - + integer(3) diabgc diabgc @@ -3947,7 +3947,7 @@ - + integer(3) diabgc diabgc @@ -3957,7 +3957,7 @@ - + integer(3) diabgc diabgc @@ -3967,7 +3967,7 @@ - + integer(3) diabgc diabgc @@ -3977,7 +3977,7 @@ - + integer(3) diabgc diabgc @@ -3987,7 +3987,7 @@ - + integer(3) diabgc diabgc @@ -3997,7 +3997,7 @@ - + integer(3) diabgc diabgc @@ -4007,7 +4007,7 @@ - + integer(3) diabgc diabgc @@ -4017,7 +4017,7 @@ - + integer(3) diabgc diabgc @@ -4027,7 +4027,7 @@ - + integer(3) diabgc diabgc @@ -4037,7 +4037,7 @@ - + integer(3) diabgc diabgc @@ -4047,7 +4047,7 @@ - + integer(3) diabgc diabgc @@ -4057,7 +4057,7 @@ - + integer(3) diabgc diabgc @@ -4068,7 +4068,7 @@ - + integer(3) diabgc diabgc @@ -4078,7 +4078,7 @@ - + integer(3) diabgc diabgc @@ -4088,7 +4088,7 @@ - + integer(3) diabgc diabgc @@ -4098,7 +4098,7 @@ - + integer(3) diabgc diabgc @@ -4108,7 +4108,7 @@ - + integer(3) diabgc diabgc @@ -4118,7 +4118,7 @@ - + integer(3) diabgc diabgc @@ -4128,7 +4128,7 @@ - + integer(3) diabgc diabgc @@ -4138,7 +4138,7 @@ - + integer(3) diabgc diabgc @@ -4148,7 +4148,7 @@ - + integer(3) diabgc diabgc @@ -4158,7 +4158,7 @@ - + integer(3) diabgc diabgc @@ -4168,7 +4168,7 @@ - + integer(3) diabgc diabgc @@ -4178,7 +4178,7 @@ - + integer(3) diabgc diabgc @@ -4188,7 +4188,7 @@ - + integer(3) diabgc diabgc @@ -4198,7 +4198,7 @@ - + integer(3) diabgc diabgc @@ -4208,7 +4208,7 @@ - + integer(3) diabgc diabgc @@ -4218,7 +4218,7 @@ - + integer(3) diabgc diabgc @@ -4228,7 +4228,7 @@ - + integer(3) diabgc diabgc @@ -4238,7 +4238,7 @@ - + integer(3) diabgc diabgc @@ -4248,7 +4248,7 @@ - + integer(3) diabgc diabgc @@ -4258,7 +4258,7 @@ - + integer(3) diabgc diabgc @@ -4268,7 +4268,7 @@ - + integer(3) diabgc diabgc @@ -4278,7 +4278,7 @@ - + integer(3) diabgc diabgc @@ -4288,7 +4288,7 @@ - + integer(3) diabgc diabgc @@ -4298,7 +4298,7 @@ - + integer(3) diabgc diabgc @@ -4308,7 +4308,7 @@ - + integer(3) diabgc diabgc @@ -4318,7 +4318,7 @@ - + integer(3) diabgc diabgc @@ -4328,7 +4328,7 @@ - + integer(3) diabgc diabgc @@ -4338,7 +4338,7 @@ - + integer(3) diabgc diabgc @@ -4348,7 +4348,7 @@ - + integer(3) diabgc diabgc @@ -4358,7 +4358,7 @@ - + integer(3) diabgc diabgc @@ -4368,7 +4368,7 @@ - + integer(3) diabgc diabgc @@ -4378,7 +4378,7 @@ - + integer(3) diabgc diabgc @@ -4388,7 +4388,7 @@ - + integer(3) diabgc diabgc @@ -4398,7 +4398,7 @@ - + integer(3) diabgc diabgc @@ -4408,7 +4408,7 @@ - + integer(3) diabgc diabgc @@ -4418,7 +4418,7 @@ - + integer(3) diabgc diabgc @@ -4428,7 +4428,7 @@ - + integer(3) diabgc diabgc @@ -4438,7 +4438,7 @@ - + integer(3) diabgc diabgc @@ -4448,7 +4448,7 @@ - + integer(3) diabgc diabgc @@ -4458,7 +4458,7 @@ - + integer(3) diabgc diabgc @@ -4468,7 +4468,7 @@ - + integer(3) diabgc diabgc @@ -4478,7 +4478,7 @@ - + integer(3) diabgc diabgc @@ -4488,7 +4488,7 @@ - + integer(3) diabgc diabgc @@ -4498,7 +4498,7 @@ - + integer(3) diabgc diabgc @@ -4508,7 +4508,7 @@ - + integer(3) diabgc diabgc @@ -4518,7 +4518,7 @@ - + integer(3) diabgc diabgc @@ -4528,7 +4528,7 @@ - + integer(3) diabgc diabgc @@ -4538,7 +4538,7 @@ - + integer(3) diabgc diabgc @@ -4548,7 +4548,7 @@ - + integer(3) diabgc diabgc @@ -4558,7 +4558,7 @@ - + integer(3) diabgc diabgc @@ -4568,7 +4568,7 @@ - + integer(3) diabgc diabgc @@ -4578,7 +4578,7 @@ - + integer(3) diabgc diabgc @@ -4588,7 +4588,7 @@ - + integer(3) diabgc diabgc @@ -4598,7 +4598,7 @@ - + integer(3) diabgc diabgc @@ -4608,7 +4608,7 @@ - + integer(3) diabgc diabgc @@ -4618,7 +4618,7 @@ - + integer(3) diabgc diabgc @@ -4628,7 +4628,7 @@ - + integer(3) diabgc diabgc @@ -4638,7 +4638,7 @@ - + integer(3) diabgc diabgc @@ -4648,7 +4648,7 @@ - + integer(3) diabgc diabgc @@ -4658,7 +4658,7 @@ - + integer(3) diabgc diabgc @@ -4668,7 +4668,7 @@ - + integer(3) diabgc diabgc @@ -4678,7 +4678,7 @@ - + integer(3) diabgc diabgc @@ -4688,7 +4688,7 @@ - + integer(3) diabgc diabgc @@ -4698,7 +4698,7 @@ - + integer(3) diabgc diabgc @@ -4708,7 +4708,7 @@ - + integer(3) diabgc diabgc @@ -4718,7 +4718,7 @@ - + integer(3) diabgc diabgc @@ -4728,7 +4728,7 @@ - + integer(3) diabgc diabgc @@ -4738,7 +4738,7 @@ - + integer(3) diabgc diabgc @@ -4748,7 +4748,7 @@ - + integer(3) diabgc diabgc @@ -4758,7 +4758,7 @@ - + integer(3) diabgc diabgc @@ -4768,7 +4768,7 @@ - + integer(3) diabgc diabgc @@ -4778,7 +4778,7 @@ - + integer(3) diabgc diabgc @@ -4788,7 +4788,7 @@ - + integer(3) diabgc diabgc @@ -4798,7 +4798,7 @@ - + integer(3) diabgc diabgc @@ -4808,7 +4808,7 @@ - + integer(3) diabgc diabgc @@ -4818,7 +4818,7 @@ - + integer(3) diabgc diabgc @@ -4828,7 +4828,7 @@ - + integer(3) diabgc diabgc @@ -4838,7 +4838,7 @@ - + integer(3) diabgc diabgc @@ -4848,7 +4848,7 @@ - + integer(3) diabgc diabgc @@ -4858,7 +4858,7 @@ - + integer(3) diabgc diabgc @@ -4868,7 +4868,7 @@ - + integer(3) diabgc diabgc @@ -4878,7 +4878,7 @@ - + integer(3) diabgc diabgc @@ -4888,7 +4888,7 @@ - + integer(3) diabgc diabgc @@ -4898,7 +4898,7 @@ - + integer(3) diabgc diabgc @@ -4908,7 +4908,7 @@ - + integer(3) diabgc diabgc @@ -4918,7 +4918,7 @@ - + integer(3) diabgc diabgc @@ -4928,7 +4928,7 @@ - + integer(3) diabgc diabgc @@ -4938,7 +4938,7 @@ - + integer(3) diabgc diabgc @@ -4948,7 +4948,7 @@ - + integer(3) diabgc diabgc @@ -4958,7 +4958,7 @@ - + integer(3) diabgc diabgc @@ -4968,7 +4968,7 @@ - + integer(3) diabgc diabgc @@ -4978,7 +4978,7 @@ - + integer(3) diabgc diabgc @@ -4988,7 +4988,7 @@ - + integer(3) diabgc diabgc @@ -4998,7 +4998,7 @@ - + integer(3) diabgc diabgc @@ -5008,7 +5008,7 @@ - + integer(3) diabgc diabgc @@ -5018,7 +5018,7 @@ - + integer(3) diabgc diabgc @@ -5028,7 +5028,7 @@ - + integer(3) diabgc diabgc @@ -5038,7 +5038,7 @@ - + integer(3) diabgc diabgc @@ -5048,7 +5048,7 @@ - + integer(3) diabgc diabgc @@ -5058,7 +5058,7 @@ - + integer(3) diabgc diabgc @@ -5068,7 +5068,7 @@ - + integer(3) diabgc diabgc @@ -5078,7 +5078,7 @@ - + integer(3) diabgc diabgc @@ -5088,7 +5088,7 @@ - + integer(3) diabgc diabgc @@ -5098,7 +5098,7 @@ - + integer(3) diabgc diabgc @@ -5108,7 +5108,7 @@ - + integer(3) diabgc diabgc @@ -5118,7 +5118,7 @@ - + integer(3) diabgc diabgc @@ -5128,7 +5128,7 @@ - + integer(3) diabgc diabgc @@ -5138,7 +5138,7 @@ - + integer(3) diabgc diabgc @@ -5148,7 +5148,7 @@ - + integer(3) diabgc diabgc @@ -5158,7 +5158,7 @@ - + integer(3) diabgc diabgc @@ -5168,7 +5168,7 @@ - + integer(3) diabgc diabgc @@ -5178,7 +5178,7 @@ - + integer(3) diabgc diabgc @@ -5188,7 +5188,7 @@ - + integer(3) diabgc diabgc @@ -5198,7 +5198,7 @@ - + integer(3) diabgc diabgc @@ -5208,7 +5208,7 @@ - + integer(3) diabgc diabgc @@ -5218,7 +5218,7 @@ - + integer(3) diabgc diabgc @@ -5228,7 +5228,7 @@ - + integer(3) diabgc diabgc @@ -5238,7 +5238,7 @@ - + integer(3) diabgc diabgc @@ -5248,7 +5248,7 @@ - + integer(3) diabgc diabgc @@ -5258,7 +5258,7 @@ - + integer(3) diabgc diabgc @@ -5268,7 +5268,7 @@ - + integer(3) diabgc diabgc @@ -5278,7 +5278,7 @@ - + integer(3) diabgc diabgc @@ -5288,7 +5288,7 @@ - + integer(3) diabgc diabgc @@ -5298,7 +5298,7 @@ - + integer(3) diabgc diabgc @@ -5308,7 +5308,7 @@ - + integer(3) diabgc diabgc @@ -5318,7 +5318,7 @@ - + integer(3) diabgc diabgc @@ -5328,7 +5328,7 @@ - + integer(3) diabgc diabgc @@ -5338,7 +5338,7 @@ - + integer(3) diabgc diabgc @@ -5348,7 +5348,7 @@ - + integer(3) diabgc diabgc @@ -5358,7 +5358,7 @@ - + integer(3) diabgc diabgc @@ -5368,7 +5368,7 @@ - + integer(3) diabgc diabgc @@ -5378,7 +5378,7 @@ - + integer(3) diabgc diabgc @@ -5388,7 +5388,7 @@ - + integer(3) diabgc diabgc @@ -5398,7 +5398,7 @@ - + integer(3) diabgc diabgc @@ -5408,7 +5408,7 @@ - + integer(3) diabgc diabgc @@ -5418,7 +5418,7 @@ - + integer(3) diabgc diabgc @@ -5428,7 +5428,7 @@ - + integer(3) diabgc diabgc @@ -5438,7 +5438,7 @@ - + integer(3) diabgc diabgc @@ -5448,7 +5448,7 @@ - + integer(3) diabgc diabgc @@ -5458,7 +5458,7 @@ - + integer(3) diabgc diabgc @@ -5468,7 +5468,7 @@ - + integer(3) diabgc diabgc @@ -5478,7 +5478,7 @@ - + integer(3) diabgc diabgc diff --git a/cime_config/user_nl_blom b/cime_config/user_nl_blom index bdfa712d..15d43301 100644 --- a/cime_config/user_nl_blom +++ b/cime_config/user_nl_blom @@ -1,7 +1,27 @@ -#---------------------------------------------------------------------------------- -# Users should add all user specific namelist changes below in the form of -# namelist_var = new_namelist_value -# Note - that it does not matter what namelist group the namelist_var belongs to -#---------------------------------------------------------------------------------- - +!---------------------------------------------------------------------------------- +! Users should add all user specific namelist changes below in the form of +! namelist_var = new_namelist_value +! +! Note: that it does not matter what namelist group the namelist_var belongs to +! EXCEPT for when a variable appears in more than one namelist +! There are a few history variables that have the same name in both diaphy and diabgc +! For those variables an @diaphy or @diabgc to be appendend for the namelist_var +! GLB_FNAMETAG@diaphy +! GLB_AVEPERIO@diaphy +! GLB_FILEFREQ@diaphy +! GLB_COMPFLAG@diaphy +! GLB_NCFORMAT@diaphy +! LYR_DP@diaphy"> +! GLB_FNAMETAG@diabgc +! GLB_AVEPERIO@diabgc +! GLB_FILEFREQ@diabgc +! GLB_COMPFLAG@diabgc +! GLB_NCFORMAT@diabgc +! LYR_DP@diabgc"> +! +! For example: +! GLB_FNAMETAG@diaphy = 'hd','hd','hd' +! +! To see a full documentation of the namelist variables - see $RUNDIR/ocn_in.readme +!---------------------------------------------------------------------------------- From f5447c0172535ae34f77e59af9a91e8f46e31507 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 17 Jul 2023 10:18:18 +0200 Subject: [PATCH 09/33] cleanup of python code --- cime_config/user_nl_blom | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cime_config/user_nl_blom b/cime_config/user_nl_blom index 15d43301..00abb174 100644 --- a/cime_config/user_nl_blom +++ b/cime_config/user_nl_blom @@ -2,10 +2,11 @@ ! Users should add all user specific namelist changes below in the form of ! namelist_var = new_namelist_value ! -! Note: that it does not matter what namelist group the namelist_var belongs to +! NOTE: that it does not matter what namelist group the namelist_var belongs to ! EXCEPT for when a variable appears in more than one namelist ! There are a few history variables that have the same name in both diaphy and diabgc ! For those variables an @diaphy or @diabgc to be appendend for the namelist_var +! ! GLB_FNAMETAG@diaphy ! GLB_AVEPERIO@diaphy ! GLB_FILEFREQ@diaphy @@ -22,6 +23,12 @@ ! For example: ! GLB_FNAMETAG@diaphy = 'hd','hd','hd' ! +! NOTE: the array sections for MER_REGFLG must be entered as +! MER_REGFLG1 - sets MER_REGFLG(1,:) +! MER_REGFLG2 - sets MER_REGFLG(2,:) +! MER_REGFLG3 - sets MER_REGFLG(3,:) +! MER_REGFLG4 - sets MER_REGFLG(4,:) + ! To see a full documentation of the namelist variables - see $RUNDIR/ocn_in.readme !---------------------------------------------------------------------------------- From 7204f2e558ecbba7e4b8f00d1c9be4b03aabb19b Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Tue, 25 Jul 2023 14:20:18 +0200 Subject: [PATCH 10/33] updates as part of testing --- cime_config/namelist_definition_blom.xml | 77 ++++++++++++++---------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 66defd0f..bcf121e7 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -108,7 +108,7 @@ limits limits - UNSET + unset $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx2v1_20130206.nc $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx1v4_20170622.nc $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.25v4_20170622.nc @@ -123,7 +123,7 @@ limits limits - UNSET + unset $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx2v1_20130419.nc $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx1v4_20170622.nc $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.25v4_20170623.nc @@ -183,10 +183,10 @@ .02 2. - .0015 - .15 - .001 - .1 + .15 + .0015 + .1 + .001 @@ -198,10 +198,10 @@ .004 .4 - .0015 - .15 - .001 + .15 + .0015 .1 + .001 @@ -233,8 +233,10 @@ 5000. 5000.e4 - 300. - 300.e4 + 300.e4 + 300. + 300.e4 + 300. @@ -246,8 +248,10 @@ 300. 300.e4 - 300. - 300.e4 + 300.e4 + 300. + 100.e4 + 100. @@ -327,9 +331,9 @@ limits 5.e-5 - .75e-4 - 0.75e-4 - 0.75e-4 + .75e-4 + 0.75e-4 + .75e-4 @@ -410,7 +414,7 @@ limits .06 - .5 + .5 1.0 @@ -437,7 +441,7 @@ limits 0. - .4 + .4 @@ -652,7 +656,7 @@ limits .true. - .false. + .false. @@ -1027,7 +1031,8 @@ 100. 100.e4 - 0. + 0. + 0. @@ -1043,7 +1048,8 @@ 1000.e4 1000. 1000.e4 - 0. + 0. + 0. @@ -1213,7 +1219,7 @@ cwmod cwmod - UNSET + unset 'Gibraltar','Gibraltar' 'Gibraltar','Gibraltar' @@ -1225,8 +1231,10 @@ cwmod cwmod + 'unset','unset' 'u','u' 'u','u' + @@ -1236,6 +1244,7 @@ cwmod cwmod + -999,-999 53,54 105,106 @@ -1247,6 +1256,7 @@ cwmod cwmod + -999,-999 137,137 273,273 @@ -1258,6 +1268,7 @@ cwmod cwmod + 1.e36,1.e36 30.e3,30.e3 30.e3,30.e3 @@ -3059,7 +3070,7 @@ UNSET $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx2v1_20190826.dat $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx1v4_20190615.dat - $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat + $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat abs @@ -3218,17 +3229,17 @@ bgcnml ' ' - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx2v1_20180321.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx2v1_20180321.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_CMIP6_tnx2v1_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx2v1_20190702.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx1v4_20171106.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.25v4_20190912.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_cmip6_tnx0.125v4_20221013.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx2v1_20200826.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx1v4_20200826.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_cmip6_tnx0.25v4_20200826.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx2v1_20190702.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx1v4_20180613.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx0.25v4_20190705.nc - $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_CMIP6_tnx1v4_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx1v4_20180613.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx0.25v4_20190912.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_CMIP6_tnx0.25v4_20200826.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx0.25v4_20190705.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx0.125v4_20221013.nc abs File name (incl. full path) for atmopheric N-deposition data From 85582092367a8b732ffaa342a488032be5959a45 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Tue, 25 Jul 2023 18:02:04 +0200 Subject: [PATCH 11/33] more bug fixes from testing --- cime_config/namelist_definition_blom.xml | 62 ++++++++++++++++-------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index bcf121e7..bb63d0fa 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -115,7 +115,7 @@ $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.125v4_20221013.nc abs - + Name of file containing grid specification @@ -130,7 +130,11 @@ $DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.125v4_20230318.nc abs - + + Name of file containing initial conditions, that is either a + valid restart file or 'inicon.nc' if climatological based + initial conditions are desired. + @@ -432,7 +436,10 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.125v4_20221013.nc abs - + + Name of file containing tidal wave energy dissipation divided by + by bottom buoyancy frequency + @@ -507,7 +514,9 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.125v4_20221013.nc abs - + + Name of file containing chlorophyll concentration climatology + @@ -637,7 +646,9 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20221013.nc abs - + + Name of file containing SSS climatology used for relaxation + @@ -1069,9 +1080,10 @@ diffusion diffusion - unset + UNSET - + abs + Name of file containing topographic beta parameter @@ -1292,7 +1304,10 @@ $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.125v4_20221013.dat abs - + + Name of file containing section specification for section + transport computation + @@ -3046,7 +3061,6 @@ - char merdia @@ -3163,7 +3177,7 @@ bgcnml bgcnml - ' ' + UNSET $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx2v1_20130506.nc $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx1v4_20171107.nc $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.25v4_20181004.nc @@ -3201,7 +3215,7 @@ bgcnml bgcnml - ' ' + UNSET $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx2v1_20170915.nc $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx1v4_20170820.nc $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.25v4_20170821.nc @@ -3228,7 +3242,7 @@ bgcnml bgcnml - ' ' + UNSET $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx2v1_20180321.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_CMIP6_tnx2v1_20200826.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx2v1_20190702.nc @@ -3403,9 +3417,12 @@ bgcnml bgcnml - ' ' + UNSET - + abs + + File name (incl. full path) for surface PI pH input data. + @@ -3423,13 +3440,17 @@ bgcnml bgcnml - ' ' + UNSET - + abs + + File name (incl. full path) for sediment porosity + + @@ -3437,7 +3458,7 @@ bgcoafx bgcoafx - ' ' + UNSET @@ -3447,9 +3468,12 @@ bgcoafx bgcoafx - ' ' + UNSET - + abs + + Full path of the input file for the alkalinization scenario 'file' + From 96c6d8d8d1380be0517c3ae556f54c7aaa0581ca Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Tue, 25 Jul 2023 21:11:46 +0200 Subject: [PATCH 12/33] added descriptions --- cime_config/namelist_definition_blom.xml | 680 +++++++++++------------ cime_config/ocn_in.readme | 4 +- 2 files changed, 340 insertions(+), 344 deletions(-) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index bb63d0fa..6038454c 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -39,7 +39,7 @@ 0 - + First day of integration (i) @@ -49,7 +49,7 @@ 0 - + Last day of integration (i) @@ -59,7 +59,7 @@ 9999999 - + Model date in YYYYMMDD (i) @@ -69,7 +69,7 @@ 9999999 - + Initial experiment date in YYYYMMDD (i) @@ -78,7 +78,7 @@ unset - + Experiment name (a) char @@ -89,7 +89,7 @@ cesm - + Experiment configuration (a) @@ -100,7 +100,7 @@ $RUN_TYPE continue - + run type (a) @@ -115,7 +115,7 @@ $DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.125v4_20221013.nc abs - Name of file containing grid specification + Name of file containing grid specification (a)Name of file containing grid specification @@ -145,7 +145,7 @@ 2000.e4 2000.e5 - + Reference pressure for potential density (g/cm/s2) (f) @@ -161,7 +161,7 @@ 900. 300. - + Baroclinic time step (sec) (f) @@ -177,7 +177,7 @@ 15. 6. - + Barotropic time step (sec) (f) @@ -192,7 +192,7 @@ .1 .001 - + Laplacian diffusion velocity for momentum dissipation (cm/s) (f) @@ -207,7 +207,7 @@ .1 .001 - + Laplacian diffusion velocity for momentum dissipation (cm/s) (f) @@ -217,7 +217,7 @@ 0. - + Biharmonic diffusion velocity for momentum dissipation (cm/s) (f) @@ -227,7 +227,7 @@ 0. - + Biharmonic diffusion velocity for momentum dissipation (cm/s) (f) @@ -242,7 +242,7 @@ 300.e4 300. - + Laplacian diffusivity for momentum dissipation (cm**2/s) (f) @@ -257,7 +257,7 @@ 100.e4 100. - + Laplacian diffusivity for momentum dissipation (cm**2/s) (f) @@ -269,7 +269,7 @@ .15 0. - + Parameter in deformation-dependent Laplacian viscosity (f) @@ -281,7 +281,7 @@ .15 0. - + Parameter in deformation-dependent Laplacian viscosity (f) @@ -293,7 +293,7 @@ 0.0625 0.06 - + Parameter in deformation-dependent Biharmonic viscosity (f) @@ -305,7 +305,7 @@ 0.0625 0.06 - + Parameter in deformation-dependent Biharmonic viscosity (f) @@ -316,7 +316,7 @@ .05 5. - + rms flow speed for linear bottom friction law (cm/s) (f) @@ -326,7 +326,7 @@ .002 - + Nondiemnsional coefficient of quadratic bottom friction (f) @@ -339,7 +339,7 @@ 0.75e-4 .75e-4 - + Coastal wave breaking damping resiprocal time scale (1/s) (f) @@ -349,7 +349,7 @@ 25. - + Coastal wave breaking damping length scale (m) (f) @@ -359,7 +359,7 @@ enscon - + Momentum equation discretization method. Valid methods: @@ -369,7 +369,7 @@ uc - + Baroclinic mass flux correction method. Valid methods: @@ -379,7 +379,7 @@ eitvel - + Method of applying eddy-induced transport in the remap @@ -389,7 +389,7 @@ constant - + Type of mixed layer restratification time scale. Valid @@ -399,7 +399,7 @@ 1.2 - + Efficiency factor of wind TKE generation in the Oberhuber @@ -409,7 +409,7 @@ 0. - + Efficiency factor of TKE generation by momentum @@ -421,7 +421,7 @@ .5 1.0 - + Efficiency factor for the restratification by mixed layer @@ -450,7 +450,7 @@ 0. .4 - + Global factor applied to the energy input by near-intertial @@ -460,7 +460,7 @@ .35 - + Fraction of near-inertial energy dissipated in the boundary @@ -470,7 +470,7 @@ .5 - + Fraction of near-inertial energy dissipated locally beneath @@ -480,7 +480,7 @@ jerlov - + Shortwave radiation absorption method. Valid methods: @@ -490,7 +490,7 @@ 3 - + Number indicating the Jerlov (1968) water type (i) @@ -500,7 +500,7 @@ climatology - + Chlorophyll concentration option. Valid options: @@ -526,7 +526,7 @@ 0. - + e-folding time scale (days) for SST relax., if 0 no relax. (f) @@ -538,7 +538,7 @@ 60. 6. - + e-folding time scale (days) for SSS relax., if 0 no relax. (f) @@ -548,7 +548,7 @@ 1. - + Maximum mixed layer depth for e-folding SST relaxation (m) (f) @@ -560,7 +560,7 @@ 1. 10. - + Maximum mixed layer depth for e-folding SSS relaxation (m) (f) @@ -570,7 +570,7 @@ 1.5 - + Max. absolute value of SST difference in relaxation (degC) (f) @@ -580,7 +580,7 @@ .5 - + Max. absolute value of SSS difference in relaxation (psu) (f) @@ -590,7 +590,7 @@ .false. - + Apply diagnosed heat flux flag (l) @@ -600,7 +600,7 @@ .false. - + Apply diagnosed freshwater flux flag (l) @@ -610,7 +610,7 @@ .false. - + Diagnose heat flux flag (l) @@ -620,7 +620,7 @@ .false. - + Diagnose freshwater flux flag (l) @@ -631,7 +631,7 @@ .false. .true. - + Balance the SSS relaxation (l) @@ -646,7 +646,7 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20221013.nc abs - + Name of file containing SSS climatology used for relaxation (a) Name of file containing SSS climatology used for relaxation @@ -658,7 +658,7 @@ none - + Source of wave fields. Valid source: 'none', 'param', 'extern' (a) @@ -669,7 +669,7 @@ .true. .false. - + Smooth NorESM forcing (l) @@ -680,7 +680,7 @@ .false. .true. - + Send precipitation/runoff factor to NorESM coupler (l) @@ -690,7 +690,7 @@ unset - + Path to forcing fields in case of EXPCNF 'ben02clim' or @@ -700,7 +700,7 @@ 60 - + Global i-index of point diagnostics (i) @@ -710,7 +710,7 @@ 60 - + Global j-index of point diagnostics (i) @@ -720,7 +720,7 @@ .false. - + Conservation diagnostics flag (l) @@ -730,7 +730,7 @@ .false. - + Checksum diagnostics flag (l) @@ -740,7 +740,7 @@ 1 - + Restart frequency in days (30=1month,365=1year) (i) @@ -751,7 +751,7 @@ 0 1 - + Format of restart file (valid arguments are 0 for classic, @@ -761,7 +761,7 @@ 0 - + Compression flag for restart file (i) @@ -772,20 +772,13 @@ 0 1 - + 0 = netcdf, 1 = pnetcdf - - - - - - - char vcoord @@ -957,7 +950,7 @@ gm - + Eddy-induced transport parameterization method. Valid @@ -967,7 +960,7 @@ "large scale" - + Type of Richardson number used in eddy diffusivity @@ -979,7 +972,7 @@ step step - + Method to estimate eddy diffusivity weight as a function of @@ -989,7 +982,7 @@ .false. - + If true, eddy diffusivity has a 2d structure (l) @@ -999,7 +992,7 @@ .true. - + Apply eddy mixing suppression away from steering level (l) @@ -1011,7 +1004,7 @@ 0.5 0.5 - + Parameter c in Eden and Greatbatch (2008) parameterization (f) @@ -1021,7 +1014,7 @@ 200. - + Parameter gamma in E. and G. (2008) param. (f) @@ -1032,7 +1025,7 @@ 4000. 4000.e2 - + Minimum eddy length scale in E. and G. (2008) param. (cm) (f) @@ -1045,7 +1038,7 @@ 0. 0. - + Minimum diffusivity in E. and G. (2008) param. (cm**2/s) (f) @@ -1062,7 +1055,7 @@ 0. 0. - + Maximum diffusivity in E. and G. (2008) param. (cm**2/s) (f) @@ -1072,7 +1065,7 @@ 1. - + Factor relating the isopycnal diffusivity to the layer @@ -1083,7 +1076,7 @@ UNSET abs - Name of file containing topographic beta parameter + Name of file containing topographic beta parameter (a)Name of file containing topographic beta parameter @@ -1093,7 +1086,7 @@ 0. - + Linear scaling parameter for topographic rhines scale () (f) @@ -1103,7 +1096,7 @@ .false. - + If true, apply anisotropy correction to eddy diffusivity (l) @@ -1113,7 +1106,7 @@ .false. - + If true, then isopycnal/neutral diffusion will have 3D @@ -1123,7 +1116,7 @@ .false. - + If true, use the minimum of planetary and topographic beta @@ -1133,7 +1126,7 @@ 1.2 - + Critical gradient richardson number for shear driven @@ -1143,7 +1136,7 @@ 2 - + Type of background diapycnal mixing. If bdmtyp=1 the @@ -1154,7 +1147,7 @@ 5.e-8 5.e-4 - + Background diapycnal diffusivity times buoyancy frequency @@ -1165,7 +1158,7 @@ 1.e-5 .1 - + Background diapycnal diffusivity (cm**2/s) (f) @@ -1176,7 +1169,7 @@ .false. .true. - + Make the background mixing latitude dependent according to @@ -1186,7 +1179,7 @@ .006 - + Fraction of surface TKE that penetrates beneath mixed layer @@ -1196,7 +1189,7 @@ .true. - + If true, apply lateral smoothing of CVMix estimated @@ -1206,7 +1199,7 @@ none - + Type of CVMix Langmuir turbulence parameterization. Valid @@ -1219,7 +1212,7 @@ layer layer - + Type of lateral tracer eddy diffusion: Valid methods: @@ -1235,7 +1228,7 @@ 'Gibraltar','Gibraltar' 'Gibraltar','Gibraltar' - + Array of geographical names of channels to be modified (a) @@ -1248,7 +1241,7 @@ 'u','u' - + Array of C grid cell edges to be modified. Valid options: @@ -1256,11 +1249,11 @@ cwmod cwmod - -999,-999 + -999,-999 53,54 105,106 - + Array of grid cell i-indices (i) @@ -1272,7 +1265,7 @@ 137,137 273,273 - + Array of grid cell j-indices (i) @@ -1285,7 +1278,7 @@ 30.e3,30.e3 - + Array of modified grid cell widths (m) (f) @@ -1322,7 +1315,7 @@ 'hd','hm','hy' - + tag used in file name (c10) @@ -1332,7 +1325,7 @@ 1,30,365 - + average period in days @@ -1343,7 +1336,7 @@ 30,30,365 1,30,365 - + how often to start a new file in days @@ -1353,7 +1346,7 @@ 0,0,0 - + switch for compressed/uncompressed output @@ -1364,7 +1357,10 @@ 0,0,0 1,1,1 - + + netcdf format (valid arguments are 0 for classic, 1 for 64-bit + offset and 2 for netcdf4/hdf5 format) + @@ -1374,7 +1370,7 @@ 0,4,0 - + absolute wind speed [m s-1] @@ -1384,7 +1380,7 @@ 0,0,0 - + surface albedo [] @@ -1394,7 +1390,7 @@ 0,4,0 - + Barotropic mass streamfunction [kg s-1] @@ -1404,7 +1400,7 @@ 0,4,0 - + brine flux [kg m-2 s-1] @@ -1414,7 +1410,7 @@ 0,4,0 - + brine plume depth [m] @@ -1424,7 +1420,7 @@ 0,0,0 - + non-solar heat flux derivative [W m-2 K-1] @@ -1434,7 +1430,7 @@ 0,4,0 - + evaporation [kg m-2 s-1] @@ -1444,7 +1440,7 @@ 0,4,0 - + ice concentration [%] @@ -1454,7 +1450,7 @@ 0,4,0 - + fresh water flux due to melting/freezing [kg m-2 s-1] @@ -1464,7 +1460,7 @@ 0,0,0 - + ice thickness [m] @@ -1474,7 +1470,7 @@ 0,4,0 - + heat flux due to melting/freezing [W m-2] @@ -1484,7 +1480,7 @@ 0,0,0 - + snow depth [m] @@ -1494,7 +1490,7 @@ 0,0,0 - + ice age [d] @@ -1504,7 +1500,7 @@ 0,4,0 - + mixed layer inertial kinetic energy tendency [kg s-3] @@ -1514,7 +1510,7 @@ 0,4,0 - + Langmuir enhancement factor [] @@ -1524,7 +1520,7 @@ 0,4,0 - + Surface layer averaged Langmuir number [] @@ -1534,7 +1530,7 @@ 0,4,0 - + liquid precipitation [kg m-2 s-1] @@ -1544,7 +1540,7 @@ 4,4,0 - + maximum mixed layer depth [m] @@ -1554,7 +1550,7 @@ 0,4,0 - + mixed layer depth [m] @@ -1564,7 +1560,7 @@ 4,4,0 - + mixed layer thickness using "sigma-t" criterion [m] @@ -1574,7 +1570,7 @@ 0,4,0 - + minimum mixed layer thickness using "sigma-t" criterion [m] @@ -1584,7 +1580,7 @@ 0,4,0 - + maximum mixed layer thickness using "sigma-t" criterion [m] @@ -1594,7 +1590,7 @@ 0,4,0 - + mixed layer thickness squared using "sigma-t" criterion [m2] @@ -1604,7 +1600,7 @@ 0,4,0 - + mixed layer TKE tendency related to friction velocity [kg s-3] @@ -1614,7 +1610,7 @@ 0,4,0 - + mixed layer TKE tendency related to near inertial mot. [kg s-3] @@ -1624,7 +1620,7 @@ 0,4,0 - + mixed layer TKE tendency related to buoyancy forcing [kg s-3] @@ -1634,7 +1630,7 @@ 0,4,0 - + mixed layer TKE tendency related to eddy restrat. [kg s-3] @@ -1644,7 +1640,7 @@ 0,4,0 - + mixed layer TKE tendency related to pot. energy change [kg s-3] @@ -1654,7 +1650,7 @@ 0,4,0 - + mixed layer TKE tendency related to kin. energy change [kg s-3] @@ -1664,7 +1660,7 @@ 0,4,0 - + wind stress y-component [N m-2] @@ -1674,7 +1670,7 @@ 0,4,0 - + non-solar heat flux [W m-2] @@ -1684,7 +1680,7 @@ 0,4,0 - + bottom pressure [Pa] @@ -1694,7 +1690,7 @@ 0,4,0 - + surface pressure [Pa] @@ -1704,7 +1700,7 @@ 0,4,0 - + frozen runoff [kg m-2 s-1] @@ -1714,7 +1710,7 @@ 0,4,0 - + liquid runoff [kg m-2 s-1] @@ -1724,7 +1720,7 @@ 0,4,0 - + salt flux received by ocean [kg m-2 s-1] @@ -1734,7 +1730,7 @@ 0,4,0 - + restoring salt flux received by ocean [kg m-2 s-1] @@ -1744,7 +1740,7 @@ 0,4,0 - + bottom salinity [g kg-1] @@ -1754,7 +1750,7 @@ 4,4,0 - + sea level [m] @@ -1764,7 +1760,7 @@ 0,4,0 - + sea level squared [m2] @@ -1774,7 +1770,7 @@ 0,4,0 - + salt flux [kg m-2 s-1] @@ -1784,7 +1780,7 @@ 0,4,0 - + solid precipitation [kg m-2 s-1] @@ -1794,7 +1790,7 @@ 0,4,0 - + mixed layer density [kg m-3] @@ -1804,7 +1800,7 @@ 4,4,0 - + ocean surface salinity [g kg-1] @@ -1814,7 +1810,7 @@ 4,4,0 - + ocean surface salinity squared [g2 kg-2] @@ -1824,7 +1820,7 @@ 4,4,0 - + ocean surface temperature [degC] @@ -1834,7 +1830,7 @@ 4,4,0 - + ocean surface temperature squared [degC2] @@ -1844,7 +1840,7 @@ 0,4,0 - + heat flux received by ocean [W m-2] @@ -1854,7 +1850,7 @@ 0,4,0 - + restoring heat flux received by ocean [W m-2] @@ -1864,7 +1860,7 @@ 0,4,0 - + short-wave heat flux [W m-2] @@ -1874,7 +1870,7 @@ 4,4,0 - + 20C isoterm depth [m] @@ -1884,7 +1880,7 @@ 0,4,0 - + momentum flux received by ocean x-component [N m-2] @@ -1894,7 +1890,7 @@ 0,4,0 - + momentum flux received by ocean y-component [N m-2] @@ -1904,7 +1900,7 @@ 0,4,0 - + bottom temperature [degC] @@ -1914,7 +1910,7 @@ 0,0,0 - + ice temperature [degC] @@ -1924,7 +1920,7 @@ 0,0,0 - + surface temperature [degC] @@ -1934,7 +1930,7 @@ 0,4,0 - + barotropic velocity x-component [m s-1] @@ -1944,7 +1940,7 @@ 0,0,0 - + ice velocity x-component [m s-1] @@ -1954,7 +1950,7 @@ 0,4,0 - + friction velocity [m s-1] @@ -1964,7 +1960,7 @@ 0,4,0 - + friction velocity cubed [m3 s-3] @@ -1974,7 +1970,7 @@ 0,0,0 - + surface Stokes drift x-componen [m s-1] @@ -1984,7 +1980,7 @@ 0,4,0 - + barotropic velocity y-component [m s-1] @@ -1994,7 +1990,7 @@ 0,0,0 - + ice velocity y-component [m s-1] @@ -2004,7 +2000,7 @@ 0,0,0 - + surface Stokes drift y-componen [m s-1] @@ -2014,7 +2010,7 @@ 0,4,0 - + wind stress x-component [N m-2] @@ -2024,7 +2020,7 @@ 0,4,0 - + buoyancy frequency squared [s-1] @@ -2034,7 +2030,7 @@ 0,4,0 - + vertical diffusivity [log10(m2 s-1)|m2 s-1] @@ -2044,7 +2040,7 @@ 0,4,0 - + vertical momentum diffusivity [log10(m2 s-1)|m2 s-1] @@ -2054,7 +2050,7 @@ 0,4,0 - + vertical heat diffusivity [log10(m2 s-1)|m2 s-1] @@ -2064,7 +2060,7 @@ 0,4,0 - + vertical salt diffusivity [log10(m2 s-1)|m2 s-1] @@ -2074,7 +2070,7 @@ 0,4,0 - + layer interface diffusivity [log10(m2 s-1)] @@ -2084,7 +2080,7 @@ 0,4,0 - + isopycnal diffusivity [log10(m2 s-1)] @@ -3073,7 +3069,7 @@ $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.125v4_20221013.nc abs - + Name of file containing ocean region specification (a) @@ -3088,7 +3084,7 @@ $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat abs - + Name of file containing zonal section specification for @@ -3098,7 +3094,7 @@ 'atlantic_arctic_ocean','atlantic_arctic_extended_ocean','indian_pacific_ocean','global_ocean' - + Array of region names for meridional overturning and flux @@ -3277,7 +3273,7 @@ .false. .true. - Logical switch to activate sediment spin-up + Logical switch to activate sediment spin-upLogical switch to activate sediment spin-up @@ -3288,7 +3284,7 @@ -1 $HAMOCC_SEDSPINUP_YR_START - + Start year for sediment spinup @@ -3299,7 +3295,7 @@ -1 $HAMOCC_SEDSPINUP_YR_END - + End year for sediment spinup @@ -3309,7 +3305,7 @@ -1 - + Number of subcyles per time-step for sediment spinup @@ -3460,7 +3456,7 @@ UNSET - + Name of alkalinization scenario ('const', 'ramp', or 'file') @@ -3483,7 +3479,7 @@ 0.135 - + Pmol alkalinity/yr added in 'const' or 'ramp' scenarios @@ -3493,7 +3489,7 @@ 70.0 - + Max latitude where alkalinity is added in 'const' or 'ramp' scenarios @@ -3503,7 +3499,7 @@ -60.0 - + Min latitude where alkalinity is added in 'const' or 'ramp' scenarios @@ -3513,7 +3509,7 @@ 2025 - + Start year for ramp up in 'ramp' scenario @@ -3523,7 +3519,7 @@ 2035 - + End year for ramp up in 'ramp' scenario @@ -3599,7 +3595,7 @@ 0, 2, 2 - + Phosphorus (po4) [mol P m-3] @@ -3609,7 +3605,7 @@ 0, 2, 2 - + Oxygen (o2) [mol O2 m-3] @@ -3619,7 +3615,7 @@ 0, 2, 2 - + Dissolved iron (dfe) [mol Fe m-3] @@ -3629,7 +3625,7 @@ 0, 2, 2 - + Nitrate (no3) [mol N m-3] @@ -3639,7 +3635,7 @@ 4, 2, 2 - + Natural alkalinity (nattalk) [eq m-3] @@ -3659,7 +3655,7 @@ 4, 2, 2 - + Dissolved carbon (dissic) [mol C m-3] @@ -3669,7 +3665,7 @@ 4, 2, 2 - + Phytoplankton (phyc) [mol C m-3] @@ -3679,7 +3675,7 @@ 0, 2, 2 - + pH (ph) [-log10([h+])] @@ -3689,7 +3685,7 @@ 0, 2, 2 - + Export production (epc100) [mol C m-2 s-1] @@ -3699,7 +3695,7 @@ 0, 2, 2 - + Si export production (epsi100) [mol Si m-2 s-1] @@ -3709,7 +3705,7 @@ 0, 2, 2 - + Ca export production (epcalc100) [mol Ca m-2 s-1] @@ -3719,7 +3715,7 @@ 0, 2, 2 - + Piston velocity (kwco2) [m s-1] @@ -3729,7 +3725,7 @@ 0, 2, 2 - + Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1] @@ -3739,7 +3735,7 @@ 0, 2, 2 - + Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1] @@ -3749,7 +3745,7 @@ 0, 2, 2 - + CO2 solubility under moist air assumption (kh) [mol kg-1 atm-1] @@ -3759,7 +3755,7 @@ 0, 2, 2 - + Natural surface PCO2 (spco2) [uatm] @@ -3769,7 +3765,7 @@ 0, 2, 2 - + Surface PCO2 under moist air assumption [uatm] @@ -3779,7 +3775,7 @@ 4, 2, 2 - + Downward CO2 flux (co2fxd) [kg C m-2 s-1] @@ -3789,7 +3785,7 @@ 4, 2, 2 - + Upward CO2 flux (co2fxu) [kg C m-2 s-1] @@ -3799,7 +3795,7 @@ 0, 2, 2 - + Oxygen flux (fgo2) [mol O2 m-2 s-1] @@ -3809,7 +3805,7 @@ 0, 2, 2 - + Nitrogen flux (fgn2) [mol N2 m-2 s-1] @@ -3819,7 +3815,7 @@ 0, 0, 2 - + Nitrous oxide flux [mol N2O m-2 s-1] @@ -3829,7 +3825,7 @@ 0, 2, 2 - + DMS flux (dmsflux) [mol DMS m-2 s-1] @@ -3839,7 +3835,7 @@ 0, 2, 2 - + surface DMS concentration (dms) [mol DMS m-3] @@ -3849,7 +3845,7 @@ 0, 2, 2 - + DMS production (dmsprod) [mol DMS m-2 s-1] @@ -3859,7 +3855,7 @@ 0, 2, 2 - + DMS bacterial consuption (dms_bac) [mol DMS m-2 s-1] @@ -3869,7 +3865,7 @@ 0, 2, 2 - + DMS decomposition by UV (dms_uv) [mol DMS m-2 s-1] @@ -3879,7 +3875,7 @@ 0, 2, 2 - + Atmospheric CO2 (atmco2) [ppm] @@ -3889,7 +3885,7 @@ 0, 2, 2 - + Atmospheric O2 (atmo2) [ppm] @@ -3899,7 +3895,7 @@ 0, 2, 2 - + Atmospheric N2 (atmn2) [ppm] @@ -3909,7 +3905,7 @@ 0, 2, 2 - + Natural dissolved carbon (natdissic) [mol C m-3] @@ -3919,7 +3915,7 @@ 0, 2, 2 - + Natural alkalinity (nattalk) [eq m-3] @@ -3929,7 +3925,7 @@ 0, 2, 2 - + Natural pH (natph) [-log10([h+])] @@ -3939,7 +3935,7 @@ 0, 2, 2 - + Natural surface PCO2 (spco2) [uatm] @@ -3949,7 +3945,7 @@ 0, 2, 2 - + Natural net CO2 flux (natco2fx) [kg C m-2 s-1] @@ -3959,7 +3955,7 @@ 0, 2, 2 - + Downward 13CO2 flux (co213fxd) [kg C m-2 s-1] @@ -3969,7 +3965,7 @@ 0, 2, 2 - + Upward 13CO2 flux (co213fxu) [kg C m-2 s-1] @@ -3979,7 +3975,7 @@ 0, 2, 2 - + Downward 14CO2 flux (co214fxd) [kg C m-2 s-1] @@ -3989,7 +3985,7 @@ 0, 2, 2 - + Upward 14CO2 flux (co214fxu) [kg C m-2 s-1] @@ -3999,7 +3995,7 @@ 0, 2, 2 - + CFC11 flux [mol CFC11 m-2 s-1] @@ -4009,7 +4005,7 @@ 0, 2, 2 - + CFC12 flux [mol CFC12 m-2 s-1] @@ -4019,7 +4015,7 @@ 0, 2, 2 - + SF6 flux [mol SF6 m-2 s-1] @@ -4069,7 +4065,7 @@ 4, 2, 2 - + Primary production (pp) [mol C m-3 s-1] @@ -4079,7 +4075,7 @@ 0, 2, 2 - + Vertically integrated nitrogen fixation @@ -4089,7 +4085,7 @@ 0, 2, 2 - + Vertically integrated denitrification @@ -4100,7 +4096,7 @@ 0,0,0 0, 2, 2 - + Nitrogen deposition flux [mol N m-2 s-1] @@ -4110,7 +4106,7 @@ 0, 0, 0 - + AMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT @@ -4340,7 +4336,7 @@ 0, 0, 2 - + Phosphorus (po4) [mol P m-3] @@ -4350,7 +4346,7 @@ 0, 0, 4 - + Oxygen (o2) [mol O2 m-3] @@ -4360,7 +4356,7 @@ 0, 0, 2 - + Dissolved iron (dfe) [mol Fe m-3] @@ -4420,7 +4416,7 @@ 0, 0, 2 - + CaCO3 shells (calc) [mol C m-3] @@ -4430,7 +4426,7 @@ 0, 0, 2 - + Opal shells (opal) [mol Si m-3] @@ -4440,7 +4436,7 @@ 0, 0, 2 - + Carbonate ions (co3) [mol C m-3] @@ -4450,7 +4446,7 @@ 0, 0, 0 - + Nitrous oxide concentration [mol N2O m-3] @@ -4470,7 +4466,7 @@ 0, 0, 2 - + Calcite saturation state (omegac) [1] @@ -4480,7 +4476,7 @@ 0, 0, 2 - + Natural aragonite saturation state (natomegaa) [1] @@ -4490,7 +4486,7 @@ 0, 0, 4 - + preformed oxygen (p_o2) [mol O2 m-3] @@ -4500,7 +4496,7 @@ 0, 0, 4 - + Saturated oxygen (satoxy) [mol O2 m-3] @@ -4520,7 +4516,7 @@ 0, 0, 2 - + preformed alkalinity (p_talk) [eq m-3] @@ -4530,7 +4526,7 @@ 0, 0, 2 - + preformed DIC (p_dic) [mol C m-3] @@ -4540,7 +4536,7 @@ 0, 0, 2 - + saturated DIC (dic_sat) [mol C m-3] @@ -4550,7 +4546,7 @@ 0, 0, 2 - + Natural dissolved carbon (natdissic) [mol C m-3] @@ -4560,7 +4556,7 @@ 0, 0, 2 - + Natural alkalinity (nattalk) [eq m-3] @@ -4570,7 +4566,7 @@ 0, 0, 2 - + Natural carbonate ion concentration (natco3) [mol C m-3] @@ -4580,7 +4576,7 @@ 0, 0, 2 - + Natural CaCO3 shells (natcalc) [mol C m-3] @@ -4590,7 +4586,7 @@ 0, 0, 2 - + Natural pH (natph) [-log10([h+])] @@ -4600,7 +4596,7 @@ 0, 0, 2 - + Natural calcite saturation state (natomegac) [1] @@ -4610,7 +4606,7 @@ 0, 0, 2 - + Natural aragonite saturation state (natomegaa) [1] @@ -4620,7 +4616,7 @@ 0, 0, 2 - + Dissolved C13 (dissic13) [mol C m-3] @@ -4630,7 +4626,7 @@ 0, 0, 2 - + Dissolved C14 (dissic14) [mol C m-3] @@ -4640,7 +4636,7 @@ 0, 0, 2 - + at-depth variable sediment porosity (as opposed to default: only depth) @@ -4650,7 +4646,7 @@ 0, 0, 2 - + delta 14C of DIC [1] @@ -4660,7 +4656,7 @@ 0, 0, 2 - + Delta 14C of DIC [1] @@ -4670,7 +4666,7 @@ 0, 0, 2 - + Particulate organic carbon 13 (detoc13) [mol C m-3] @@ -4680,7 +4676,7 @@ 0, 0, 2 - + Dissolved organic carbon 13 (dissoc13) [mol C m-3] @@ -4690,7 +4686,7 @@ 0, 0, 2 - + Particulate inorganic carbon 13 (calc13) [mol C m-3] @@ -4700,7 +4696,7 @@ 0, 0, 2 - + 13C of phytoplankton biomass (phyc13) [mol C m-3] @@ -4710,7 +4706,7 @@ 0, 0, 2 - + 13C of zootoplankton biomass (zooc13) [mol C m-3] @@ -4720,7 +4716,7 @@ 0, 0, 2 - + CFC11 concentration [mol CFC11 m-3] @@ -4730,7 +4726,7 @@ 0, 0, 2 - + CFC12 concentration [mol CFC12 m-3] @@ -4740,7 +4736,7 @@ 0, 0, 2 - + SF6 concentration [mol SF6 m-3] @@ -4750,7 +4746,7 @@ 0, 0, 2 - + ndex of point diagnostics (i) @@ -4760,7 +4756,7 @@ 0, 0, 2 - + Mass sinking velocity (aggregate scheme) [m d-1] @@ -4770,7 +4766,7 @@ 0, 0, 2 - + Number sinking velocity (aggregate scheme) [m d-1] @@ -4780,7 +4776,7 @@ 0, 0, 0 - + Epsilon exponent (aggregate scheme) [1] @@ -4790,7 +4786,7 @@ 0, 0, 0 - + Average particle size (aggregate scheme) @@ -4820,7 +4816,7 @@ 0, 2, 2 - + Phytoplankton (phyc) [mol C m-3] @@ -4830,7 +4826,7 @@ 0, 2, 2 - + Zooplankton (zooc) [mol C m-3] @@ -4840,7 +4836,7 @@ 0, 2, 2 - + Dissolved organic carbon (dissoc) [mol C m-3] @@ -4850,7 +4846,7 @@ 0, 2, 2 - + Primary production (pp) [mol C m-3 s-1] @@ -4860,7 +4856,7 @@ 0, 2, 2 - + Phosphorus (po4) [mol P m-3] @@ -4870,7 +4866,7 @@ 0, 4, 4 - + Oxygen (o2) [mol O2 m-3] @@ -4880,7 +4876,7 @@ 0, 2, 2 - + eposition @@ -4890,7 +4886,7 @@ 0, 2, 2 - + Nitrate (no3) [mol N m-3] @@ -4900,7 +4896,7 @@ 0, 2, 2 - + Alkalinity (talk) [eq m-3] @@ -4910,7 +4906,7 @@ 0, 2, 2 - + Silicate (si) [mol Si m-3] @@ -4920,7 +4916,7 @@ 0, 2, 2 - + Dissolved carbon (dissic) [mol C m-3] @@ -4930,7 +4926,7 @@ 0, 2, 2 - + Detrius (detoc) [mol C m-3] @@ -4940,7 +4936,7 @@ 0, 2, 2 - + CaCO3 shells (calc) [mol C m-3] @@ -4950,7 +4946,7 @@ 0, 2, 2 - + Opal shells (opal) [mol Si m-3] @@ -4960,7 +4956,7 @@ 0, 2, 2 - + ] @@ -4970,7 +4966,7 @@ 0, 0, 2 - + Nitrous oxide concentration [mol N2O m-3] @@ -4990,7 +4986,7 @@ 0, 2, 2 - + Calcite saturation state (omegac) [1] @@ -5000,7 +4996,7 @@ 0, 2, 2 - + Aragonite saturation state (omegaa) [1] @@ -5010,7 +5006,7 @@ 0, 4, 4 - + preformed oxygen (p_o2) [mol O2 m-3] @@ -5020,7 +5016,7 @@ 0, 4, 4 - + Saturated oxygen (satoxy) [mol O2 m-3] @@ -5030,7 +5026,7 @@ 0, 2, 2 - + preformed phosphate (p_po4) [mol PO4 m-3] @@ -5040,7 +5036,7 @@ 0, 2, 2 - + preformed alkalinity (p_talk) [eq m-3] @@ -5050,7 +5046,7 @@ 0, 2, 2 - + preformed DIC (p_dic) [mol C m-3] @@ -5060,7 +5056,7 @@ 0, 2, 2 - + saturated DIC (dic_sat) [mol C m-3] @@ -5070,7 +5066,7 @@ 0, 2, 2 - + Natural dissolved carbon (natdissic) [mol C m-3] @@ -5080,7 +5076,7 @@ 0, 2, 2 - + Natural alkalinity (nattalk) [eq m-3] @@ -5090,7 +5086,7 @@ 0, 2, 2 - + Natural carbonate ion concentration (natco3) [mol C m-3] @@ -5100,7 +5096,7 @@ 0, 2, 2 - + Natural CaCO3 shells (natcalc) [mol C m-3] @@ -5110,7 +5106,7 @@ 0, 2, 2 - + Natural pH (natph) [-log10([h+])] @@ -5120,7 +5116,7 @@ 0, 2, 2 - + Natural calcite saturation state (natomegac) [1] @@ -5130,7 +5126,7 @@ 0, 2, 2 - + Natural aragonite saturation state (natomegaa) [1] @@ -5140,7 +5136,7 @@ 0, 2, 2 - + Dissolved C13 (dissic13) [mol C m-3] @@ -5150,7 +5146,7 @@ 0, 2, 2 - + Dissolved C14 (dissic14) [mol C m-3] @@ -5160,7 +5156,7 @@ 0, 2, 2 - + delta 13C of DIC [1] @@ -5170,7 +5166,7 @@ 0, 2, 2 - + Particulate organic carbon 13 (detoc13) [mol C m-3] @@ -5180,7 +5176,7 @@ 0, 2, 2 - + Dissolved organic carbon 13 (dissoc13) [mol C m-3] @@ -5190,7 +5186,7 @@ 0, 2, 2 - + Particulate inorganic carbon 13 (calc13) [mol C m-3] @@ -5200,7 +5196,7 @@ 0, 2, 2 - + 13C of phytoplankton biomass (phyc13) [mol C m-3] @@ -5210,7 +5206,7 @@ 0, 2, 2 - + 13C of zootoplankton biomass (zooc13) [mol C m-3] @@ -5220,7 +5216,7 @@ 0, 2, 2 - + CFC11 concentration [mol CFC11 m-3] @@ -5230,7 +5226,7 @@ 0, 2, 2 - + CFC12 concentration [mol CFC12 m-3] @@ -5240,7 +5236,7 @@ 0, 2, 2 - + SF6 concentration [mol SF6 m-3] @@ -5250,7 +5246,7 @@ 0, 2, 2 - + Number of sinking particles (aggregate scheme, nos) [cm-3] @@ -5260,7 +5256,7 @@ 0, 2, 2 - + Mass sinking velocity (aggregate scheme) [m d-1] @@ -5270,7 +5266,7 @@ 0, 2, 2 - + Number sinking velocity (aggregate scheme) [m d-1] @@ -5280,7 +5276,7 @@ 0, 0, 0 - + Epsilon exponent (aggregate scheme) [1] @@ -5290,7 +5286,7 @@ 0, 0, 0 - + Average particle size (aggregate scheme) @@ -5340,7 +5336,7 @@ 0, 0, 2 - + sediment - water-column diffusive flux of oxygen [mol O2 m-2 s-1] @@ -5350,7 +5346,7 @@ 0, 0, 2 - + sediment - water-column diffusive flux of N2 [mol N2 m-2 s-1] @@ -5360,7 +5356,7 @@ 0, 0, 2 - + sediment - water-column diffusive flux of nitrate [mol NO3 m-2 s-1] @@ -5370,7 +5366,7 @@ 0, 0, 2 - + sediment - water-column diffusive flux of silica [mol Si m-2 s-1] @@ -5380,7 +5376,7 @@ 0, 0, 2 - + (powdic) [mol C m-3] @@ -5390,7 +5386,7 @@ 0, 0, 2 - + (powalk) [eq m-3] @@ -5400,7 +5396,7 @@ 0, 0, 2 - + (powpho) [eq m-3] @@ -5410,7 +5406,7 @@ 0, 0, 2 - + (powox) [mol O2 m-3] @@ -5420,7 +5416,7 @@ 0, 0, 2 - + (pown2) [mol N2 m-3] @@ -5430,7 +5426,7 @@ 0, 0, 2 - + (powno3)[mol N m-3] @@ -5440,7 +5436,7 @@ 0, 0, 2 - + (powsi) [mol Si m-3] @@ -5450,7 +5446,7 @@ 0, 0, 2 - + (ssso12) [mol m-3] @@ -5460,7 +5456,7 @@ 0, 0, 2 - + (ssssil) [mol Si m-3] @@ -5470,7 +5466,7 @@ 0, 0, 2 - + (sssc12) [mol C m-3] @@ -5480,7 +5476,7 @@ 0, 0, 2 - + (ssster) [mol m-3] @@ -5490,7 +5486,7 @@ 0, 0, 2 - + (ssso12) [mol m-3] @@ -5500,7 +5496,7 @@ 0, 0, 2 - + (ssssil) [mol Si m-3] @@ -5510,7 +5506,7 @@ 0, 0, 2 - + (sssc12) [mol C m-3] @@ -5520,7 +5516,7 @@ 0, 0, 2 - + (ssster) [mol m-3] diff --git a/cime_config/ocn_in.readme b/cime_config/ocn_in.readme index 8750f450..56d98527 100644 --- a/cime_config/ocn_in.readme +++ b/cime_config/ocn_in.readme @@ -75,8 +75,8 @@ ! SRXBAL : Balance the SSS relaxation (l) ! SCFILE : Name of file containing SSS climatology used for relaxation (a) ! WAVSRC : Source of wave fields. Valid source: 'none', 'param', 'extern' (a) -! SMTFRC : Smooth CESM forcing (l) -! SPRFAC : Send precipitation/runoff factor to CESM coupler (l) +! SMTFRC : Smooth NorESM forcing (l) +! SPRFAC : Send precipitation/runoff factor to NorESM coupler (l) ! ATM_PATH : Path to forcing fields in case of EXPCNF 'ben02clim' or ! 'ben02syn' (a) ! ITEST : Global i-index of point diagnostics (i) From 672f691ebf1eeef055ffb1c9fe9cf217c8e43501 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 28 Jul 2023 15:58:57 +0200 Subject: [PATCH 13/33] change defaults for history file handling for testing --- cime_config/buildcpp | 3 +- cime_config/namelist_definition_blom.xml | 722 +++++++++++++++++++++++ cime_config/testdefs/testlist_blom.xml | 8 +- 3 files changed, 727 insertions(+), 6 deletions(-) diff --git a/cime_config/buildcpp b/cime_config/buildcpp index 4799052a..dc6cd8e8 100644 --- a/cime_config/buildcpp +++ b/cime_config/buildcpp @@ -91,8 +91,7 @@ def buildcpp(case): blom_unit = case.get_value("BLOM_UNIT") pio_typename = case.get_value("PIO_TYPENAME", subgroup="OCN") - expect(blom_vcoord != "cntiso_hybrid" or not turbclo, - f"BLOM_VCOORD == {blom_vcoord} and BLOM_TURBULENT_CLOSURE == {turblo} is not a valid combination") + expect(blom_vcoord != "cntiso_hybrid" or not turbclo, "BLOM_VCOORD == {} and BLOM_TURBULENT_CLOSURE == {} is not a valid combination".format(blom_vcoord, turbclo)) blom_cppdefs = "" diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 6038454c..6e83ac18 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -1335,6 +1335,7 @@ 30,30,365 1,30,365 + 30,30,365 how often to start a new file in days @@ -1369,6 +1370,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 absolute wind speed [m s-1] @@ -1379,6 +1382,7 @@ diaphy 0,0,0 + 0,0,0 surface albedo [] @@ -1389,6 +1393,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 Barotropic mass streamfunction [kg s-1] @@ -1399,6 +1405,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 brine flux [kg m-2 s-1] @@ -1409,6 +1417,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 brine plume depth [m] @@ -1419,6 +1429,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 non-solar heat flux derivative [W m-2 K-1] @@ -1429,6 +1441,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 evaporation [kg m-2 s-1] @@ -1439,6 +1453,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 ice concentration [%] @@ -1449,6 +1465,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 fresh water flux due to melting/freezing [kg m-2 s-1] @@ -1459,6 +1477,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 ice thickness [m] @@ -1469,6 +1489,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 heat flux due to melting/freezing [W m-2] @@ -1479,6 +1501,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 snow depth [m] @@ -1489,6 +1513,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 ice age [d] @@ -1499,6 +1525,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer inertial kinetic energy tendency [kg s-3] @@ -1509,6 +1537,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 Langmuir enhancement factor [] @@ -1519,6 +1549,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 Surface layer averaged Langmuir number [] @@ -1529,6 +1561,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 liquid precipitation [kg m-2 s-1] @@ -1539,6 +1573,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 maximum mixed layer depth [m] @@ -1549,6 +1585,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer depth [m] @@ -1559,6 +1597,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 mixed layer thickness using "sigma-t" criterion [m] @@ -1569,6 +1609,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 minimum mixed layer thickness using "sigma-t" criterion [m] @@ -1579,6 +1621,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 maximum mixed layer thickness using "sigma-t" criterion [m] @@ -1589,6 +1633,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer thickness squared using "sigma-t" criterion [m2] @@ -1599,6 +1645,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer TKE tendency related to friction velocity [kg s-3] @@ -1609,6 +1657,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer TKE tendency related to near inertial mot. [kg s-3] @@ -1619,6 +1669,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer TKE tendency related to buoyancy forcing [kg s-3] @@ -1629,6 +1681,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer TKE tendency related to eddy restrat. [kg s-3] @@ -1639,6 +1693,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer TKE tendency related to pot. energy change [kg s-3] @@ -1649,6 +1705,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer TKE tendency related to kin. energy change [kg s-3] @@ -1659,6 +1717,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 wind stress y-component [N m-2] @@ -1669,6 +1729,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 non-solar heat flux [W m-2] @@ -1679,6 +1741,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 bottom pressure [Pa] @@ -1689,6 +1753,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 surface pressure [Pa] @@ -1699,6 +1765,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 frozen runoff [kg m-2 s-1] @@ -1709,6 +1777,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 liquid runoff [kg m-2 s-1] @@ -1719,6 +1789,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 salt flux received by ocean [kg m-2 s-1] @@ -1729,6 +1801,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 restoring salt flux received by ocean [kg m-2 s-1] @@ -1739,6 +1813,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 bottom salinity [g kg-1] @@ -1749,6 +1825,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 sea level [m] @@ -1759,6 +1837,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 sea level squared [m2] @@ -1769,6 +1849,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 salt flux [kg m-2 s-1] @@ -1779,6 +1861,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 solid precipitation [kg m-2 s-1] @@ -1789,6 +1873,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 mixed layer density [kg m-3] @@ -1799,6 +1885,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 ocean surface salinity [g kg-1] @@ -1809,6 +1897,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 ocean surface salinity squared [g2 kg-2] @@ -1819,6 +1909,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 ocean surface temperature [degC] @@ -1829,6 +1921,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 ocean surface temperature squared [degC2] @@ -1839,6 +1933,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 heat flux received by ocean [W m-2] @@ -1849,6 +1945,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 restoring heat flux received by ocean [W m-2] @@ -1859,6 +1957,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 short-wave heat flux [W m-2] @@ -1869,6 +1969,8 @@ diaphy 4,4,0 + 4,4,0 + 0,0,0 20C isoterm depth [m] @@ -1879,6 +1981,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 momentum flux received by ocean x-component [N m-2] @@ -1889,6 +1993,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 momentum flux received by ocean y-component [N m-2] @@ -1899,6 +2005,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 bottom temperature [degC] @@ -1909,6 +2017,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 ice temperature [degC] @@ -1919,6 +2029,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 surface temperature [degC] @@ -1929,6 +2041,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 barotropic velocity x-component [m s-1] @@ -1939,6 +2053,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 ice velocity x-component [m s-1] @@ -1949,6 +2065,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 friction velocity [m s-1] @@ -1959,6 +2077,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 friction velocity cubed [m3 s-3] @@ -1969,6 +2089,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 surface Stokes drift x-componen [m s-1] @@ -1979,6 +2101,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 barotropic velocity y-component [m s-1] @@ -1989,6 +2113,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 ice velocity y-component [m s-1] @@ -1999,6 +2125,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 surface Stokes drift y-componen [m s-1] @@ -2009,6 +2137,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 wind stress x-component [N m-2] @@ -2019,6 +2149,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 buoyancy frequency squared [s-1] @@ -2029,6 +2161,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 vertical diffusivity [log10(m2 s-1)|m2 s-1] @@ -2039,6 +2173,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 vertical momentum diffusivity [log10(m2 s-1)|m2 s-1] @@ -2049,6 +2185,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 vertical heat diffusivity [log10(m2 s-1)|m2 s-1] @@ -2059,6 +2197,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 vertical salt diffusivity [log10(m2 s-1)|m2 s-1] @@ -2069,6 +2209,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 layer interface diffusivity [log10(m2 s-1)] @@ -2079,6 +2221,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 isopycnal diffusivity [log10(m2 s-1)] @@ -2089,6 +2233,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2099,6 +2245,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2109,6 +2257,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2119,6 +2269,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2129,6 +2281,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 @@ -2139,6 +2293,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2149,6 +2305,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2159,6 +2317,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2169,6 +2329,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2179,6 +2341,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2189,6 +2353,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2199,6 +2365,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2209,6 +2377,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2219,6 +2389,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2229,6 +2401,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2239,6 +2413,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2249,6 +2425,8 @@ diaphy 0,4,0 + 0,0,4 + 0,0,0 @@ -2259,6 +2437,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2269,6 +2449,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2279,6 +2461,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2289,6 +2473,8 @@ diaphy 0,0,4 + 4,4,0 + 0,0,0 @@ -2299,6 +2485,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2309,6 +2497,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2319,6 +2509,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2329,6 +2521,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2339,6 +2533,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2349,6 +2545,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2359,6 +2557,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2369,6 +2569,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2379,6 +2581,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2389,6 +2593,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2399,6 +2605,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2409,6 +2617,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2419,6 +2629,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2429,6 +2641,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2439,6 +2653,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2449,6 +2665,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2459,6 +2677,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2469,6 +2689,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2479,6 +2701,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2489,6 +2713,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2499,6 +2725,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2509,6 +2737,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2519,6 +2749,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2529,6 +2761,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2539,6 +2773,8 @@ diaphy 0,0,0 + 0,0,0 + 0,0,0 @@ -2549,6 +2785,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2559,6 +2797,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2569,6 +2809,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2579,6 +2821,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2589,6 +2833,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2599,6 +2845,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2609,6 +2857,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2619,6 +2869,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2629,6 +2881,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2639,6 +2893,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2649,6 +2905,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2659,6 +2917,8 @@ diaphy 0,4,0 + 0,0,4 + 0,0,0 @@ -2669,6 +2929,8 @@ diaphy 0,4,0 + 0,0,4 + 0,0,0 @@ -2679,6 +2941,10 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 + 4,4,0 + 0,0,0 @@ -2689,6 +2955,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2699,6 +2967,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2709,6 +2979,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2719,6 +2991,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2729,6 +3003,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2739,6 +3015,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2749,6 +3027,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2759,6 +3039,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2769,6 +3051,8 @@ diaphy 0,0,4 + 0,0,4 + 0,0,0 @@ -2779,6 +3063,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2789,6 +3075,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2799,6 +3087,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2809,6 +3099,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2819,6 +3111,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2829,6 +3123,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2839,6 +3135,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2849,6 +3147,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2859,6 +3159,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2869,6 +3171,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2879,6 +3183,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2889,6 +3195,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2899,6 +3207,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2909,6 +3219,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2919,6 +3231,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2929,6 +3243,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2939,6 +3255,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2949,6 +3267,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2959,6 +3279,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2969,6 +3291,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2979,6 +3303,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2989,6 +3315,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -2999,6 +3327,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -3009,6 +3339,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -3019,6 +3351,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -3029,6 +3363,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -3039,6 +3375,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -3049,6 +3387,8 @@ diaphy 0,4,0 + 4,4,0 + 0,0,0 @@ -3553,6 +3893,7 @@ 30,30,365 1,30,365 + 0,0,0 @@ -3594,6 +3935,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Phosphorus (po4) [mol P m-3] @@ -3604,6 +3947,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Oxygen (o2) [mol O2 m-3] @@ -3614,6 +3959,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Dissolved iron (dfe) [mol Fe m-3] @@ -3624,6 +3971,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Nitrate (no3) [mol N m-3] @@ -3634,6 +3983,8 @@ diabgc 4, 2, 2 + 4, 2, 2 + 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -3644,6 +3995,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -3654,6 +4007,8 @@ diabgc 4, 2, 2 + 4, 2, 2 + 0,0,0 Dissolved carbon (dissic) [mol C m-3] @@ -3664,6 +4019,8 @@ diabgc 4, 2, 2 + 4, 2, 2 + 0,0,0 Phytoplankton (phyc) [mol C m-3] @@ -3674,6 +4031,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 pH (ph) [-log10([h+])] @@ -3684,6 +4043,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Export production (epc100) [mol C m-2 s-1] @@ -3694,6 +4055,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Si export production (epsi100) [mol Si m-2 s-1] @@ -3704,6 +4067,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Ca export production (epcalc100) [mol Ca m-2 s-1] @@ -3714,6 +4079,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Piston velocity (kwco2) [m s-1] @@ -3724,6 +4091,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1] @@ -3734,6 +4103,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1] @@ -3744,6 +4115,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 CO2 solubility under moist air assumption (kh) [mol kg-1 atm-1] @@ -3754,6 +4127,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural surface PCO2 (spco2) [uatm] @@ -3764,6 +4139,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Surface PCO2 under moist air assumption [uatm] @@ -3774,6 +4151,8 @@ diabgc 4, 2, 2 + 2, 2, 2 + 0,0,0 Downward CO2 flux (co2fxd) [kg C m-2 s-1] @@ -3784,6 +4163,8 @@ diabgc 4, 2, 2 + 2, 2, 2 + 0,0,0 Upward CO2 flux (co2fxu) [kg C m-2 s-1] @@ -3794,6 +4175,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Oxygen flux (fgo2) [mol O2 m-2 s-1] @@ -3804,6 +4187,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Nitrogen flux (fgn2) [mol N2 m-2 s-1] @@ -3814,6 +4199,8 @@ diabgc 0, 0, 2 + 2, 2, 2 + 0,0,0 Nitrous oxide flux [mol N2O m-2 s-1] @@ -3824,6 +4211,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 DMS flux (dmsflux) [mol DMS m-2 s-1] @@ -3834,6 +4223,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 surface DMS concentration (dms) [mol DMS m-3] @@ -3844,6 +4235,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 DMS production (dmsprod) [mol DMS m-2 s-1] @@ -3854,6 +4247,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 DMS bacterial consuption (dms_bac) [mol DMS m-2 s-1] @@ -3864,6 +4259,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 DMS decomposition by UV (dms_uv) [mol DMS m-2 s-1] @@ -3874,6 +4271,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Atmospheric CO2 (atmco2) [ppm] @@ -3884,6 +4283,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Atmospheric O2 (atmo2) [ppm] @@ -3894,6 +4295,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Atmospheric N2 (atmn2) [ppm] @@ -3904,6 +4307,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural dissolved carbon (natdissic) [mol C m-3] @@ -3914,6 +4319,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -3924,6 +4331,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural pH (natph) [-log10([h+])] @@ -3934,6 +4343,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural surface PCO2 (spco2) [uatm] @@ -3944,6 +4355,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural net CO2 flux (natco2fx) [kg C m-2 s-1] @@ -3954,6 +4367,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Downward 13CO2 flux (co213fxd) [kg C m-2 s-1] @@ -3964,6 +4379,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Upward 13CO2 flux (co213fxu) [kg C m-2 s-1] @@ -3974,6 +4391,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Downward 14CO2 flux (co214fxd) [kg C m-2 s-1] @@ -3984,6 +4403,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Upward 14CO2 flux (co214fxu) [kg C m-2 s-1] @@ -3994,6 +4415,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 CFC11 flux [mol CFC11 m-2 s-1] @@ -4004,6 +4427,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 CFC12 flux [mol CFC12 m-2 s-1] @@ -4014,6 +4439,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 SF6 flux [mol SF6 m-2 s-1] @@ -4024,6 +4451,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4034,6 +4463,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4044,6 +4475,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4054,6 +4487,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4064,6 +4499,8 @@ diabgc 4, 2, 2 + 2, 2, 2 + 0,0,0 Primary production (pp) [mol C m-3 s-1] @@ -4074,6 +4511,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Vertically integrated nitrogen fixation @@ -4084,6 +4523,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Vertically integrated denitrification @@ -4095,6 +4536,7 @@ 0,0,0 0, 2, 2 + 2, 2, 2 Nitrogen deposition flux [mol N m-2 s-1] @@ -4105,6 +4547,8 @@ diabgc 0, 0, 0 + 0, 0, 0 + 0,0,0 AMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT @@ -4115,6 +4559,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4125,6 +4571,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4135,6 +4583,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4145,6 +4595,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4155,6 +4607,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4165,6 +4619,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4175,6 +4631,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4185,6 +4643,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4195,6 +4655,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4205,6 +4667,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4215,6 +4679,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4225,6 +4691,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4235,6 +4703,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4245,6 +4715,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4255,6 +4727,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4265,6 +4739,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4275,6 +4751,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4285,6 +4763,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4295,6 +4775,8 @@ diabgc 0, 0, 2 + 2, 2, 2 + 0,0,0 @@ -4305,6 +4787,8 @@ diabgc 0, 0, 2 + 2, 2, 2 + 0,0,0 @@ -4315,6 +4799,8 @@ diabgc 0, 0, 2 + 2, 2, 2 + 0,0,0 @@ -4325,6 +4811,8 @@ diabgc 0, 0, 2 + 2, 2, 2 + 0,0,0 @@ -4335,6 +4823,8 @@ diabgc 0, 0, 2 + 2, 2, 2 + 0,0,0 Phosphorus (po4) [mol P m-3] @@ -4345,6 +4835,8 @@ diabgc 0, 0, 4 + 4, 0, 4 + 0,0,0 Oxygen (o2) [mol O2 m-3] @@ -4355,6 +4847,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Dissolved iron (dfe) [mol Fe m-3] @@ -4365,6 +4859,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -4375,6 +4871,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -4385,6 +4883,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -4395,6 +4895,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -4405,6 +4907,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -4415,6 +4919,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 CaCO3 shells (calc) [mol C m-3] @@ -4425,6 +4931,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Opal shells (opal) [mol Si m-3] @@ -4435,6 +4943,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Carbonate ions (co3) [mol C m-3] @@ -4445,6 +4955,8 @@ diabgc 0, 0, 0 + 0, 0, 0 + 0,0,0 Nitrous oxide concentration [mol N2O m-3] @@ -4455,6 +4967,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -4465,6 +4979,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Calcite saturation state (omegac) [1] @@ -4475,6 +4991,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural aragonite saturation state (natomegaa) [1] @@ -4485,6 +5003,8 @@ diabgc 0, 0, 4 + 4, 0, 4 + 0,0,0 preformed oxygen (p_o2) [mol O2 m-3] @@ -4495,6 +5015,8 @@ diabgc 0, 0, 4 + 4, 0, 4 + 0,0,0 Saturated oxygen (satoxy) [mol O2 m-3] @@ -4505,6 +5027,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -4515,6 +5039,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 preformed alkalinity (p_talk) [eq m-3] @@ -4525,6 +5051,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 preformed DIC (p_dic) [mol C m-3] @@ -4535,6 +5063,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 saturated DIC (dic_sat) [mol C m-3] @@ -4545,6 +5075,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural dissolved carbon (natdissic) [mol C m-3] @@ -4555,6 +5087,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -4565,6 +5099,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural carbonate ion concentration (natco3) [mol C m-3] @@ -4575,6 +5111,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural CaCO3 shells (natcalc) [mol C m-3] @@ -4585,6 +5123,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural pH (natph) [-log10([h+])] @@ -4595,6 +5135,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural calcite saturation state (natomegac) [1] @@ -4605,6 +5147,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Natural aragonite saturation state (natomegaa) [1] @@ -4615,6 +5159,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Dissolved C13 (dissic13) [mol C m-3] @@ -4625,6 +5171,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Dissolved C14 (dissic14) [mol C m-3] @@ -4635,6 +5183,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 at-depth variable sediment porosity (as opposed to default: only depth) @@ -4645,6 +5195,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 delta 14C of DIC [1] @@ -4655,6 +5207,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Delta 14C of DIC [1] @@ -4665,6 +5219,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Particulate organic carbon 13 (detoc13) [mol C m-3] @@ -4675,6 +5231,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Dissolved organic carbon 13 (dissoc13) [mol C m-3] @@ -4685,6 +5243,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Particulate inorganic carbon 13 (calc13) [mol C m-3] @@ -4695,6 +5255,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 13C of phytoplankton biomass (phyc13) [mol C m-3] @@ -4705,6 +5267,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 13C of zootoplankton biomass (zooc13) [mol C m-3] @@ -4715,6 +5279,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 CFC11 concentration [mol CFC11 m-3] @@ -4725,6 +5291,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 CFC12 concentration [mol CFC12 m-3] @@ -4735,6 +5303,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 SF6 concentration [mol SF6 m-3] @@ -4745,6 +5315,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 ndex of point diagnostics (i) @@ -4755,6 +5327,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Mass sinking velocity (aggregate scheme) [m d-1] @@ -4765,6 +5339,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 Number sinking velocity (aggregate scheme) [m d-1] @@ -4775,6 +5351,8 @@ diabgc 0, 0, 0 + 0, 0, 0 + 0,0,0 Epsilon exponent (aggregate scheme) [1] @@ -4785,6 +5363,8 @@ diabgc 0, 0, 0 + 0, 0, 0 + 0,0,0 Average particle size (aggregate scheme) @@ -4805,6 +5385,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4815,6 +5397,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Phytoplankton (phyc) [mol C m-3] @@ -4825,6 +5409,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Zooplankton (zooc) [mol C m-3] @@ -4835,6 +5421,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Dissolved organic carbon (dissoc) [mol C m-3] @@ -4845,6 +5433,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Primary production (pp) [mol C m-3 s-1] @@ -4855,6 +5445,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Phosphorus (po4) [mol P m-3] @@ -4865,6 +5457,8 @@ diabgc 0, 4, 4 + 4, 4, 4 + 0,0,0 Oxygen (o2) [mol O2 m-3] @@ -4875,6 +5469,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 eposition @@ -4885,6 +5481,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Nitrate (no3) [mol N m-3] @@ -4895,6 +5493,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Alkalinity (talk) [eq m-3] @@ -4905,6 +5505,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Silicate (si) [mol Si m-3] @@ -4915,6 +5517,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Dissolved carbon (dissic) [mol C m-3] @@ -4925,6 +5529,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Detrius (detoc) [mol C m-3] @@ -4935,6 +5541,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 CaCO3 shells (calc) [mol C m-3] @@ -4945,6 +5553,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Opal shells (opal) [mol Si m-3] @@ -4955,6 +5565,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 ] @@ -4965,6 +5577,8 @@ diabgc 0, 0, 2 + 2, 2, 2 + 0,0,0 Nitrous oxide concentration [mol N2O m-3] @@ -4975,6 +5589,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -4985,6 +5601,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Calcite saturation state (omegac) [1] @@ -4995,6 +5613,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Aragonite saturation state (omegaa) [1] @@ -5005,6 +5625,8 @@ diabgc 0, 4, 4 + 4, 4, 4 + 0,0,0 preformed oxygen (p_o2) [mol O2 m-3] @@ -5025,6 +5647,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 preformed phosphate (p_po4) [mol PO4 m-3] @@ -5035,6 +5659,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 preformed alkalinity (p_talk) [eq m-3] @@ -5045,6 +5671,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 preformed DIC (p_dic) [mol C m-3] @@ -5055,6 +5683,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 saturated DIC (dic_sat) [mol C m-3] @@ -5065,6 +5695,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural dissolved carbon (natdissic) [mol C m-3] @@ -5075,6 +5707,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -5085,6 +5719,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural carbonate ion concentration (natco3) [mol C m-3] @@ -5095,6 +5731,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural CaCO3 shells (natcalc) [mol C m-3] @@ -5105,6 +5743,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural pH (natph) [-log10([h+])] @@ -5115,6 +5755,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural calcite saturation state (natomegac) [1] @@ -5125,6 +5767,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Natural aragonite saturation state (natomegaa) [1] @@ -5135,6 +5779,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Dissolved C13 (dissic13) [mol C m-3] @@ -5145,6 +5791,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Dissolved C14 (dissic14) [mol C m-3] @@ -5155,6 +5803,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 delta 13C of DIC [1] @@ -5165,6 +5815,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Particulate organic carbon 13 (detoc13) [mol C m-3] @@ -5175,6 +5827,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Dissolved organic carbon 13 (dissoc13) [mol C m-3] @@ -5185,6 +5839,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Particulate inorganic carbon 13 (calc13) [mol C m-3] @@ -5195,6 +5851,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 13C of phytoplankton biomass (phyc13) [mol C m-3] @@ -5205,6 +5863,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 13C of zootoplankton biomass (zooc13) [mol C m-3] @@ -5215,6 +5875,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 CFC11 concentration [mol CFC11 m-3] @@ -5225,6 +5887,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 CFC12 concentration [mol CFC12 m-3] @@ -5235,6 +5899,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 SF6 concentration [mol SF6 m-3] @@ -5245,6 +5911,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Number of sinking particles (aggregate scheme, nos) [cm-3] @@ -5255,6 +5923,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Mass sinking velocity (aggregate scheme) [m d-1] @@ -5265,6 +5935,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 Number sinking velocity (aggregate scheme) [m d-1] @@ -5275,6 +5947,8 @@ diabgc 0, 0, 0 + 0, 0, 0 + 0,0,0 Epsilon exponent (aggregate scheme) [1] @@ -5285,6 +5959,8 @@ diabgc 0, 0, 0 + 0, 0, 0 + 0,0,0 Average particle size (aggregate scheme) @@ -5295,6 +5971,8 @@ diabgc 0, 2, 2 + 2, 2, 2 + 0,0,0 @@ -5305,6 +5983,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -5315,6 +5995,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -5325,6 +6007,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 @@ -5335,6 +6019,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 sediment - water-column diffusive flux of oxygen [mol O2 m-2 s-1] @@ -5345,6 +6031,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 sediment - water-column diffusive flux of N2 [mol N2 m-2 s-1] @@ -5355,6 +6043,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 sediment - water-column diffusive flux of nitrate [mol NO3 m-2 s-1] @@ -5365,6 +6055,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 sediment - water-column diffusive flux of silica [mol Si m-2 s-1] @@ -5375,6 +6067,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (powdic) [mol C m-3] @@ -5385,6 +6079,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (powalk) [eq m-3] @@ -5395,6 +6091,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (powpho) [eq m-3] @@ -5405,6 +6103,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (powox) [mol O2 m-3] @@ -5415,6 +6115,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (pown2) [mol N2 m-3] @@ -5425,6 +6127,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (powno3)[mol N m-3] @@ -5435,6 +6139,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (powsi) [mol Si m-3] @@ -5445,6 +6151,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (ssso12) [mol m-3] @@ -5455,6 +6163,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (ssssil) [mol Si m-3] @@ -5465,6 +6175,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (sssc12) [mol C m-3] @@ -5475,6 +6187,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (ssster) [mol m-3] @@ -5485,6 +6199,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (ssso12) [mol m-3] @@ -5495,6 +6211,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (ssssil) [mol Si m-3] @@ -5505,6 +6223,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (sssc12) [mol C m-3] @@ -5515,6 +6235,8 @@ diabgc 0, 0, 2 + 2, 0, 2 + 0,0,0 (ssster) [mol m-3] diff --git a/cime_config/testdefs/testlist_blom.xml b/cime_config/testdefs/testlist_blom.xml index f54c99eb..cdddf99a 100644 --- a/cime_config/testdefs/testlist_blom.xml +++ b/cime_config/testdefs/testlist_blom.xml @@ -5,22 +5,22 @@ - + - + - + - + From c76658b3c6d4f1aac1c06e95c409d1a6f455685e Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 31 Jul 2023 14:30:21 +0200 Subject: [PATCH 14/33] updates for testing --- cime_config/buildcpp | 3 +- cime_config/config_component.xml | 12 - cime_config/namelist_definition_blom.xml | 778 +++++++++++------------ 3 files changed, 391 insertions(+), 402 deletions(-) diff --git a/cime_config/buildcpp b/cime_config/buildcpp index dc6cd8e8..cc830111 100644 --- a/cime_config/buildcpp +++ b/cime_config/buildcpp @@ -143,7 +143,8 @@ def buildcpp(case): if hamocc_ciso: expect(hamocc_sedbypass, "HAMOCC C-isotopes currently not supported in the sediment module. Use HAMOCC_SEDBYPASS=TRUE") blom_cppdefs = blom_cppdefs + " -Dcisonew" - if hamocc_vsls: + if ocn_grid in ["tnx1v4"]: + # HAMOCC will always compute bromoform flux and dms flux and send to the mediator blom_cppdefs = blom_cppdefs + " -DBROMO" if co2type == "prognostic": blom_cppdefs = blom_cppdefs + " -DPROGCO2" diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index a38225a8..d1743b17 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -206,18 +206,6 @@ Set preprocessor option to activate the debugging mode for iHAMOCC. Requires module ecosys - - logical - TRUE,FALSE - FALSE - - TRUE - - build_component_blom - env_build.xml - Set preprocessor option to activate the VSLS-Bromoform tracer code. Requires module ecosys - - char diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 6e83ac18..2c5720df 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -3442,7 +3442,7 @@ merdia merdia - 2, 4 + 2,4 Array of mask flags in ocean regions file to be included for region (1) @@ -3529,7 +3529,7 @@ bgcnml UNSET - $DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc + $DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc abs File name (incl. full path) for swa climatology field (needed if bromoform scheme is activated) @@ -3924,7 +3924,7 @@ diabgc diabgc - 0, 1, 0 + 0,1,0 @@ -3934,8 +3934,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Phosphorus (po4) [mol P m-3] @@ -3946,8 +3946,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Oxygen (o2) [mol O2 m-3] @@ -3958,8 +3958,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Dissolved iron (dfe) [mol Fe m-3] @@ -3970,8 +3970,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Nitrate (no3) [mol N m-3] @@ -3982,8 +3982,8 @@ diabgc diabgc - 4, 2, 2 - 4, 2, 2 + 4,2,2 + 4,2,2 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -3994,8 +3994,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4006,8 +4006,8 @@ diabgc diabgc - 4, 2, 2 - 4, 2, 2 + 4,2,2 + 4,2,2 0,0,0 Dissolved carbon (dissic) [mol C m-3] @@ -4018,8 +4018,8 @@ diabgc diabgc - 4, 2, 2 - 4, 2, 2 + 4,2,2 + 4,2,2 0,0,0 Phytoplankton (phyc) [mol C m-3] @@ -4030,8 +4030,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 pH (ph) [-log10([h+])] @@ -4042,8 +4042,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Export production (epc100) [mol C m-2 s-1] @@ -4054,8 +4054,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Si export production (epsi100) [mol Si m-2 s-1] @@ -4066,8 +4066,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Ca export production (epcalc100) [mol Ca m-2 s-1] @@ -4078,8 +4078,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Piston velocity (kwco2) [m s-1] @@ -4090,8 +4090,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1] @@ -4102,8 +4102,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1] @@ -4114,8 +4114,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 CO2 solubility under moist air assumption (kh) [mol kg-1 atm-1] @@ -4126,8 +4126,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural surface PCO2 (spco2) [uatm] @@ -4138,8 +4138,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Surface PCO2 under moist air assumption [uatm] @@ -4150,8 +4150,8 @@ diabgc diabgc - 4, 2, 2 - 2, 2, 2 + 4,2,2 + 4,2,2 0,0,0 Downward CO2 flux (co2fxd) [kg C m-2 s-1] @@ -4162,8 +4162,8 @@ diabgc diabgc - 4, 2, 2 - 2, 2, 2 + 4,2,2 + 4,2,2 0,0,0 Upward CO2 flux (co2fxu) [kg C m-2 s-1] @@ -4174,8 +4174,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Oxygen flux (fgo2) [mol O2 m-2 s-1] @@ -4186,8 +4186,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Nitrogen flux (fgn2) [mol N2 m-2 s-1] @@ -4198,8 +4198,8 @@ diabgc diabgc - 0, 0, 2 - 2, 2, 2 + 0,0,2 + 4,2,2 0,0,0 Nitrous oxide flux [mol N2O m-2 s-1] @@ -4210,8 +4210,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 DMS flux (dmsflux) [mol DMS m-2 s-1] @@ -4222,8 +4222,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 surface DMS concentration (dms) [mol DMS m-3] @@ -4234,8 +4234,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 DMS production (dmsprod) [mol DMS m-2 s-1] @@ -4246,8 +4246,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 DMS bacterial consuption (dms_bac) [mol DMS m-2 s-1] @@ -4258,8 +4258,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 DMS decomposition by UV (dms_uv) [mol DMS m-2 s-1] @@ -4270,8 +4270,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Atmospheric CO2 (atmco2) [ppm] @@ -4282,8 +4282,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Atmospheric O2 (atmo2) [ppm] @@ -4294,8 +4294,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Atmospheric N2 (atmn2) [ppm] @@ -4306,8 +4306,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural dissolved carbon (natdissic) [mol C m-3] @@ -4318,8 +4318,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -4330,8 +4330,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural pH (natph) [-log10([h+])] @@ -4342,8 +4342,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural surface PCO2 (spco2) [uatm] @@ -4354,8 +4354,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural net CO2 flux (natco2fx) [kg C m-2 s-1] @@ -4366,8 +4366,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 0,2,2 0,0,0 Downward 13CO2 flux (co213fxd) [kg C m-2 s-1] @@ -4378,8 +4378,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 0,2,2 0,0,0 Upward 13CO2 flux (co213fxu) [kg C m-2 s-1] @@ -4390,8 +4390,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Downward 14CO2 flux (co214fxd) [kg C m-2 s-1] @@ -4402,8 +4402,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Upward 14CO2 flux (co214fxu) [kg C m-2 s-1] @@ -4414,8 +4414,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 CFC11 flux [mol CFC11 m-2 s-1] @@ -4426,8 +4426,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 CFC12 flux [mol CFC12 m-2 s-1] @@ -4438,8 +4438,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 SF6 flux [mol SF6 m-2 s-1] @@ -4450,8 +4450,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4462,8 +4462,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4474,8 +4474,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4486,8 +4486,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4498,8 +4498,8 @@ diabgc diabgc - 4, 2, 2 - 2, 2, 2 + 4,2,2 + 4,2,2 0,0,0 Primary production (pp) [mol C m-3 s-1] @@ -4510,8 +4510,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Vertically integrated nitrogen fixation @@ -4522,8 +4522,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Vertically integrated denitrification @@ -4535,8 +4535,8 @@ diabgc 0,0,0 - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 Nitrogen deposition flux [mol N m-2 s-1] @@ -4546,8 +4546,8 @@ diabgc diabgc - 0, 0, 0 - 0, 0, 0 + 0,0,0 + 0,0,0 0,0,0 AMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT @@ -4558,8 +4558,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4570,8 +4570,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4582,8 +4582,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4594,8 +4594,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4606,8 +4606,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4618,8 +4618,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4630,8 +4630,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4642,8 +4642,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4654,8 +4654,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4666,8 +4666,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4678,8 +4678,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4690,8 +4690,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4702,8 +4702,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4714,8 +4714,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4726,8 +4726,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4738,8 +4738,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4750,8 +4750,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4762,8 +4762,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -4774,8 +4774,8 @@ diabgc diabgc - 0, 0, 2 - 2, 2, 2 + 0,0,2 + 4,2,2 0,0,0 @@ -4786,8 +4786,8 @@ diabgc diabgc - 0, 0, 2 - 2, 2, 2 + 0,0,2 + 4,2,2 0,0,0 @@ -4798,8 +4798,8 @@ diabgc diabgc - 0, 0, 2 - 2, 2, 2 + 0,0,2 + 4,2,2 0,0,0 @@ -4810,8 +4810,8 @@ diabgc diabgc - 0, 0, 2 - 2, 2, 2 + 0,0,2 + 4,2,2 0,0,0 @@ -4822,8 +4822,8 @@ diabgc diabgc - 0, 0, 2 - 2, 2, 2 + 0,0,2 + 4,2,2 0,0,0 Phosphorus (po4) [mol P m-3] @@ -4834,8 +4834,8 @@ diabgc diabgc - 0, 0, 4 - 4, 0, 4 + 0,0,4 + 4,0,4 0,0,0 Oxygen (o2) [mol O2 m-3] @@ -4846,8 +4846,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Dissolved iron (dfe) [mol Fe m-3] @@ -4858,8 +4858,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -4870,8 +4870,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -4882,8 +4882,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -4894,8 +4894,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -4906,8 +4906,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -4918,8 +4918,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 CaCO3 shells (calc) [mol C m-3] @@ -4930,8 +4930,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Opal shells (opal) [mol Si m-3] @@ -4942,8 +4942,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Carbonate ions (co3) [mol C m-3] @@ -4954,8 +4954,8 @@ diabgc diabgc - 0, 0, 0 - 0, 0, 0 + 0,0,0 + 0,0,0 0,0,0 Nitrous oxide concentration [mol N2O m-3] @@ -4966,8 +4966,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -4978,8 +4978,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Calcite saturation state (omegac) [1] @@ -4990,8 +4990,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural aragonite saturation state (natomegaa) [1] @@ -5002,8 +5002,8 @@ diabgc diabgc - 0, 0, 4 - 4, 0, 4 + 0,0,4 + 4,0,4 0,0,0 preformed oxygen (p_o2) [mol O2 m-3] @@ -5014,8 +5014,8 @@ diabgc diabgc - 0, 0, 4 - 4, 0, 4 + 0,0,4 + 4,0,4 0,0,0 Saturated oxygen (satoxy) [mol O2 m-3] @@ -5026,8 +5026,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -5038,8 +5038,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 preformed alkalinity (p_talk) [eq m-3] @@ -5050,8 +5050,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 preformed DIC (p_dic) [mol C m-3] @@ -5062,8 +5062,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 saturated DIC (dic_sat) [mol C m-3] @@ -5074,8 +5074,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural dissolved carbon (natdissic) [mol C m-3] @@ -5086,8 +5086,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -5098,8 +5098,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural carbonate ion concentration (natco3) [mol C m-3] @@ -5110,8 +5110,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural CaCO3 shells (natcalc) [mol C m-3] @@ -5122,8 +5122,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural pH (natph) [-log10([h+])] @@ -5134,8 +5134,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural calcite saturation state (natomegac) [1] @@ -5146,8 +5146,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Natural aragonite saturation state (natomegaa) [1] @@ -5158,8 +5158,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Dissolved C13 (dissic13) [mol C m-3] @@ -5170,8 +5170,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 Dissolved C14 (dissic14) [mol C m-3] @@ -5182,8 +5182,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 at-depth variable sediment porosity (as opposed to default: only depth) @@ -5194,8 +5194,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 delta 14C of DIC [1] @@ -5206,8 +5206,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 Delta 14C of DIC [1] @@ -5218,8 +5218,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 Particulate organic carbon 13 (detoc13) [mol C m-3] @@ -5230,8 +5230,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 Dissolved organic carbon 13 (dissoc13) [mol C m-3] @@ -5242,8 +5242,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 Particulate inorganic carbon 13 (calc13) [mol C m-3] @@ -5254,8 +5254,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 13C of phytoplankton biomass (phyc13) [mol C m-3] @@ -5266,8 +5266,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 13C of zootoplankton biomass (zooc13) [mol C m-3] @@ -5278,8 +5278,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 CFC11 concentration [mol CFC11 m-3] @@ -5290,8 +5290,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 CFC12 concentration [mol CFC12 m-3] @@ -5302,8 +5302,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 SF6 concentration [mol SF6 m-3] @@ -5314,11 +5314,11 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 - ndex of point diagnostics (i) + index of point diagnostics (i) @@ -5326,8 +5326,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 Mass sinking velocity (aggregate scheme) [m d-1] @@ -5338,8 +5338,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 0,0,2 0,0,0 Number sinking velocity (aggregate scheme) [m d-1] @@ -5350,8 +5350,8 @@ diabgc diabgc - 0, 0, 0 - 0, 0, 0 + 0,0,0 + 0,0,0 0,0,0 Epsilon exponent (aggregate scheme) [1] @@ -5362,8 +5362,8 @@ diabgc diabgc - 0, 0, 0 - 0, 0, 0 + 0,0,0 + 0,0,0 0,0,0 Average particle size (aggregate scheme) @@ -5374,7 +5374,7 @@ diabgc diabgc - 0, 0, 2 + 0,0,2 @@ -5384,8 +5384,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 0,2,2 0,0,0 @@ -5396,8 +5396,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Phytoplankton (phyc) [mol C m-3] @@ -5408,8 +5408,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Zooplankton (zooc) [mol C m-3] @@ -5420,8 +5420,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Dissolved organic carbon (dissoc) [mol C m-3] @@ -5432,8 +5432,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Primary production (pp) [mol C m-3 s-1] @@ -5444,8 +5444,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Phosphorus (po4) [mol P m-3] @@ -5456,8 +5456,8 @@ diabgc diabgc - 0, 4, 4 - 4, 4, 4 + 0,4,4 + 4,4,4 0,0,0 Oxygen (o2) [mol O2 m-3] @@ -5468,8 +5468,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 eposition @@ -5480,8 +5480,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Nitrate (no3) [mol N m-3] @@ -5492,8 +5492,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Alkalinity (talk) [eq m-3] @@ -5504,8 +5504,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Silicate (si) [mol Si m-3] @@ -5516,8 +5516,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Dissolved carbon (dissic) [mol C m-3] @@ -5528,8 +5528,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Detrius (detoc) [mol C m-3] @@ -5540,8 +5540,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 CaCO3 shells (calc) [mol C m-3] @@ -5552,8 +5552,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Opal shells (opal) [mol Si m-3] @@ -5564,8 +5564,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 ] @@ -5576,8 +5576,8 @@ diabgc diabgc - 0, 0, 2 - 2, 2, 2 + 0,0,2 + 4,2,2 0,0,0 Nitrous oxide concentration [mol N2O m-3] @@ -5588,8 +5588,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -5600,8 +5600,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Calcite saturation state (omegac) [1] @@ -5612,8 +5612,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Aragonite saturation state (omegaa) [1] @@ -5624,8 +5624,8 @@ diabgc diabgc - 0, 4, 4 - 4, 4, 4 + 0,4,4 + 4,4,4 0,0,0 preformed oxygen (p_o2) [mol O2 m-3] @@ -5636,7 +5636,7 @@ diabgc diabgc - 0, 4, 4 + 0,4,4 Saturated oxygen (satoxy) [mol O2 m-3] @@ -5646,8 +5646,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 preformed phosphate (p_po4) [mol PO4 m-3] @@ -5658,8 +5658,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 preformed alkalinity (p_talk) [eq m-3] @@ -5670,8 +5670,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 preformed DIC (p_dic) [mol C m-3] @@ -5682,8 +5682,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 saturated DIC (dic_sat) [mol C m-3] @@ -5694,8 +5694,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural dissolved carbon (natdissic) [mol C m-3] @@ -5706,8 +5706,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural alkalinity (nattalk) [eq m-3] @@ -5718,8 +5718,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural carbonate ion concentration (natco3) [mol C m-3] @@ -5730,8 +5730,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural CaCO3 shells (natcalc) [mol C m-3] @@ -5742,8 +5742,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural pH (natph) [-log10([h+])] @@ -5754,8 +5754,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural calcite saturation state (natomegac) [1] @@ -5766,8 +5766,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Natural aragonite saturation state (natomegaa) [1] @@ -5778,8 +5778,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Dissolved C13 (dissic13) [mol C m-3] @@ -5790,8 +5790,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Dissolved C14 (dissic14) [mol C m-3] @@ -5802,8 +5802,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 delta 13C of DIC [1] @@ -5814,8 +5814,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Particulate organic carbon 13 (detoc13) [mol C m-3] @@ -5826,8 +5826,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Dissolved organic carbon 13 (dissoc13) [mol C m-3] @@ -5838,8 +5838,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Particulate inorganic carbon 13 (calc13) [mol C m-3] @@ -5850,8 +5850,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 13C of phytoplankton biomass (phyc13) [mol C m-3] @@ -5862,8 +5862,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 13C of zootoplankton biomass (zooc13) [mol C m-3] @@ -5874,8 +5874,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 CFC11 concentration [mol CFC11 m-3] @@ -5886,8 +5886,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 CFC12 concentration [mol CFC12 m-3] @@ -5898,8 +5898,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 SF6 concentration [mol SF6 m-3] @@ -5910,11 +5910,11 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 - Number of sinking particles (aggregate scheme, nos) [cm-3] + Number of sinking particles (aggregate scheme,nos) [cm-3] @@ -5922,8 +5922,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Mass sinking velocity (aggregate scheme) [m d-1] @@ -5934,8 +5934,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 Number sinking velocity (aggregate scheme) [m d-1] @@ -5946,8 +5946,8 @@ diabgc diabgc - 0, 0, 0 - 0, 0, 0 + 0,0,0 + 0,0,0 0,0,0 Epsilon exponent (aggregate scheme) [1] @@ -5958,8 +5958,8 @@ diabgc diabgc - 0, 0, 0 - 0, 0, 0 + 0,0,0 + 0,0,0 0,0,0 Average particle size (aggregate scheme) @@ -5970,8 +5970,8 @@ diabgc diabgc - 0, 2, 2 - 2, 2, 2 + 0,2,2 + 4,2,2 0,0,0 @@ -5982,8 +5982,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -5994,8 +5994,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -6006,8 +6006,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 @@ -6018,8 +6018,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 sediment - water-column diffusive flux of oxygen [mol O2 m-2 s-1] @@ -6030,8 +6030,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 sediment - water-column diffusive flux of N2 [mol N2 m-2 s-1] @@ -6042,8 +6042,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 sediment - water-column diffusive flux of nitrate [mol NO3 m-2 s-1] @@ -6054,8 +6054,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 sediment - water-column diffusive flux of silica [mol Si m-2 s-1] @@ -6066,8 +6066,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (powdic) [mol C m-3] @@ -6078,8 +6078,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (powalk) [eq m-3] @@ -6090,8 +6090,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (powpho) [eq m-3] @@ -6102,8 +6102,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (powox) [mol O2 m-3] @@ -6114,8 +6114,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (pown2) [mol N2 m-3] @@ -6126,8 +6126,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (powno3)[mol N m-3] @@ -6138,8 +6138,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (powsi) [mol Si m-3] @@ -6150,8 +6150,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (ssso12) [mol m-3] @@ -6162,8 +6162,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (ssssil) [mol Si m-3] @@ -6174,8 +6174,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (sssc12) [mol C m-3] @@ -6186,8 +6186,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (ssster) [mol m-3] @@ -6198,8 +6198,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (ssso12) [mol m-3] @@ -6210,8 +6210,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (ssssil) [mol Si m-3] @@ -6222,8 +6222,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (sssc12) [mol C m-3] @@ -6234,8 +6234,8 @@ diabgc diabgc - 0, 0, 2 - 2, 0, 2 + 0,0,2 + 2,0,2 0,0,0 (ssster) [mol m-3] From 8bade57acada8cbe0a0d4ab54e2b4347528006c7 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Wed, 2 Aug 2023 09:36:13 +0200 Subject: [PATCH 15/33] changed comment in buildcpp --- cime_config/buildcpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/buildcpp b/cime_config/buildcpp index cc830111..8ea9436f 100644 --- a/cime_config/buildcpp +++ b/cime_config/buildcpp @@ -87,7 +87,6 @@ def buildcpp(case): hamocc_nattrc = case.get_value("HAMOCC_NATTRC") hamocc_sedbypass = case.get_value("HAMOCC_SEDBYPASS") hamocc_ciso = case.get_value("HAMOCC_CISO") - hamocc_vsls = case.get_value("HAMOCC_VSLS") blom_unit = case.get_value("BLOM_UNIT") pio_typename = case.get_value("PIO_TYPENAME", subgroup="OCN") @@ -144,7 +143,8 @@ def buildcpp(case): expect(hamocc_sedbypass, "HAMOCC C-isotopes currently not supported in the sediment module. Use HAMOCC_SEDBYPASS=TRUE") blom_cppdefs = blom_cppdefs + " -Dcisonew" if ocn_grid in ["tnx1v4"]: - # HAMOCC will always compute bromoform flux and dms flux and send to the mediator + # HAMOCC bromoform scheme currently only supported on the tnx1v4 grid + # (no swa-climatology has been created for other grid configurations)" blom_cppdefs = blom_cppdefs + " -DBROMO" if co2type == "prognostic": blom_cppdefs = blom_cppdefs + " -DPROGCO2" From 2f011a95524922f3f313655f4ebb668944ab36df Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sat, 5 Aug 2023 21:31:43 +0200 Subject: [PATCH 16/33] buildnml using paramgen --- cime_config/buildnml | 458 +++--- cime_config/namelist_definition_blom.xml | 418 +++--- cime_config/ocn_in_paramgen.py | 1658 ++++++++++++++++++++++ 3 files changed, 2071 insertions(+), 463 deletions(-) create mode 100644 cime_config/ocn_in_paramgen.py diff --git a/cime_config/buildnml b/cime_config/buildnml index d725d2b3..9b5b26f7 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -1,272 +1,250 @@ #!/usr/bin/env python3 -"""BLOM namelist creator """ +BLOM namelist creator +""" +import sys +import os +import shutil +import logging +import glob + +_CIMEROOT = os.environ.get("CIMEROOT") +if _CIMEROOT is None: + raise SystemExit("ERROR: must set CIMEROOT environment variable") -# Typically ignore this. -# pylint: disable=invalid-name +_LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools") +sys.path.append(_LIBDIR) +# pylint: disable=wildcard-import, wrong-import-position +# pylint: disable=unused-wildcard-import +from CIME.Tools.standard_script_setup import * +from CIME.XML.standard_module_setup import * +from CIME.buildnml import create_namelist_infile, parse_input +from CIME.case import Case +from CIME.utils import expect -# Disable these because this is our standard setup -# pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-position +# Save local (cime_config) directory path: +_CIME_CONFIG_PATH = os.path.dirname(os.path.abspath(__file__)) -import os, shutil, sys, glob, filecmp, imp, re +# Add local (cime_config) directory to python path: +sys.path.append(_CIME_CONFIG_PATH) -CIMEROOT = os.environ.get("CIMEROOT") -if CIMEROOT is None: - raise SystemExit("ERROR: must set CIMEROOT environment variable") -sys.path.append(os.path.join(CIMEROOT, "CIME", "Tools")) - -from standard_script_setup import * -from CIME.case import Case -from CIME.nmlgen import NamelistGenerator -from CIME.utils import expect -from CIME.utils import run_cmd_no_fail, expect -from CIME.utils import run_cmd -from CIME.buildnml import create_namelist_infile, parse_input - -import glob, shutil -logger = logging.getLogger(__name__) - -# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements -#################################################################################### -def _create_namelists(case, confdir, infile, nmlgen): -#################################################################################### - - """Write out the namelist for this component. - - Most arguments are the same as those for `NamelistGenerator`. - The `confdir` argument is used to specify the directory in which output files will be placed. - """ - rundir = case.get_value("RUNDIR") - srcroot = case.get_value("SRCROOT") - din_loc_root = case.get_value("DIN_LOC_ROOT") - caseroot = case.get_value("CASEROOT") - continue_run = case.get_value("CONTINUE_RUN") - ocn_grid = case.get_value("OCN_GRID") - ocn_ncpl = case.get_value("OCN_NCPL") - blom_unit = case.get_value("BLOM_UNIT") - blom_vcoord = case.get_value("BLOM_VCOORD") - pio_typename_ocn = case.get_value("PIO_TYPENAME_OCN") - pio_netcdf_format_ocn = case.get_value("PIO_NETCDF_FORMAT_OCN") - is_test = case.get_value("TEST") - blom_river_nutrients = case.get_value("BLOM_RIVER_NUTRIENTS") - blom_n_deposition = case.get_value("BLOM_N_DEPOSITION") - blom_ndep_scenario = case.get_value("BLOM_NDEP_SCENARIO") - blom_coupling = case.get_value("BLOM_COUPLING") - blom_tracer_modules = case.get_value("BLOM_TRACER_MODULES") - hamocc_vsls = case.get_value("HAMOCC_VSLS") - hamocc_ciso = case.get_value("HAMOCC_CISO") - hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP") - hamocc_sedspinup_yr_start = case.get_value("HAMOCC_SEDSPINUP_YR_START") - hamocc_sedspinup_yr_end = case.get_value("HAMOCC_SEDSPINUP_YR_END") - hamocc_sedspinup_ncycle = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") - - # error checks - if hamocc_vsls and ocn_grid != "tnx1v4": - expect(False, - "HAMOCC_VSLS is not supported at this grid resolution (no swa-climatology available)") - - # create config dictionary - used in namelist_definition_blom.xml - config = {} - - config['ocn_grid'] = ocn_grid - config['ocn_ncpl'] = str(ocn_ncpl) - config['pio_typename_ocn'] = pio_typename_ocn - config['pio_netcdf_format_ocn'] = pio_netcdf_format_ocn - config["continue_run"] = "yes" if continue_run else "no" - config["is_test"] = "yes" if is_test else "no" - if is_test: - testcase = case.get_value("TESTCASE") - config["is_test_pfs"] = "yes" if testcase == "PFS" else "no" - config["empty_hist"] = "yes" if testcase == "PFS" else "no" - - config['blom_unit'] = blom_unit if blom_unit else "unset" - config['blom_vcoord'] = blom_vcoord - config["blom_river_nutrients"] = "yes" if blom_river_nutrients else "no" - config["blom_ndep_scenario"] = "ssp" if "ssp" in blom_ndep_scenario else blom_ndep_scenario - config["blom_n_deposition"] = "yes" if blom_n_deposition else "no" - config["blom_coupling"] = blom_coupling - config["blom_tracer_modules"] = blom_tracer_modules - - config["hamocc_vsls"] = "yes" if hamocc_vsls else "no" - config["hamocc_ciso"] = "yes" if hamocc_ciso else "no" - config["hamocc_sedspinup"] = "yes" if hamocc_sedspinup else "no" - config["hamocc_sedspinup_yr_start"] = hamocc_sedspinup_yr_start - config["hamocc_sedspinup_yr_end"] = hamocc_sedspinup_yr_end - config["hamocc_sedspinup_ncycle"] = hamocc_sedspinup_ncycle - - #---------------------------------------------------- - # initialize namelist defaults - #---------------------------------------------------- - nmlgen.init_defaults(infile, config) - - if nmlgen.get_value('swaclimfile') == 'UNSET': - nmlgen.set_value('swaclimfile', value="") - - if nmlgen.get_value('inid13c') == 'UNSET': - nmlgen.set_value('inid13c', value="") - - if nmlgen.get_value('inid14c') == 'UNSET': - nmlgen.set_value('inid14c', value="") - - run_startdate = case.get_value("RUN_STARTDATE") - idate = run_startdate.replace('-','') - nmlgen.set_value("idate", idate) - nmlgen.set_value("idate0", idate) - - #---------------------------------------------------- - # Write out namelist groups - #---------------------------------------------------- - groups=['limits','diffusion'] - - cwmtag = nmlgen.get_default('cwmtag', config=config) - if cwmtag[0] != 'unset': - groups.append('cwmod') - - groups.append('merdia') - groups.append('secdia') - groups.append('diaphy') - - if case.get_value("BLOM_VCOORD") == "cntiso_hybrid": - groups.append('vcoord') - - if "ecosys" in case.get_value("BLOM_TRACER_MODULES"): - groups.append("bgcnml") - groups.append("bgcoafx") - groups.append("diabgc") - - data_list_path = os.path.join(case.get_case_root(), "Buildconf", "blom.input_data_list") - if os.path.exists(data_list_path): - os.remove(data_list_path) - - # Create initial ocn_in - namelist_file = os.path.join(confdir, "ocn_in") - nmlgen.write_output_file(namelist_file, data_list_path, groups=groups, sorted_groups=False) - - # Replace MER_REGFLAG1 -> MER_REGFLAG4 with array syntax in ocn_in - from pathlib import Path - file = Path(namelist_file) - file.write_text(file.read_text().replace('mer_regflg1','mer_regflg(1,:)')) - file.write_text(file.read_text().replace('mer_regflg2','mer_regflg(2,:)')) - file.write_text(file.read_text().replace('mer_regflg3','mer_regflg(3,:)')) - file.write_text(file.read_text().replace('mer_regflg4','mer_regflg(4,:)')) - - # To compare with previous namelist generation, make namelist variable uppercase and - # use single quotes instead of back quotes and make sure that file variables set to UNSET - # get changed to blank quotes - namelist_file_temp = os.path.join(confdir, "ocn_in_temp") - with open(namelist_file, "r") as fread: - with open(namelist_file_temp, "w") as fwrite: - for line_read in fread: - # replace single quote with double quote to generate same namelist as using - # csh buildnml - line = line_read.replace('"',"'") - # make all namelists upper case to generate same namelist as using csh buildnml - tokens = line.split('=',maxsplit=1) - if len(tokens) == 2: - # Change UNSET values for files to lower case - if 'UNSET' in tokens[1]: - tokens[1] = "'unset'" - fwrite.write(f" {tokens[0].upper().strip()} = {tokens[1].strip()}\n") - else: - fwrite.write(line) - shutil.move(namelist_file_temp, namelist_file) - - # Copy ocn_in.readme to $RUNDIR - src_filename = os.path.join(srcroot,"components","blom","cime_config","ocn_in.readme") - dst_filename = os.path.join(rundir,"ocn_in.readme") - - if not os.path.exists(dst_filename): - shutil.copy(src_filename, dst_filename) - - logger.debug(f"blom: grid is {ocn_grid}") +#Import BLOM's ParamGen class: +from ocn_in_paramgen import OcnInParamGen + +# Open CIME case log: +_LOGGER = logging.getLogger(__name__) ############################################################################### def buildnml(case, caseroot, compname): ############################################################################### + # pylint: disable=too-many-locals """Build the blom namelist """ # Build the component namelist if compname != "blom": - raise AttributeError - comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN") - srcroot = case.get_value("SRCROOT") - rundir = case.get_value("RUNDIR") - ninst = case.get_value("NINST_OCN") - - # determine the confdir directory - confdir = os.path.join(caseroot,"Buildconf","blomconf") - if not os.path.isdir(confdir): - os.makedirs(confdir) - - #---------------------------------------------------- - # Construct the namelist generator - #---------------------------------------------------- - # determine directory for user modified namelist_definitions.xml and namelist_defaults.xml - user_xml_dir = os.path.join(caseroot, "SourceMods", "src.blom") - expect (os.path.isdir(user_xml_dir), - "user_xml_dir %s does not exist " %user_xml_dir) - - # user definition *replaces* existing definition. - namelist_xml_dir = os.path.join(comp_root_dir_ocn, "cime_config") - definition_file = [os.path.join(namelist_xml_dir, "namelist_definition_blom.xml")] - user_definition = os.path.join(user_xml_dir, "namelist_definition_blom.xml") - if os.path.isfile(user_definition): - definition_file = [user_definition] - for file_ in definition_file: - expect(os.path.isfile(file_), "Namelist XML file %s not found!" % file_) - - # Create the namelist generator object - independent of instance - nmlgen = NamelistGenerator(case, definition_file) - - #---------------------------------------------------- - # Loop over instances - #---------------------------------------------------- + emsg = "BLOM buildnml called with model={}" + raise AttributeError(emsg.format(compname)) + # End if + srcroot = case.get_value("SRCROOT") + rundir = case.get_value("RUNDIR") + ninst_ocn = case.get_value("NINST_OCN") + run_type = case.get_value("RUN_TYPE") + run_startdate = case.get_value("RUN_STARTDATE") + run_refcase = case.get_value("RUN_REFCASE") + run_refdate = case.get_value("RUN_REFDATE") + run_reftod = case.get_value("RUN_REFTOD") + + testsrc = os.path.join(srcroot, "components", "blom") + if os.path.exists(testsrc): + srcroot = testsrc + + #-------------------------- + # Construct ParamGen objects: + #-------------------------- + + xml_fil = os.path.join(srcroot,"cime_config","namelist_definition_blom.xml") + pg_blom = OcnInParamGen.from_namelist_xml(xml_fil) + + #------------------------ + # Loop over all instances: + #------------------------ + + # Set input data list file name: + input_data_list = os.path.join(caseroot, "Buildconf", "blom.input_data_list") + + # Convert instance number to integer: + ninst = int(ninst_ocn) + for inst_counter in range(1, ninst+1): - # determine instance string + #---------------------- + # Remove old input data: + #---------------------- + + if os.path.isfile(input_data_list): + os.remove(input_data_list) + + # ----------------------------------------------------- + # Determine instance string + # ----------------------------------------------------- + inst_string = "" if ninst > 1: - inst_string = '_' + '%04d' % inst_counter + single_case_rpointer = os.path.join(rundir, "rpointer.ocn") + inst_string = '_%04d' % inst_counter + instance_rpointer = os.path.join(rundir, "rpointer.ocn"+inst_string) + + # If multi-instance case does not have restart file, use + # single-case restart for each instance - # If multi-instance case does not have restart file, use - # single-case restart for each instance - rpointer = "rpointer.ice" - if (os.path.isfile(os.path.join(rundir,rpointer)) and - (not os.path.isfile(os.path.join(rundir,rpointer + inst_string)))): - shutil.copy(os.path.join(rundir, rpointer), - os.path.join(rundir, rpointer + inst_string)) + if os.path.isfile(single_case_rpointer) and \ + not os.path.isfile(instance_rpointer): + shutil.copy(single_case_rpointer, instance_rpointer) + # End if + # End if - inst_string_label = inst_string - if not inst_string_label: - inst_string_label = "\"\"" + # ----------------------------------------------------- + # Create blomconf/namelist + # ----------------------------------------------------- - # create namelist_infile using user_nl_file as input + infile_lines = [] + + # Determine location and name of "user_nl_blom" files: user_nl_file = os.path.join(caseroot, "user_nl_blom" + inst_string) - expect(os.path.isfile(user_nl_file), - "Missing required user_nl_file %s " %(user_nl_file)) - infile = os.path.join(confdir, "namelist_infile") - create_namelist_infile(case, user_nl_file, infile) - namelist_infile = [infile] - - # create namelist - _create_namelists(case, confdir, namelist_infile, nmlgen) - - # copy namelist files to rundir - if os.path.isdir(rundir): - file1 = os.path.join(confdir, "ocn_in") - file2 = os.path.join(rundir, "ocn_in") - if inst_string: - file2 += inst_string - logger.debug("BLOM namelist copy: file1 %s file2 %s " %(file1, file2)) - shutil.copy2(file1, file2) + + # Determine location and name of namelist input file: + confdir = os.path.join(caseroot,"Buildconf","blomconf") + if not os.path.isdir(confdir): + os.makedirs(confdir) + namelist_infile = os.path.join(confdir, "namelist_infile") + + #-------------------------------- + # Create CIME namelist input file: + #-------------------------------- + create_namelist_infile(case, user_nl_file, namelist_infile, + "\n".join(infile_lines)) + + #------------------------------------------- + # Add user_nl_blom entries to ParamGen object: + #------------------------------------------- + + pg_blom.append_user_nl_file(user_nl_file) + + #------------------------------------------------- + # Create config dictionary + #------------------------------------------------- + + rundir = case.get_value("RUNDIR") + srcroot = case.get_value("SRCROOT") + din_loc_root = case.get_value("DIN_LOC_ROOT") + caseroot = case.get_value("CASEROOT") + continue_run = case.get_value("CONTINUE_RUN") + ocn_grid = case.get_value("OCN_GRID") + ocn_ncpl = case.get_value("OCN_NCPL") + blom_unit = case.get_value("BLOM_UNIT") + blom_vcoord = case.get_value("BLOM_VCOORD") + pio_typename_ocn = case.get_value("PIO_TYPENAME_OCN") + pio_netcdf_format_ocn = case.get_value("PIO_NETCDF_FORMAT_OCN") + is_test = case.get_value("TEST") + blom_river_nutrients = case.get_value("BLOM_RIVER_NUTRIENTS") + blom_n_deposition = case.get_value("BLOM_N_DEPOSITION") + blom_ndep_scenario = case.get_value("BLOM_NDEP_SCENARIO") + blom_coupling = case.get_value("BLOM_COUPLING") + blom_tracer_modules = case.get_value("BLOM_TRACER_MODULES") + hamocc_vsls = case.get_value("HAMOCC_VSLS") + hamocc_ciso = case.get_value("HAMOCC_CISO") + hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP") + hamocc_sedspinup_yr_start = case.get_value("HAMOCC_SEDSPINUP_YR_START") + hamocc_sedspinup_yr_end = case.get_value("HAMOCC_SEDSPINUP_YR_END") + hamocc_sedspinup_ncycle = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") + + # error checks + if hamocc_vsls and ocn_grid != "tnx1v4": + expect(False, + "HAMOCC_VSLS is not supported at this grid resolution (no swa-climatology available)") + + # create config dictionary - used in namelist_definition_blom.xml + config = {} + + config['ocn_grid'] = ocn_grid + config['ocn_ncpl'] = str(ocn_ncpl) + config['pio_typename_ocn'] = pio_typename_ocn + config['pio_netcdf_format_ocn'] = pio_netcdf_format_ocn + config["continue_run"] = "yes" if continue_run else "no" + config["is_test"] = "yes" if is_test else "no" + if is_test: + testcase = case.get_value("TESTCASE") + config["is_test_pfs"] = "yes" if testcase == "PFS" else "no" + config["empty_hist"] = "yes" if testcase == "PFS" else "no" + + config['blom_unit'] = blom_unit if blom_unit else "unset" + config['blom_vcoord'] = blom_vcoord + config["blom_river_nutrients"] = "yes" if blom_river_nutrients else "no" + config["blom_ndep_scenario"] = "ssp" if "ssp" in blom_ndep_scenario else blom_ndep_scenario + config["blom_n_deposition"] = "yes" if blom_n_deposition else "no" + config["blom_coupling"] = blom_coupling + config["blom_tracer_modules"] = blom_tracer_modules + + config["hamocc_vsls"] = "yes" if hamocc_vsls else "no" + config["hamocc_ciso"] = "yes" if hamocc_ciso else "no" + config["hamocc_sedspinup"] = "yes" if hamocc_sedspinup else "no" + config["hamocc_sedspinup_yr_start"] = hamocc_sedspinup_yr_start + config["hamocc_sedspinup_yr_end"] = hamocc_sedspinup_yr_end + config["hamocc_sedspinup_ncycle"] = hamocc_sedspinup_ncycle + + #--------------------------------- + # Set all ParamGen namelist values: + #--------------------------------- + + pg_blom.reduce_ocn_in(case, config) + + #--------------------------- + # Write out Fortran namelist: + #--------------------------- + + # Create resolved BLOM namelist file name: + namelist_file = os.path.join(rundir, "ocn_in") + + # Change namelist file name depending on instance: + namelist_file += inst_string + + # Create BLOM namelist + groups=['limits','diffusion','merdia','secdia','diaphy'] + + if case.get_value("BLOM_VCOORD") == "cntiso_hybrid": + groups.append('vcoord') + + if "ecosys" in case.get_value("BLOM_TRACER_MODULES"): + groups.append("bgcnml") + groups.append("bgcoafx") + groups.append("diabgc") + + pg_blom.write_nmlfile(namelist_file, groups) + + # Replace MER_REGFLAG1 -> MER_REGFLAG4 with array syntax in ocn_in + from pathlib import Path + filename = Path(namelist_file) + filename.write_text(filename.read_text().replace('mer_regflg1','mer_regflg(1,:)')) + filename.write_text(filename.read_text().replace('mer_regflg2','mer_regflg(2,:)')) + filename.write_text(filename.read_text().replace('mer_regflg3','mer_regflg(3,:)')) + filename.write_text(filename.read_text().replace('mer_regflg4','mer_regflg(4,:)')) + + + # Write out blom.input_data_list + data_list_path = os.path.join(case.get_case_root(), "Buildconf", "blom.input_data_list") + if os.path.exists(data_list_path): + os.remove(data_list_path) + pg_blom.write_inputdata(data_list_path, groups) + ############################################################################### def _main_func(): caseroot = parse_input(sys.argv) - with Case(caseroot, read_only=False) as case: + with Case(caseroot) as case: buildnml(case, caseroot, "blom") + # End with if __name__ == "__main__": _main_func() diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 2c5720df..15dc964a 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -1,8 +1,6 @@ - - - + - + char vcoord vcoord $BLOM_VCOORD - + add desc @@ -796,7 +789,7 @@ ppm - + add desc @@ -806,7 +799,7 @@ monotonic - + add desc @@ -816,7 +809,7 @@ non_oscillatory - + add desc @@ -826,7 +819,7 @@ non_oscillatory - + add desc @@ -836,7 +829,7 @@ .false. - + add desc @@ -846,7 +839,7 @@ .false. - + add desc @@ -856,7 +849,7 @@ .true. - + add desc @@ -866,7 +859,7 @@ .false. - + add desc @@ -876,7 +869,7 @@ .true. - + add desc @@ -886,7 +879,7 @@ .false. - + add desc @@ -896,7 +889,7 @@ 2.5 - + add desc @@ -906,7 +899,7 @@ 1.08 - + add desc @@ -916,7 +909,7 @@ .1 - + add desc @@ -926,7 +919,7 @@ 4 - + add desc @@ -936,7 +929,7 @@ 1 - + add desc @@ -1068,14 +1061,13 @@ Factor relating the isopycnal diffusivity to the layer - + char diffusion diffusion - UNSET + unset - abs Name of file containing topographic beta parameter (a)Name of file containing topographic beta parameter @@ -1239,7 +1231,6 @@ 'unset','unset' 'u','u' 'u','u' - Array of C grid cell edges to be modified. Valid options: @@ -1276,7 +1267,6 @@ 1.e36,1.e36 30.e3,30.e3 30.e3,30.e3 - Array of modified grid cell widths (m) (f) @@ -1285,7 +1275,7 @@ - + char secdia secdia @@ -1296,7 +1286,6 @@ $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.25v4_20190612.dat $DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.125v4_20221013.dat - abs Name of file containing section specification for section transport computation @@ -2236,7 +2225,7 @@ 4,4,0 0,0,0 - + add desc @@ -2248,7 +2237,7 @@ 4,4,0 0,0,0 - + add desc @@ -2260,7 +2249,7 @@ 4,4,0 0,0,0 - + add desc @@ -2272,7 +2261,7 @@ 4,4,0 0,0,0 - + add desc @@ -2284,7 +2273,7 @@ 0,0,0 0,0,0 - + add desc @@ -2296,7 +2285,7 @@ 4,4,0 0,0,0 - + add desc @@ -2308,7 +2297,7 @@ 4,4,0 0,0,0 - + add desc @@ -2320,7 +2309,7 @@ 4,4,0 0,0,0 - + add desc @@ -2332,7 +2321,7 @@ 0,0,4 0,0,0 - + add desc @@ -2344,7 +2333,7 @@ 0,0,4 0,0,0 - + add desc @@ -2356,7 +2345,7 @@ 0,0,4 0,0,0 - + add desc @@ -2368,7 +2357,7 @@ 0,0,4 0,0,0 - + add desc @@ -2380,7 +2369,7 @@ 0,0,4 0,0,0 - + add desc @@ -2392,7 +2381,7 @@ 0,0,4 0,0,0 - + add desc @@ -2404,7 +2393,7 @@ 0,0,4 0,0,0 - + add desc @@ -2416,7 +2405,7 @@ 0,0,4 0,0,0 - + add desc @@ -2428,7 +2417,7 @@ 0,0,4 0,0,0 - + add desc @@ -2440,7 +2429,7 @@ 4,4,0 0,0,0 - + add desc @@ -2452,7 +2441,7 @@ 4,4,0 0,0,0 - + add desc @@ -2464,7 +2453,7 @@ 4,4,0 0,0,0 - + add desc @@ -2476,7 +2465,7 @@ 4,4,0 0,0,0 - + add desc @@ -2488,7 +2477,7 @@ 0,0,4 0,0,0 - + add desc @@ -2500,7 +2489,7 @@ 0,0,4 0,0,0 - + add desc @@ -2512,7 +2501,7 @@ 0,0,4 0,0,0 - + add desc @@ -2524,7 +2513,7 @@ 0,0,4 0,0,0 - + add desc @@ -2536,7 +2525,7 @@ 0,0,4 0,0,0 - + add desc @@ -2548,7 +2537,7 @@ 0,0,4 0,0,0 - + add desc @@ -2560,7 +2549,7 @@ 0,0,4 0,0,0 - + add desc @@ -2572,7 +2561,7 @@ 4,4,0 0,0,0 - + add desc @@ -2584,7 +2573,7 @@ 4,4,0 0,0,0 - + add desc @@ -2596,7 +2585,7 @@ 4,4,0 0,0,0 - + add desc @@ -2608,7 +2597,7 @@ 4,4,0 0,0,0 - + add desc @@ -2620,7 +2609,7 @@ 4,4,0 0,0,0 - + add desc @@ -2632,7 +2621,7 @@ 4,4,0 0,0,0 - + add desc @@ -2644,7 +2633,7 @@ 4,4,0 0,0,0 - + add desc @@ -2656,7 +2645,7 @@ 4,4,0 0,0,0 - + add desc @@ -2668,7 +2657,7 @@ 4,4,0 0,0,0 - + add desc @@ -2680,7 +2669,7 @@ 4,4,0 0,0,0 - + add desc @@ -2692,7 +2681,7 @@ 4,4,0 0,0,0 - + add desc @@ -2704,7 +2693,7 @@ 4,4,0 0,0,0 - + add desc @@ -2716,7 +2705,7 @@ 4,4,0 0,0,0 - + add desc @@ -2728,7 +2717,7 @@ 4,4,0 0,0,0 - + add desc @@ -2740,7 +2729,7 @@ 4,4,0 0,0,0 - + add desc @@ -2752,7 +2741,7 @@ 4,4,0 0,0,0 - + add desc @@ -2764,7 +2753,7 @@ 4,4,0 0,0,0 - + add desc @@ -2776,7 +2765,7 @@ 0,0,0 0,0,0 - + add desc @@ -2788,7 +2777,7 @@ 4,4,0 0,0,0 - + add desc @@ -2800,7 +2789,7 @@ 4,4,0 0,0,0 - + add desc @@ -2812,7 +2801,7 @@ 4,4,0 0,0,0 - + add desc @@ -2824,7 +2813,7 @@ 0,0,4 0,0,0 - + add desc @@ -2836,7 +2825,7 @@ 0,0,4 0,0,0 - + add desc @@ -2848,7 +2837,7 @@ 0,0,4 0,0,0 - + add desc @@ -2860,7 +2849,7 @@ 0,0,4 0,0,0 - + add desc @@ -2872,7 +2861,7 @@ 0,0,4 0,0,0 - + add desc @@ -2884,7 +2873,7 @@ 0,0,4 0,0,0 - + add desc @@ -2896,7 +2885,7 @@ 0,0,4 0,0,0 - + add desc @@ -2908,7 +2897,7 @@ 0,0,4 0,0,0 - + add desc @@ -2920,7 +2909,7 @@ 0,0,4 0,0,0 - + add desc @@ -2932,7 +2921,7 @@ 0,0,4 0,0,0 - + add desc @@ -2946,7 +2935,7 @@ 4,4,0 0,0,0 - + add desc @@ -2958,7 +2947,7 @@ 4,4,0 0,0,0 - + add desc @@ -2970,7 +2959,7 @@ 0,0,4 0,0,0 - + add desc @@ -2982,7 +2971,7 @@ 0,0,4 0,0,0 - + add desc @@ -2994,7 +2983,7 @@ 0,0,4 0,0,0 - + add desc @@ -3006,7 +2995,7 @@ 0,0,4 0,0,0 - + add desc @@ -3018,7 +3007,7 @@ 0,0,4 0,0,0 - + add desc @@ -3030,7 +3019,7 @@ 0,0,4 0,0,0 - + add desc @@ -3042,7 +3031,7 @@ 0,0,4 0,0,0 - + add desc @@ -3054,7 +3043,7 @@ 0,0,4 0,0,0 - + add desc @@ -3066,7 +3055,7 @@ 4,4,0 0,0,0 - + add desc @@ -3078,7 +3067,7 @@ 4,4,0 0,0,0 - + add desc @@ -3090,7 +3079,7 @@ 4,4,0 0,0,0 - + add desc @@ -3102,7 +3091,7 @@ 4,4,0 0,0,0 - + add desc @@ -3114,7 +3103,7 @@ 4,4,0 0,0,0 - + add desc @@ -3126,7 +3115,7 @@ 4,4,0 0,0,0 - + add desc @@ -3138,7 +3127,7 @@ 4,4,0 0,0,0 - + add desc @@ -3150,7 +3139,7 @@ 4,4,0 0,0,0 - + add desc @@ -3162,7 +3151,7 @@ 4,4,0 0,0,0 - + add desc @@ -3174,7 +3163,7 @@ 4,4,0 0,0,0 - + add desc @@ -3186,7 +3175,7 @@ 4,4,0 0,0,0 - + add desc @@ -3198,7 +3187,7 @@ 4,4,0 0,0,0 - + add desc @@ -3210,7 +3199,7 @@ 4,4,0 0,0,0 - + add desc @@ -3222,7 +3211,7 @@ 4,4,0 0,0,0 - + add desc @@ -3234,7 +3223,7 @@ 4,4,0 0,0,0 - + add desc @@ -3246,7 +3235,7 @@ 4,4,0 0,0,0 - + add desc @@ -3258,7 +3247,7 @@ 4,4,0 0,0,0 - + add desc @@ -3270,7 +3259,7 @@ 4,4,0 0,0,0 - + add desc @@ -3282,7 +3271,7 @@ 4,4,0 0,0,0 - + add desc @@ -3294,7 +3283,7 @@ 4,4,0 0,0,0 - + add desc @@ -3306,7 +3295,7 @@ 4,4,0 0,0,0 - + add desc @@ -3318,7 +3307,7 @@ 4,4,0 0,0,0 - + add desc @@ -3330,7 +3319,7 @@ 4,4,0 0,0,0 - + add desc @@ -3342,7 +3331,7 @@ 4,4,0 0,0,0 - + add desc @@ -3354,7 +3343,7 @@ 4,4,0 0,0,0 - + add desc @@ -3366,7 +3355,7 @@ 4,4,0 0,0,0 - + add desc @@ -3378,7 +3367,7 @@ 4,4,0 0,0,0 - + add desc @@ -3390,14 +3379,14 @@ 4,4,0 0,0,0 - + add desc - + char merdia merdia @@ -3408,11 +3397,10 @@ $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.25v4_20190612.nc $DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.125v4_20221013.nc - abs Name of file containing ocean region specification (a) - + char merdia merdia @@ -3423,7 +3411,6 @@ $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat $DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat - abs Name of file containing zonal section specification for @@ -3498,7 +3485,7 @@ - + real bgcnml bgcnml @@ -3519,7 +3506,6 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.25v4_20181004.nc $DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.125v4_20221013.nc - abs 'File name (incl. full path) for iron (dust) deposition data' @@ -3531,7 +3517,6 @@ UNSET $DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc - abs File name (incl. full path) for swa climatology field (needed if bromoform scheme is activated) @@ -3557,7 +3542,6 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.25v4_20170821.nc $DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.125v4_20221013.nc - abs File name (incl. full path) for riverine input data @@ -3591,7 +3575,6 @@ $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx0.25v4_20190705.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx0.125v4_20221013.nc - abs File name (incl. full path) for atmopheric N-deposition data @@ -3602,7 +3585,7 @@ .false. - + add desc @@ -3616,7 +3599,7 @@ Logical switch to activate sediment spin-upLogical switch to activate sediment spin-up - + integer bgcnml bgcnml @@ -3627,7 +3610,7 @@ Start year for sediment spinup - + integer bgcnml bgcnml @@ -3655,8 +3638,7 @@ $DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_Ct_preind_OMIPinit_20171107.nc - abs - + add desc @@ -3666,8 +3648,7 @@ $DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_At_OMIPinit_20171107.nc - abs - + add desc @@ -3677,8 +3658,7 @@ $DIN_LOC_ROOT/ocn/blom/inicon/woa13_phosphate_OMIPinit_20171107.nc - abs - + add desc @@ -3688,8 +3668,7 @@ $DIN_LOC_ROOT/ocn/blom/inicon/woa13_oxygen_OMIPinit_20171107.nc - abs - + add desc @@ -3699,22 +3678,20 @@ $DIN_LOC_ROOT/ocn/blom/inicon/woa13_nitrate_OMIPinit_20171107.nc - abs - + add desc - + char bgcnml bgcnml $DIN_LOC_ROOT/ocn/blom/inicon/woa13_silicate_OMIPinit_20171107.nc - abs - + add desc - + char bgcnml bgcnml @@ -3722,11 +3699,10 @@ UNSET $DIN_LOC_ROOT/ocn/blom/inicon/d13C_permil_20180609.nc - abs - + add desc - + char bgcnml bgcnml @@ -3734,8 +3710,7 @@ UNSET $DIN_LOC_ROOT/ocn/blom/inicon/d14C_permil_20180609.nc - abs - + add desc @@ -3745,17 +3720,16 @@ .false. - + add desc - + char bgcnml bgcnml UNSET - abs File name (incl. full path) for surface PI pH input data. @@ -3768,17 +3742,16 @@ .false. - + add desc - + char bgcnml bgcnml UNSET - abs File name (incl. full path) for sediment porosity @@ -3799,14 +3772,13 @@ Name of alkalinization scenario ('const', 'ramp', or 'file') - + char bgcoafx bgcoafx UNSET - abs Full path of the input file for the alkalinization scenario 'file' @@ -3873,7 +3845,7 @@ 'hbgcd','hbgcm','hbgcy' - + add desc @@ -3883,7 +3855,7 @@ 1,30,365 - + add desc @@ -3895,7 +3867,7 @@ 1,30,365 0,0,0 - + add desc @@ -3905,7 +3877,7 @@ 0,0,0 - + add desc @@ -3916,7 +3888,7 @@ 0,0,0 1,1,1 - + add desc @@ -3926,7 +3898,7 @@ 0,1,0 - + add desc @@ -3998,7 +3970,7 @@ 4,2,2 0,0,0 - + add desc @@ -4454,7 +4426,7 @@ 4,2,2 0,0,0 - + add desc @@ -4466,7 +4438,7 @@ 4,2,2 0,0,0 - + add desc @@ -4478,7 +4450,7 @@ 4,2,2 0,0,0 - + add desc @@ -4490,7 +4462,7 @@ 4,2,2 0,0,0 - + add desc @@ -4562,7 +4534,7 @@ 4,2,2 0,0,0 - + add desc @@ -4574,7 +4546,7 @@ 4,2,2 0,0,0 - + add desc @@ -4586,7 +4558,7 @@ 4,2,2 0,0,0 - + add desc @@ -4598,7 +4570,7 @@ 4,2,2 0,0,0 - + add desc @@ -4610,7 +4582,7 @@ 4,2,2 0,0,0 - + add desc @@ -4622,7 +4594,7 @@ 4,2,2 0,0,0 - + add desc @@ -4634,7 +4606,7 @@ 4,2,2 0,0,0 - + add desc @@ -4646,7 +4618,7 @@ 4,2,2 0,0,0 - + add desc @@ -4658,7 +4630,7 @@ 4,2,2 0,0,0 - + add desc @@ -4670,7 +4642,7 @@ 4,2,2 0,0,0 - + add desc @@ -4682,7 +4654,7 @@ 4,2,2 0,0,0 - + add desc @@ -4694,7 +4666,7 @@ 4,2,2 0,0,0 - + add desc @@ -4706,7 +4678,7 @@ 4,2,2 0,0,0 - + add desc @@ -4718,7 +4690,7 @@ 4,2,2 0,0,0 - + add desc @@ -4730,7 +4702,7 @@ 4,2,2 0,0,0 - + add desc @@ -4742,7 +4714,7 @@ 4,2,2 0,0,0 - + add desc @@ -4754,7 +4726,7 @@ 4,2,2 0,0,0 - + add desc @@ -4766,7 +4738,7 @@ 4,2,2 0,0,0 - + add desc @@ -4778,7 +4750,7 @@ 4,2,2 0,0,0 - + add desc @@ -4790,7 +4762,7 @@ 4,2,2 0,0,0 - + add desc @@ -4802,7 +4774,7 @@ 4,2,2 0,0,0 - + add desc @@ -4814,7 +4786,7 @@ 4,2,2 0,0,0 - + add desc @@ -4862,7 +4834,7 @@ 2,0,2 0,0,0 - + add desc @@ -4874,7 +4846,7 @@ 2,0,2 0,0,0 - + add desc @@ -4886,7 +4858,7 @@ 2,0,2 0,0,0 - + add desc @@ -4898,7 +4870,7 @@ 2,0,2 0,0,0 - + add desc @@ -4910,7 +4882,7 @@ 2,0,2 0,0,0 - + add desc @@ -4970,7 +4942,7 @@ 2,0,2 0,0,0 - + add desc @@ -5030,7 +5002,7 @@ 2,0,2 0,0,0 - + add desc @@ -5376,7 +5348,7 @@ 0,0,2 - + add desc @@ -5388,7 +5360,7 @@ 0,2,2 0,0,0 - + add desc @@ -5592,7 +5564,7 @@ 4,2,2 0,0,0 - + add desc @@ -5974,7 +5946,7 @@ 4,2,2 0,0,0 - + add desc @@ -5986,7 +5958,7 @@ 2,0,2 0,0,0 - + add desc @@ -5998,7 +5970,7 @@ 2,0,2 0,0,0 - + add desc @@ -6010,7 +5982,7 @@ 2,0,2 0,0,0 - + add desc @@ -6241,4 +6213,4 @@ (ssster) [mol m-3] - + diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py new file mode 100644 index 00000000..4ca2bcc1 --- /dev/null +++ b/cime_config/ocn_in_paramgen.py @@ -0,0 +1,1658 @@ +""" +Wrapper-class for the ParamGen +CIME tool, and associated methods +needed to generated the "ocn_in" +Fortran namelist file. + +To run doctests on this file: python -m doctest ocn_in_paramgen.py +""" + +#---------------------------------------- +# Import generic python libraries/modules +#---------------------------------------- + +import os +import os.path +import sys +import re +from collections import OrderedDict + +#---------------- +# Import ParamGen +#---------------- + +_CIME_ROOT = os.environ.get("CIMEROOT") +if _CIME_ROOT is None: + raise SystemExit("ERROR: must set CIMEROOT environment variable") +sys.path.append(os.path.join(_CIME_ROOT, "CIME", "Tools")) + +_PARAMGEN_ROOT = os.path.join(_CIME_ROOT, "CIME", "ParamGen") + +if not os.path.exists(_PARAMGEN_ROOT): + _EMSG = f"ERROR: Cannot find '{_PARAMGEN_ROOT}' directory. Did you run checkout_externals?" + raise SystemExit(_EMSG) +#End if +sys.path.append(_PARAMGEN_ROOT) +#pylint: disable=wrong-import-position +from paramgen import ParamGen +#pylint: enable=wrong-import-position + +#Set of single and double quotes used by "_check_string_quotes" function: +_QUOTE_SET = {"'", '"'} + +#Regular expression used by "remove_user_nl_comment" function: +_QUOTE_REGEX = re.compile(r"\".*?\"|'.*?'") + +#Regular expression used by the "write" and "append_user_nl_file" +#methods to determine if the variable is an array, and what +#the dimensions of the array are: +_ARRAY_TYPE_REGEX = re.compile(r"[(][ ]*([0-9 ,]+)[ ]*[)]") + +#Regular expression used to determine array indices in +#"find_arr_indices" function: +_ARR_INDEX_REGEX = re.compile(r"\((.+?)\)") + +################################################################ + +class OcnInParamGenError(ValueError): + """Class used to handle ocn_in ParamGen errors + (e.g., log user errors without backtrace)""" + +################################################################ +#HELPER FUNCTIONS +################################################################ + +def _is_nml_logical_true(varname, var_val): + + """ + Checks if a "logical" XML namelist value is true or + false. + ---------- + varname -> The name of the variable being checked + var_val -> The value of the variable being checked + + Returns a boolean that matches the value of the + input logical. + + doctests: + + 1. Check that a True value returns true: + >>> _is_nml_logical_true("test", True) + True + + 2. Check that a "true" value returns true: + >>> _is_nml_logical_true("test", "true") + True + + 3. Check that a ".true." value returns true: + >>> _is_nml_logical_true("test", ".true.") + True + + 4. Check that a "1" value returns true: + >>> _is_nml_logical_true("test", "1") + True + + 5. Check that a 1 (integer) value returns true: + >>> _is_nml_logical_true("test", 1) + True + + 6. Check that a False value returns false: + >>> _is_nml_logical_true("test", False) + False + + 7. Check that a "FALSE" value returns false: + >>> _is_nml_logical_true("test", "FALSE") + False + + 8. Check that a ".False." value returns false: + >>> _is_nml_logical_true("test", ".False.") + False + + 9. Check that a "0" value returns false: + >>> _is_nml_logical_true("test", "0") + False + + 10. Check that a 0 (integer) value returns false: + >>> _is_nml_logical_true("test", 0) + False + + 11. Check that a bad string value returns the correct error: + >>> _is_nml_logical_true("test", "this_wont_work") # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError:... + XML namelist logical variable, 'test', must have a value of true, false, 1, or 0, not 'this_wont_work' + + 12. Check that a bad integer value returns the correct error: + >>> _is_nml_logical_true("test", 3) # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError:... + XML namelist logical variable, 'test', must have a value of true, false, 1, or 0, not 3 + + 13. Check that an unsupported type returns an error: + >>> _is_nml_logical_true("test", 13.03) # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError:... + XML namelist variable 'test' must have a value that is either a boolean, string, or integer, not float. + + """ + + if isinstance(var_val, bool): + return var_val + #End if + if isinstance(var_val, str): + if var_val.lower() in {"true", ".true.", "1"}: + return True + #End if + if var_val.lower() in {"false", ".false.", "0"}: + return False + #End if + + #Raise error if no match was found: + emsg = f"\nXML namelist logical variable, '{varname}'" + emsg += ", must have a value of true, false, 1, or 0, not" + emsg += f" '{var_val}'" + raise OcnInParamGenError(emsg) + #End if + + if isinstance(var_val, int): + if var_val == 1: + return True + #End if + if var_val == 0: + return False + #End if + + #Raise error if no match was found: + emsg = f"\nXML namelist logical variable, '{varname}'" + emsg += ", must have a value of true, false, 1, or 0, not" + emsg += f" {var_val}" + raise OcnInParamGenError(emsg) + #End if + + #Type is un-recognizeda, so raise an error: + emsg = f"\nXML namelist variable '{varname}' must" + emsg += " have a value that is either a boolean, string, or integer," + emsg += f" not {type(var_val).__name__}." + raise OcnInParamGenError(emsg) + +##### + +def remove_user_nl_comment(user_string, comment_delim="!"): + + """ + Searches a one-line input string for a comment delimiter, + and then returns the string with all text after the delimiter + removed. + ---------- + user_string -> String that will be searched and processed for comments + comment_delim -> Optional variable that sets the character type being used + as a comment delimiter. Defaults to the standard "!" fortran comment. + + Returns the input string, but with any commented text removed. + + doctests: + + 1. Check that a string with no comment delimiters returns full string: + >>> remove_user_nl_comment("bananas") + 'bananas' + + 2. Check that a string with no comments outside quotes returns full string: + >>> remove_user_nl_comment(" '!ban!anas!' ") + " '!ban!anas!' " + + 3. Check that a string with no quotes but a comment returns string with no comment: + >>> remove_user_nl_comment("bananas !But not apples") + 'bananas ' + + 4. Check that a string with quotes and a comment returns string sans comment: + >>> remove_user_nl_comment(" 'bananas' !But not apples") + " 'bananas' " + + 5. Check that a string with a quoted comment and real comments returns proper string: + >>> remove_user_nl_comment(" '!ba!na!nas!' !But not apples") + " '!ba!na!nas!' " + + 6. Check that a string with a quoted comment and a real comment with multiple delimiters + returns the proper string: + >>> remove_user_nl_comment(" '!bananas!' !But not! apples!") + " '!bananas!' " + + 7. Check that a string with a quoted comment and a commented quote returns the proper string: + >>> remove_user_nl_comment(' "!bananas" !"But not apples" ') + ' "!bananas" ' + + 8. Check that a string with quotes inside quotes and multiple delimiters returns + the proper string: + >>> remove_user_nl_comment(''' "!bana'!'anas""other''fruit!" !But not '!Apples!' ''') + ' "!bana\\'!\\'anas""other\\'\\'fruit!" ' + + 9. Check that an array of strings returns the proper string: + >>> remove_user_nl_comment(" 'bananas', 'apples', 'kiwis' ") + " 'bananas', 'apples', 'kiwis' " + + 10. Check that an array of strings with a comment returns the proper string: + >>> remove_user_nl_comment(" 'bananas', 'apples', 'kiwis', !, and coconuts") + " 'bananas', 'apples', 'kiwis', " + + 11. Check that an array of of strings with comment delimiters and an actual comment + returns the proper string: + >>> remove_user_nl_comment(' , "!bananas", "app!les", "kiwis!", !And "Coconuts"!') + ' , "!bananas", "app!les", "kiwis!", ' + + 12. Check that a line with no comments or strings returns the proper string: + >>> remove_user_nl_comment('5') + '5' + + 13. Check that a line with a comment but no internal strings returns the proper string: + >>> remove_user_nl_comment(' .true. !And not .false.') + ' .true. ' + + 14. Check that an array of values with no comment returns the proper string: + >>> remove_user_nl_comment('13.0d0, 15.0d0, 1100.35d0') + '13.0d0, 15.0d0, 1100.35d0' + + 15. Check that an array of values with a comment returns the proper string: + >>> remove_user_nl_comment('13.0d0,! 15.0d0, 1100.35d0') + '13.0d0,' + + 16. Check that a line that only contains a comment returns an empty string: + >>> remove_user_nl_comment('! bananas and 13.0d0 5 .true. !@$#%*?') + '' + + 17. Check that a line with an alternative comment delimiter returns the proper string: + >>> remove_user_nl_comment('bananas #and 13.0d0 5 .true. !@$#%*?', comment_delim='#') + 'bananas ' + + 18. Check that some more unusual strings are handled correctly + >>> remove_user_nl_comment("'Isn''t it a nice day'") + "'Isn''t it a nice day'" + >>> remove_user_nl_comment("'Isn''t it a nice day' !comment") + "'Isn''t it a nice day' " + >>> remove_user_nl_comment("'Isn!''!t it a nice! day'") + "'Isn!''!t it a nice! day'" + >>> remove_user_nl_comment("'Isn!''!t it a nice! day' ! comment") + "'Isn!''!t it a nice! day' " + >>> remove_user_nl_comment('''"This is 'one' string"''') + '"This is \\'one\\' string"' + >>> remove_user_nl_comment('''"This is 'one' string" !comment''') + '"This is \\'one\\' string" ' + >>> remove_user_nl_comment("'This is \\"one\\" string'") + '\\'This is "one" string\\'' + >>> remove_user_nl_comment("'This is \\"one\\" string'! comment") + '\\'This is "one" string\\'' + >>> remove_user_nl_comment("'This! is \\"!one\\"! string'! comment") + '\\'This! is "!one"! string\\'' + """ + + #Create empty set for comment-delimiting indices: + comment_delim_indices = set() + + #Search for all comment delimiters: + for char_idx, char in enumerate(user_string): + if char == comment_delim: + #Add character index to set: + comment_delim_indices.add(char_idx) + #End if + #End for + + #If no comments are present, then return string as-is: + if not comment_delim_indices: + return user_string + #End if + + #Next, check if any single or double quotes are present: + if not "'" in user_string and not '"' in user_string: + #If no quotes, then cut-off string at first delimiter: + return user_string[:sorted(comment_delim_indices)[0]] + #End if + + #Create empty set for all character indices inside quotes: + quote_text_indices = set() + + #Search for all text within quotes: + quoted_text_matches = _QUOTE_REGEX.finditer(user_string) + + #Loop over all matches: + for quote_match in quoted_text_matches: + #Extract min/max indices of match: + index_span = quote_match.span(0) + #Add all indices to set: + for index in range(index_span[0], index_span[1]): + quote_text_indices.add(index) + #End for + #End for + + #Find all comment delimiters outside of quotes: + non_quote_comment = comment_delim_indices.difference(quote_text_indices) + + if not non_quote_comment: + #All comment delimiters are within quotes, + #so return string as-is: + return user_string + #End if + + #Find first comment delimiter outside of quotes. + #Everything to the right of it is part of the comment: + return user_string[:sorted(non_quote_comment)[0]] + +##### + +def user_nl_str_to_int(string, var_name): + + """ + Checks if a string can be converted + into an integer, and if not reports + the relevant error. This function + is only used in the "get_user_nl_var_array_info" + function below. + ---------- + string -> string to convert to integer. + var_name -> name of the array variable + associated with the string. + + doctests: + + 1. Check that a string with an integer can be + converted properly: + >>> user_nl_str_to_int("5", "banana") + 5 + + 2. Check that a string with a float fails with + the correct error: + >>> user_nl_str_to_int("5.2", "banana") # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError:... + Invalid array index entry '5.2' used for variable 'banana' in 'user_nl_blom'. + + 3. Check that a string with a non-number fails with + the correct error: + >>> user_nl_str_to_int("a", "banana") # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError:... + Invalid array index entry 'a' used for variable 'banana' in 'user_nl_blom'. + + """ + + #Attempt the conversion of the string to an integer: + try: + integer_val = int(string) + except ValueError as verr: + emsg = f"\nInvalid array index entry '{string}' " + emsg += f"used for variable '{var_name}' in 'user_nl_blom'." + raise OcnInParamGenError(emsg) from verr + #End except + + #Return relevant integer value: + return integer_val + +##### + +def check_dim_index(var_name, index_val, dim_size): + + """ + Checks that the user-specified index for the given + variables is within the dimension size limit as + specified in the namelist definition file. + ---------- + var_name -> Name of the array variable + associated with the string. + index_val -> Index value provided by user + dim_size -> Maximum variable dimension size. + + doctests: + + 1. Check that an in-bounds index value + returns nothing: + >>> check_dim_index("banana", 5, 15) + + 2. Check that an index value that is + too small returns the proper error: + >>> check_dim_index("banana", 0, 15) # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError:... + Variable 'banana' has index 0 in 'user_nl_blom', which is less than one (1), the minimal index value allowed. + + 3. Check that an index value that is + too large returns the proper error: + >>> check_dim_index("banana", 20, 15) # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError:... + Variable 'banana' has index 20 in 'user_nl_blom', which is greater than the max dimension size of 15 + + """ + + #Make sure index is greater than zero: + if index_val <= 0: + emsg = f"\nVariable '{var_name}' has index {index_val}" + emsg += " in 'user_nl_blom', which is less than one (1)," + emsg += " the minimal index value allowed." + raise OcnInParamGenError(emsg) + #End if + + #Make sure index is not greater than max value: + if index_val > dim_size: + emsg = f"\nVariable '{var_name}' has index {index_val}" + emsg += " in 'user_nl_blom', which is greater than the" + emsg +=f" max dimension size of {dim_size}" + raise OcnInParamGenError(emsg) + #End if + +##### + +def parse_dim_spec(var_name, array_spec_text, dim_size): + """ + Given the text of a single array dimension specification, + return the range of values specified by the specification or + raise an Exception if an error is detected. + is the variable name and is used for error messages + is the text representation of the array spec + is the size of that rank in + + 1. Check that a single, legal index returns the correct single value + >>> parse_dim_spec('banana', '5', 10) + [5] + + 2. Check that a single, out-of-bounds index generates the proper error + >>> parse_dim_spec('banana', '15', 10) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: + Variable 'banana' has index 15 in 'user_nl_blom', which is greater than the max dimension size of 10 + >>> parse_dim_spec('banana', '0', 10) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: + Variable 'banana' has index 0 in 'user_nl_blom', which is less than one (1), the minimal index value allowed. + >>> parse_dim_spec('banana', '-2', 10) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: + Variable 'banana' has index -2 in 'user_nl_blom', which is less than one (1), the minimal index value allowed. + + 3. Check that a legal range returns the correct list of indices + >>> parse_dim_spec('banana', '5:9', 10) + [5, 6, 7, 8, 9] + >>> parse_dim_spec('banana', ':9', 10) + [1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> parse_dim_spec('banana', ':', 10) + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + >>> parse_dim_spec('banana', '6:', 10) + [6, 7, 8, 9, 10] + + 4. Check that an out-of-bounds range returns the correct list + >>> parse_dim_spec('banana', '0:2', 10) + [1, 2] + >>> parse_dim_spec('banana', '7:11', 10) + [7, 8, 9, 10] + >>> parse_dim_spec('banana', '-1:11', 10) + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + + 5. Check that an empty range returns an empty list + >>> parse_dim_spec('banana', '5:1', 10) + [] + + 6. Check that a legal range with a stride returns the correct list + >>> parse_dim_spec('banana', '5:9:2', 10) + [5, 7, 9] + >>> parse_dim_spec('banana', ':9:3', 10) + [1, 4, 7] + >>> parse_dim_spec('banana', '::3', 10) + [1, 4, 7, 10] + >>> parse_dim_spec('banana', '6:', 10) + [6, 7, 8, 9, 10] + >>> parse_dim_spec('banana', '9:1:-3', 10) + [9, 6, 3] + + 7. Check that a mismatched stride returns an empty list + >>> parse_dim_spec('banana', '9:5:2', 10) + [] + >>> parse_dim_spec('banana', '5:9:-2', 10) + [] + >>> parse_dim_spec('banana', ':9:-3', 10) + [] + >>> parse_dim_spec('banana', '::-2', 10) + [] + >>> parse_dim_spec('banana', '6::-1', 10) + [] + >>> parse_dim_spec('banana', '9:1:3', 10) + [] + + 8. Check that a missing stride value generates an error + >>> parse_dim_spec('banana', '2::', 10) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: + Two colons were provided for variable 'banana' in 'user_nl_blom', \ + but no stride value was provided. + Please provide either a stride value, or remove the extra colon. + """ + array_dims = [x.strip() for x in array_spec_text.split(':')] + if len(array_dims) > 3: + #Not sure what to do with three or more colons, so die here: + emsg = f"Variable '{var_name}' has {len(array_dims) - 1} colons (:) " + emsg += "listed in its dimension indexing in 'user_nl_blom'." + emsg += " This is not a valid Fortran array section specification." + raise OcnInParamGenError(emsg) + #End if + # Defaults + arr_beg = 1 + arr_end = dim_size + arr_stride = 1 + # Override start index? + if array_dims[0]: + arr_beg = user_nl_str_to_int(array_dims[0], var_name) + # end if + # Override end index? + if len(array_dims) > 1: + if array_dims[1].strip(): + arr_end = user_nl_str_to_int(array_dims[1], var_name) + #End if (no else, blank means use default) + else: + # We only need to check this if it is only a single index + check_dim_index(var_name, arr_beg, dim_size) + # For a single index, the end is the same as the beginning + arr_end = arr_beg + #End if + # Override stride? + if len(array_dims) > 2: + if array_dims[2]: + arr_stride = user_nl_str_to_int(array_dims[2], var_name) + if arr_stride == 0: + emsg = f"Variable '{var_name}' has a stride of zero " + emsg += "listed in its dimension indexing in 'user_nl_blom'." + emsg += " This is not a valid Fortran stride." + raise OcnInParamGenError(emsg) + #End if + else: + emsg = f"Two colons were provided for variable '{var_name}'" + emsg += " in 'user_nl_blom', but no stride value was provided." + emsg += "\nPlease provide either a stride value, or remove the " + emsg += "extra colon." + raise OcnInParamGenError(emsg) + #End if + #End if (no else, just use default stride) + # Now, create the set of entries + # We need to modify the end to make the range function compatible with + # how Fortran uses it + arr_end += int(arr_stride / abs(arr_stride)) + return [x for x in list(range(arr_beg, arr_end, arr_stride)) if + ((x >= 1) and (x <= dim_size))] + +##### + +def _check_string_quotes(var_name, var_val): + + """ + Checks if a string is inside closed quotes, + i.e. has both a starting and ending quote + of the same type. This function also + raises an error if there are quotes but + they aren't closed: + + doctests: + + 1. Check that a string with single quotes returns "True": + >>> _check_string_quotes("Apple", "'Banana'") + True + + 2. Check that a string with double quotes returns "True": + >>> _check_string_quotes("Apple", '"Banana"') + True + + 3. Check that a string without quotes returns "False": + >>> _check_string_quotes("Apple", "Banana") + False + + 4. Check that a string with mis-matching quote types raises + the appropriate error: + >>> _check_string_quotes("Apple", ''' "Banana' ''') # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: Namelist entry 'Apple' is of type character but its input value: + "Banana' + has mis-matched quotes. Please fix. + + 5. Check that a string with a missing ending quote type raises + the appropriate error: + >>> _check_string_quotes("Apple", "'Banana") # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: Namelist entry 'Apple' is of type character but its input value: + 'Banana + has mis-matched quotes. Please fix. + + 5. Check that a string with a missing starting quote type raises + the appropriate error: + >>> _check_string_quotes("Apple", 'Banana"') # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: Namelist entry 'Apple' is of type character but its input value: + Banana" + has mis-matched quotes. Please fix. + + """ + + #Make sure variable has been stripped: + var_val_strip = var_val.strip() + + #Set error message (just in case): + emsg = f"Namelist entry '{var_name}' is of type character" + emsg += " but its input value:" + emsg += f"\n{var_val}\n" + emsg += "has mis-matched quotes. Please fix." + + #Check if starting and ending quotes exist and match: + if var_val_strip[0] in _QUOTE_SET: + if var_val_strip[0] == var_val_strip[-1]: + #String is inside closed quotes: + return True + #End if + + #Starting and ending quotes don't match, + #so raise an error: + raise OcnInParamGenError(emsg) + #End if + + #Check if there are ending quotes as well: + if var_val_strip[-1] in _QUOTE_SET: + #No starting quotes, raise an error: + raise OcnInParamGenError(emsg) + #End if + + #String is not inside quotes: + return False + +##### + +def _get_nml_value_str(var_name, var_type, var_val): + + """ + Converts namelist variable inputs into their + correct Fortran namelist value format + ---------- + var_name -> Variable name (used for error message) + var_type -> Variable type to convert to (logical, integer, real, character) + var_val -> Variable value to convert + + returns the fortran namelist-formatted variable + value. + + doctests: + + 1. Check that a true logical variable outputs the correct value: + >>> _get_nml_value_str("banana", "logical", "true") + '.true.' + + 2. Check that a false logical variable outputs the correct value: + >>> _get_nml_value_str("banana", "logical", "0") + '.false.' + + 3. Check that an integer variable outputs the correct value: + >>> _get_nml_value_str("banana", "integer", 5) + '5' + + 4. Check that a real variable outputs the correct value: + >>> _get_nml_value_str("banana", "real", "5d5") + '5d5' + + 5. Check that a real variable with an integer value outputs + the correct value: + >>> _get_nml_value_str("banana", "real", 5) + '5.d0' + + 5. Check that a character variable with no quotes outputs + the correct value: + >>> _get_nml_value_str("banana", "char*10", "apple") + '"apple"' + + 6. Check that a character variable with quotes outputs + the correct value: + >>> _get_nml_value_str("banana", "char*250", " 'apple' ") + "'apple'" + + 7. Check that a character variable with double quotes + outputs the correct value: + >>> _get_nml_value_str("banana", "char*N", ' "apple" ') + '"apple"' + + 8. Check that a character variable with a quotation mark + innternal to the string outputs the correct value: + >>> _get_nml_value_str("banana", "char*31", ''' "app'le" ''') + '"app\\'le"' + + 9. Check that a variable with an unknown type returns + the proper error: + >>> _get_nml_value_str("banana", "apple", "true") # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ocn_in_paramgen.OcnInParamGenError: Namelist type 'apple' for entry 'banana' is un-recognized. + Acceptable namelist types are: logical, integer, real, or char*N. + """ + + #Create set for variable types + #that don't need special handling: + num_set = {"integer", "real"} + + #Check variable type: + if var_type == 'logical': + #If logical, then see if it is "True": + if _is_nml_logical_true(var_name, var_val): + return ".true." + #End if + #If not true, then must be false: + return ".false." + #End if + + if var_type in num_set: + #Check if the variable value is an integer, but is being + #used for a real-type variable: + if var_type == "real" and isinstance(var_val, int): + return f"{var_val}.d0" + #End if + + #Otherwise, simply write value as-is: + return f"{var_val}" + #End if + + if "char" in var_type: + #Remove extra white space: + var_val_strip = var_val.strip() + if '"' in var_val_strip: + var_val_strip = var_val_strip.replace('"','') + var_val_strip = "'" + var_val_strip + "'" + + #Check if string is wrapped in quotes: + quoted_flag = _check_string_quotes(var_name, var_val_strip) + + #If not, then pass string with quotes: + if not quoted_flag: + return f'\'{var_val_strip}\'' + #End if + + #If so, then pass out original string as-is: + return var_val_strip + #End if + + #If one makes it here, then this is an un-recognized type option, so raise an error: + emsg = f"Namelist type '{var_type}' for entry '{var_name}' is un-recognized.\n" + emsg += "Acceptable namelist types are: logical, integer, real, or char*N." + raise OcnInParamGenError(emsg) + +################################################################ +# MAIN "ocn_in" ParamGen class +################################################################ + +class OcnInParamGen(ParamGen): + """ + Encapsulates data and read/write methods for + the ocn_in Fortran namelist file and ParamGen + object. + """ + + def __init__(self, pg_data_dict): + + """ + Initialize a ParamGen object directly + using a ParamGen data dictionary, and + create a new dictionary to match namelist + variables to their associated groups + when reading in "user_nl_blom". + ---------- + pg_data_dict -> python dictionary with ParamGen keys/values + + """ + + #Initialize ParamGen directly: + super().__init__(pg_data_dict) + + #Create a namelist var/group dictionary, + #which is used by the "append_user_nl_file" + #method: + self.__var_group_dict = {} + + #Create empty dictionaries that will contain + #the namelist definition files and the set + #of all namelist groups and variables: + self.__nml_def_groups = {} + self.__nml_def_vars = {} + + #Set variables needed for ParamGen "reduction": + self.__case = None + self.__ocn_attr_dict = None + + #Initialize data structure for duplicate array + #checking in user_nl_blom files. This structure + #is organized like so: + # dict(var_name : list of sets) + # list size = number of array dimensions specified + # set contains the array indices specified for that + # dimension: + self.__set_index_vals = {} + + #### + + @classmethod + def from_namelist_xml(cls, nml_xml_file): + + """ + Initialize ocn_in ParamGen object with XML file, + ---------- + nml_xml_file -> path (str) to namelist definition XML file + + """ + + #Create ParamGen object using base class: + pg_xml = ParamGen.from_xml_nml(nml_xml_file, no_duplicates=True) + + #Initialize new "ocn_in" object: + ocn_in_pg = OcnInParamGen(pg_xml.data) + + #Check if the new ParamGen object has all of the required + #namelist elements: + #---------------- + missing_elems = ocn_in_pg.check_nml_def_elems() + + if missing_elems: + emsg = "The XML namelist definition file:\n" + emsg += f"{nml_xml_file}\n" + emsg += "has namelist entries that are missing required elements.\n" + emsg += "Those entries and missing elements are:\n" + for entry_id, missing_elems in missing_elems.items(): + emsg += f"{entry_id} : {', '.join(missing_elems)}\n" + #End for + raise OcnInParamGenError(emsg) + #End if + #---------------- + + #Initialize file->group/var set dictionary: + ocn_in_pg.__nml_def_groups[nml_xml_file] = set() + ocn_in_pg.__nml_def_vars[nml_xml_file] = set() + + #Create namelist variable/group dictionary + #and associated sets: + #---------------- + for nml_group in ocn_in_pg._data: + for var in ocn_in_pg._data[nml_group]: + + #Check if variable already exists in dictionary: + if var in ocn_in_pg.__var_group_dict: + #No duplicate variables are allowed, even if + #in separate namelist groups, so raise an error. + #Please note that this error should always be + #caught earlier than this, so if it gets to this + #point something has gone seriously wrong: + emsg = f"Namelist entry id '{var}' exists" + emsg += f" in namelist group '{nml_group}'" + emsg += f" and '{ocn_in_pg.__var_group_dict[var]}'\n" + emsg += "Namelist variables can belong to only one group." + raise SystemError(emsg) + #End if + + #If not, then add variable and group to dictionary: + ocn_in_pg.__var_group_dict[var] = nml_group + + #Add namelist groups and variables to their + #respective sets: + ocn_in_pg.__nml_def_groups[nml_xml_file].add(nml_group) + ocn_in_pg.__nml_def_vars[nml_xml_file].add(var) + #End for + #End for + #---------------- + + #Return object: + return ocn_in_pg + + #### + + def check_nml_def_elems(self): + + """ + Function that checks if certain namelist definition + file elements/tags that are optional for ParamGen + but required are present + """ + + #Please note that "group" and "values" are automatically + #required by the ParamGen schema. + + #Required namelist elements: + req_elems = ["type", "desc", "category"] + + #Set missing attributes dictionary: + missing_elems = {} + + #Assume it is a ParamGen object, and loop over namelist groups: + for nml_group in self._data: + #Now loop over variables in group: + for var in self._data[nml_group]: + #Lastly loop over required namelist elements: + for req_elem in req_elems: + #Check if required element is present: + if not req_elem in self._data[nml_group][var]: + #Add missing attribute to dictionary: + if var in missing_elems: + missing_elems[var].append(req_elem) + else: + missing_elems[var] = [req_elem] + #End if + #End if + #End for + #End for + #End for + + #Return missing elements dictionary: + return missing_elems + + #### + + def append_ocn_in_pg(self, ocn_pg_obj): + + """ + Append a new OcnInParamGen object + to this one, ensuring that there are + no duplicate namelist groups or variables. + ---------- + ocn_pg_obj -> An OcnInParamGen object + + """ + #Loop over all XML files associated with input ocn_pg object: + for input_file in ocn_pg_obj.__nml_def_groups: + + #Extract the group and variable sets from input PG object: + input_groups = ocn_pg_obj.__nml_def_groups[input_file] + input_vars = ocn_pg_obj.__nml_def_vars[input_file] + + #Check that there are no matching namelist groups: + #------------------------------------------------ + + #Initialize error message string: + emsg = "" + + #Loop over all namelist files and namelist group sets: + for nml_file, nml_groups in self.__nml_def_groups.items(): + + #Determine if any namelist groups are the same + #between the two objects: + same_groups = nml_groups.intersection(input_groups) + + #If so, then add to error message (as all namelist groups must be unique): + if same_groups: + emsg += f"Cannot append:\n'{input_file}'\n" + emsg += " The following namelist groups conflict with those in" + emsg += f"\n'{nml_file} :'\n" + emsg += ", ".join(same_groups) + #End if + #End for + + #------------------------------------------------ + #Check that there are no matching namelist variables: + #------------------------------------------------ + for nml_file, nml_vars in self.__nml_def_vars.items(): + + #Determine if any namelist groups are the same + #between the two objects: + same_vars = nml_vars.intersection(input_vars) + + #If so, then add to error message (as all namelist variable ids must be unique): + if same_vars: + emsg += f"Cannot append:\n'{input_file}'\n" + emsg += " The following namelist variablesconflict with those in" + emsg += f"\n'{nml_file} :'\n" + emsg += ", ".join(same_vars) + #End if + #End for + #------------------------------------------------ + + #End for (input files used to create input ocn_pb object) + + #Check if an error message was written. If so then raise the + #error(s) here: + if emsg: + raise OcnInParamGenError(emsg) + #Endd if + + #Add input PG object dictionaries to this object's dicts: + self.__nml_def_groups.update(ocn_pg_obj.__nml_def_groups) + self.__nml_def_vars.update(ocn_pg_obj.__nml_def_vars) + + #Also combine PG object var-group dictionary needed for + #appending "user_nl_cam": + self.__var_group_dict.update(ocn_pg_obj.__var_group_dict) + + #Append input PG object to this object: + self.append(ocn_pg_obj) + + #### + + def get_user_nl_var_array_info(self, var_str): + + """ + Checks whether the variable string + is for a specific set of array + indices. + ---------- + var_str -> variable name string. + + outputs: + ---------- + is_array -> Logical for whether variable + is an array. + var_name -> Name of variable + (with array indices stripped). + arr_indxs -> List of lists, with one list + for each array dimension. Each + dimension list contains all duplicated + indices for that dimension. + data_group -> Namelist group for that particular + variable. + + """ + + #Initialize variable name + var_name = var_str + + #Initialize array index list: + arr_indxs = [] + + #Check for array syntax, i.e. parentheses: + array_syntax_match = _ARR_INDEX_REGEX.search(var_str) + + #Extract variable name: + if array_syntax_match: + var_name = var_str[:array_syntax_match.start(0)] + else: + var_name = var_str + #End if + + #Check that variable actually exists in ParamGen object: + + if var_name in self.__var_group_dict: + #Extract namelist group list for variable: + data_group = self.__var_group_dict[var_name] + + else: + #Raise error that namelist variable isn't listed in + #anywhere in a definition file: + emsg = f"Variable '{var_name}' not found in any namelist definition files." + emsg += " Please double-check 'user_nl_cam'." + raise OcnInParamGenError(emsg) + #End if + + #Extract variable type from ParamGen Object: + var_type = self._data[data_group][var_name]["type"] + + #Search for array dimension specifications in type: + array_type_dims = _ARRAY_TYPE_REGEX.search(var_type) + + #Determine if variable is actually an array or not: + is_array = bool(array_type_dims) + + #Exit function here if no array indices were used in user_nl_cam file: + if not array_syntax_match: + + #No parantheses used, so no indices need to be checked: + return is_array, var_name, arr_indxs, data_group + #End if + + #If variable is not an array, but array indices are being + #used in user_nl_cam, then throw an error: + if not is_array: + emsg = f"Variable '{var_name}' is not an array, but array" + emsg += " dimensions are being specified in 'user_nl_cam'." + raise OcnInParamGenError(emsg) + #End if + + #Extract array dimension information from variable type + #as listed in the associated namelist definition file: + #---------------------------------------------------- + + #Pull out dimensions string: + array_dim_text = array_type_dims.group(1) + + #Split text by number of commas (which should indicate dimensions): + array_dims_list = array_dim_text.split(",") + + #Extract total number of dimensions: + num_arr_dims = len(array_dims_list) + + #Create new list of max dim size: + max_dim_sizes = [] + for dim_size in array_dims_list: + max_dim_sizes.append(user_nl_str_to_int(dim_size, var_name)) + #End for + + #---------------------------------------------------- + + #Now extract all text inside variable quotes: + user_array_text = array_syntax_match.group(1) + + #Split text by number of commas (which should indicate dimensions): + user_dim_text = user_array_text.split(",") + + #Check that the user hasn't listed the wrong number of dimensions: + num_user_dims = len(user_dim_text) + if num_user_dims != num_arr_dims: + #Set proper grammar: + if num_user_dims == 1: + user_dim_str = "dimension" + else: + user_dim_str = "dimensions" + #End if + if num_arr_dims == 1: + array_dim_str = "dimension." + else: + array_dim_str = "dimensions." + #End if + + #Raise error with proper message: + emsg = f"Variable '{var_name}' has {num_user_dims}" + emsg += f" {user_dim_str} used in 'user_nl_cam', but is defined" + emsg += f" to have {num_arr_dims} {array_dim_str}" + raise OcnInParamGenError(emsg) + #End if + + #Loop over dimensions: + for dim_idx, array_index_text in enumerate(user_dim_text): + #Create new array list entry: + if array_index_text.strip() == ':': + #Only a single colon provided. In this case provide a special index + #that indicates that specific indices can still be provided, but that the + #whole array dimension cannot be written again: + arr_indxs.append([-1]) + else: + indices = parse_dim_spec(var_name, array_index_text, + max_dim_sizes[dim_idx]) + if not indices: + ## Log a warning here if no values were returned? + pass + #End if + arr_indxs.append(indices) + #End if + #End for (dimensions) + + #Return relevant variables: + return is_array, var_name, arr_indxs, data_group + + #### + + def check_array_indices(self, var_name, arr_index_list): + + """ + Checks whether the list of array indices has already + been set for the given variable, and if so, raises + an error. + ---------- + var_name -> Name of array variable being modified. + + arr_index_list -> A list of lists of array indices + with the first list representing + the dimensions, and the second list + containing the array indices being + set for that dimension. + + """ + + #Initialize duplicated index flag, + #We won't know the answer one way or the other + #until either the end of the loop below, or + #until certain conditions are met, so for now + #initialize as "None": + is_arr_dupl = None + + #Initialize "possible" array duplication flag: + possible_dupl = False + + #Check if variable name exists in dictionary: + if not var_name in self.__set_index_vals: + #Create a new entry with an empty list, + #it should then be filled out in the loop below: + self.__set_index_vals[var_name] = [] + + #Also set duplication to "False": + is_arr_dupl = False + #End if + + #Initialize dimension index for use in error-handling at + #end of function: + dim_indx = 0 + + #Loop over each separate dimension list: + for dim_indx, dim_arr_indxs in enumerate(arr_index_list): + + #Initialize duplicated index list (for last dimension checked): + dup_indx_list = [] + + #Check if dimension index exists for variable dictionary: + if dim_indx == len(self.__set_index_vals[var_name]): + #Create a new set of array indices for the new dimensions: + self.__set_index_vals[var_name].append(set(dim_arr_indxs)) + + #Since a new dimension is being specified, this is not a duplicate: + is_arr_dupl = False + else: + #Loop over all array indices: + for arr_indx in dim_arr_indxs: + #Check if array index has already been explicitly called: + if arr_indx in self.__set_index_vals[var_name][dim_indx]: + #Add array index to list of duplicated values: + dup_indx_list.append(arr_indx) + + #This line is possibly a duplication, + #but will need to finish the loop to be sure: + possible_dupl = True + #End if + + #Add index to "set index" set for variable: + self.__set_index_vals[var_name][dim_indx].add(arr_indx) + #End for (array indices) + + #If there were no duplicates at this dimension, then this entry + #is not a duplicate: + if not possible_dupl: + is_arr_dupl = False + #End if + + #End if (new dimension) + #End for (dimensions) + + #If the duplication flag hasn't been set yet, then set it now: + if is_arr_dupl is None: + is_arr_dupl = possible_dupl + #End if + + #Now raise an error if there is array duplication: + if is_arr_dupl: + if any(dup == -1 for dup in dup_indx_list): + #This is a special case where a non-bounded + #colon (:) was repeated twice, so write + #the error message accordingly: + emsg = f"Variable '{var_name}' has all values" + emsg += " being set multiple times for" + emsg += f" dimension {dim_indx+1}." + else: + emsg = f"Variable '{var_name}' has values" + emsg += " at the following indices being" + emsg += " set multiple times for dimension" + emsg += f" ({dim_indx+1}) :\n" + emsg += ", ".join(str(dup) for dup in dup_indx_list) + #End if + raise OcnInParamGenError(emsg) + #End if + + #### + + def append_user_nl_file(self, user_nl_file): + """ + Reads in user_nl_cam files and converts + them to the proper ParamGen syntax. + ---------- + user_nl_file -> Path (str) to user_nl_cam file. + + """ + + #Create ordered dictionary to store namelist groups, + #variables, and values from user_nl_cam file: + _data = OrderedDict() + + #Initialize flag preventing duplicate namelist entries: + no_duplicates = True + + #Initialize flag to mark whether a variable is an array: + is_array = False + + #Initialize flag to mark whether the line is an array continuation line: + is_continue_line = False + + #Open user_nl_cam file: + with open(user_nl_file,'r', encoding='utf-8') as user_file: + for line_num, line in enumerate(user_file): + if len(line)>1: + #Split line into a list of words/characters: + line_s = line.split() + + #If line is empty then go to next line: + if not line_s: + continue + #End if + + #Check if a comment delimiter is somewhere in the string: + if '!' in line: + #Check if the entire line is a comment: + if line_s[0][0] == "!": + #Check if this comment is the duplicate keyword: + if "allow_duplicate_namelist_entries" in line_s: + #Next check if a user has set variable to True: + for word in line_s: + if word.lower() == "true": + #Allow duplicate namelist entries: + no_duplicates = False + break + #End if + #End for + #End if + #Continue to next line in file: + continue + #End if + #Otherwise simply remove any part of the line that is commented out: + line = remove_user_nl_comment(line) + #End if + + #Check if the first character on the line is a comma (,): + if line.strip()[0] == ",": + #Is this an array variable: + if is_array: + #Was a continuation line already provided: + if is_continue_line: + #Two commas were used in a row with a newline + #in-between. Technically this is allowed, + #but in practice it is VERY likely a mistake, + #so raise an error here: + emsg = f"Line number {line_num+1} in 'user_nl_cam'" + emsg += " starts with a comma (,) but the" + emsg += " previous line ended with a comma." + emsg += "\nPlease remove one of the commas." + raise OcnInParamGenError(emsg) + #End if + + #If not, then set it to be a continuation line: + is_continue_line = True + else: + #The previous variable is not an array, so throw an error: + emsg = f"Line number {line_num+1} in 'user_nl_cam'" + emsg += " starts with a comma (,) but the" + emsg += " associated namelist variable is not an array." + raise OcnInParamGenError(emsg) + #End if + #End if + + #Now parse the line: + if "=" in line and (line.strip()[0] != "=") and not (is_array and is_continue_line): + line_ss = line.split("=") # Split line into before/after equals sign + var_str = (line_ss[0]).strip() # the first element is the variable name + var_str = var_str.lower() + + #Check if this variable is an array, and if so, + #then return what the variable name is, what indices (if any) + #are being specified, and what namelist (data) group it belongs to: + is_array, var_name, arr_indxs, data_group = \ + self.get_user_nl_var_array_info(var_str) + + #Are there array indices specified: + if arr_indxs: + + if no_duplicates: + #Check if any duplicate array indices are present: + self.check_array_indices(var_name, arr_indxs) + #End if + + #ParamGen will think this is a "new" parameter variable, so we need + #to add a type in order for the "write" method to work properly. The + #type can be copied directly from the original variable using "var_name": + var_type = self._data[data_group][var_name]["type"] + else: + #Variable doesn't need a type specified: + var_type = None + #End if (array indices) + + #Extract value string: + val_str = ' '.join(line_ss[1:]) # the rest is the value string + + #Check if value string ends in array continuation: + if is_array: + #Check if the string ends in a comma (,): + if val_str.strip()[-1] == ",": + #If so, then make "array_continue_line" fully true: + is_continue_line = True + #End if + #End if + + #Add the namelist group if not already in data dict: + if not data_group in _data: + _data[data_group] = {} + #End if + + #Check if variable already exists in data dictionary: + if var_str in _data[data_group] and no_duplicates: + emsg = "Namelist variable '{}' set more than once in '{}'" + emsg += "\nPlease set each variable only once." + raise OcnInParamGenError(emsg.format(var_str, user_nl_file)) + #End if + + #Enter the parameter in the dictionary: + if var_type: + _data[data_group][var_str] = {'values':val_str, 'type':var_type} + else: + _data[data_group][var_str] = {'values':val_str} + #end if + elif (is_array and is_continue_line): + #See if there is an equals sign outside of quotes by treating it like + #a comment delimiter, and seeing if characters in the string are removed: + no_equals_line = remove_user_nl_comment(line, comment_delim='=') + if len(no_equals_line) != len(line): + #This looks like the start of a new namelist entry without the + #proper ending of the previous entry. So raise an error here: + emsg = f"Line number {line_num+1} in 'user_nl_cam' appears" + emsg += " to be starting a new namelist entry,\nbut" + emsg += " the previous entry has a trailing comma (,). Please fix." + raise OcnInParamGenError(emsg) + #End if + + #This is an array continuation line, so append the line to previous + #variable's value as-is: + _data[data_group][var_str]['values'] += line + + #Check if the line does NOT end in a comma (,): + if not line.strip()[-1] == ",": + #Notify loop to check the next line for a comma: + is_continue_line = False + #End if + + else: + emsg = "Cannot parse the following line in '{}' :\n'{}'" + raise OcnInParamGenError(emsg.format(user_nl_file, line)) + #End if ("=" sign check) + #End if (len(line) > 1) + #End for + #End with + + #Check if any user_nl_cam data is present: + if _data: + #If so, then create new ParamGen object: + pg_user = ParamGen(_data) + + #Append new user_nl_cam object to main ocn_in namelist object: + self.append(pg_user) + #End if + #### + + def write_nmlfile(self, output_path, groups): + + """ + Write data to Fortran namelist file. + ---------- + output_path -> path (str) to Fortran namelist (ocn_in) file + + """ + + # Make sure ParamGen object has been reduced: + if not self.reduced: + emsg = "ParamGen object for ocn_in must be reduced before being " + emsg += "written to file. Please check CAM's buildnml script." + raise OcnInParamGenError(emsg) + #End if + + #Create function to properly sort variables with array indices: + var_sort_key = lambda var : var[:var.index("(")] if "(" in var else var + + # Write Fortran namelist file: + with open(os.path.join(output_path), 'w', encoding='utf-8') as ocn_in_fil: + + #Loop through namelist groups in alphabetical order: + for nml_group in sorted(self._data): + if nml_group in groups: + # Write namelist group: + ocn_in_fil.write("&"+nml_group+"\n") + + # Write all variables within that group (sorted alphabetically): + for var in sorted(self._data[nml_group], key=var_sort_key): + + #Extract variable value(s): + val = self._data[nml_group][var]["values"].strip() + + #If no value is set then move to the next variable: + if val is None: + continue + #End if + + #Extract variable type: + if "type" in self._data[nml_group][var]: + var_type = self._data[nml_group][var]["type"].strip() + else: + emsg = f"Namelist entry '{var}' is missing required 'type' element." + raise OcnInParamGenError(emsg) + #End if + + # @ is used in a namelist to put the same namelist variable in multiple groups + # in the write phase, all characters in the namelist variable name after + # the @ and including the @ should be removed + if "@" in var: + var = re.sub("@.+$", "", var) + + #Check if an array type: + array_type = _ARRAY_TYPE_REGEX.search(var_type) + + if array_type: + #Grab all text before array regex match: + var_type = var_type[:array_type.start()].strip() + + #Split the value into its array elements, + #this assumes that a comma (,) is the element + #delimiter: + array_elems = val.split(",") + + #Write beginning of namelist entry: + nml_str = f" {var} = " + + #loop over array elements: + for elem in array_elems: + + #Get properly-formatted variable value: + nml_val = _get_nml_value_str(var, var_type, elem) + + #Add value string (with comma) to namelist string: + nml_str += (nml_val + ", ") + #End for + + #There will always be a trailing comma and space (, ) so find it: + last_comma_idx = nml_str.rfind(", ") + + #Write final string to file: + ocn_in_fil.write(nml_str[:last_comma_idx]+"\n") + + else: #Not an array + + #Get properly-formatted variable value: + nml_val = _get_nml_value_str(var, var_type, val) + + #Write variable to namelist file: + ocn_in_fil.write(f' {var} = {nml_val}\n') + + #End if (array type) + #End for (namelist variables) + # Add space for next namelist group: + ocn_in_fil.write('/\n\n') + #End for (namelist groups) + #End with (open ocn_in file) + + #### + + def write_inputdata(self, output_path, groups): + + """ + Write data to Fortran namelist file. + ---------- + output_path -> path (str) to blom input data list file + + """ + + # Make sure ParamGen object has been reduced: + if not self.reduced: + emsg = "ParamGen object for ocn_in must be reduced before being " + emsg += "written to file. Please check BLOM's buildnml script." + raise OcnInParamGenError(emsg) + #End if + + #Create function to properly sort variables with array indices: + var_sort_key = lambda var : var[:var.index("(")] if "(" in var else var + + # Write Fortran namelist file: + with open(os.path.join(output_path), 'w', encoding='utf-8') as ocn_in_fil: + + #Loop through namelist groups in alphabetical order: + for nml_group in sorted(self._data): + if nml_group in groups: + + # Write all variables within that group (sorted alphabetically): + for var in sorted(self._data[nml_group], key=var_sort_key): + + if self._data[nml_group][var]["is_inputdata"] == 'yes': + val = self._data[nml_group][var]["values"].strip() + val = val.replace('"','') + if 'unset' not in val and 'UNSET' not in val: + ocn_in_fil.write(f"{var} = {val} \n") + + + def reduce_ocn_in(self, case, ocn_attr_dict): + + """ + Reduce XML namelist attributes + (i.e. replace attribute/guard dictionary with value) + ---------- + case -> CIME case object + ocn_attr_dict -> dictionary containing attribute values + + """ + + # Set internal variables for use by "expand_func": + self.__case = case + self.__ocn_attr_dict = ocn_attr_dict + + # Reduce Param Data: + self.reduce(self.__expand_func) + + #### + + def __expand_func(self, varname): + + """ + Function used to convert $XXX + variables and XML attributes to + their associated values. + """ + + #Check if varname matches a CIME case variable: + val = self.__case.get_value(varname) + + #If not, then attempt to extract variable from + #attribute dictionary: + if val is None: + if varname in self.__ocn_attr_dict: + val = self.__ocn_attr_dict[varname] + else: + #Assume the XML attribute/guard is an empty string: + val = "" + #End if + #End if + + #Return value if found: + return val + +############ +#End of file From f97a65da52e3722ee85bd9fffd82b3242d465bc0 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 6 Aug 2023 20:23:00 +0200 Subject: [PATCH 17/33] more updates --- cime_config/buildnml | 129 +++++++++++++---------- cime_config/namelist_definition_blom.xml | 12 +-- cime_config/ocn_in_paramgen.py | 81 ++++++++++---- 3 files changed, 142 insertions(+), 80 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 9b5b26f7..f89f1b16 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -46,24 +46,41 @@ def buildnml(case, caseroot, compname): emsg = "BLOM buildnml called with model={}" raise AttributeError(emsg.format(compname)) # End if - srcroot = case.get_value("SRCROOT") - rundir = case.get_value("RUNDIR") - ninst_ocn = case.get_value("NINST_OCN") - run_type = case.get_value("RUN_TYPE") - run_startdate = case.get_value("RUN_STARTDATE") - run_refcase = case.get_value("RUN_REFCASE") - run_refdate = case.get_value("RUN_REFDATE") - run_reftod = case.get_value("RUN_REFTOD") - - testsrc = os.path.join(srcroot, "components", "blom") - if os.path.exists(testsrc): - srcroot = testsrc + + srcroot = case.get_value("SRCROOT") + din_loc_root = case.get_value("DIN_LOC_ROOT") + caseroot = case.get_value("CASEROOT") + rundir = case.get_value("RUNDIR") + continue_run = case.get_value("CONTINUE_RUN") + ninst_ocn = case.get_value("NINST_OCN") + run_type = case.get_value("RUN_TYPE") + run_startdate = case.get_value("RUN_STARTDATE") + run_refcase = case.get_value("RUN_REFCASE") + run_refdate = case.get_value("RUN_REFDATE") + run_reftod = case.get_value("RUN_REFTOD") + ocn_grid = case.get_value("OCN_GRID") + ocn_ncpl = case.get_value("OCN_NCPL") + pio_typename_ocn = case.get_value("PIO_TYPENAME_OCN") + pio_netcdf_format_ocn = case.get_value("PIO_NETCDF_FORMAT_OCN") + blom_unit = case.get_value("BLOM_UNIT") + blom_vcoord = case.get_value("BLOM_VCOORD") + blom_river_nutrients = case.get_value("BLOM_RIVER_NUTRIENTS") + blom_n_deposition = case.get_value("BLOM_N_DEPOSITION") + blom_ndep_scenario = case.get_value("BLOM_NDEP_SCENARIO") + blom_coupling = case.get_value("BLOM_COUPLING") + blom_tracer_modules = case.get_value("BLOM_TRACER_MODULES") + hamocc_ciso = case.get_value("HAMOCC_CISO") + hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP") + hamocc_sedspinup_yr_start = case.get_value("HAMOCC_SEDSPINUP_YR_START") + hamocc_sedspinup_yr_end = case.get_value("HAMOCC_SEDSPINUP_YR_END") + hamocc_sedspinup_ncycle = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") + is_test = case.get_value("TEST") #-------------------------- # Construct ParamGen objects: #-------------------------- - xml_fil = os.path.join(srcroot,"cime_config","namelist_definition_blom.xml") + xml_fil = os.path.join(srcroot,"components","blom","cime_config","namelist_definition_blom.xml") pg_blom = OcnInParamGen.from_namelist_xml(xml_fil) #------------------------ @@ -135,49 +152,13 @@ def buildnml(case, caseroot, compname): # Create config dictionary #------------------------------------------------- - rundir = case.get_value("RUNDIR") - srcroot = case.get_value("SRCROOT") - din_loc_root = case.get_value("DIN_LOC_ROOT") - caseroot = case.get_value("CASEROOT") - continue_run = case.get_value("CONTINUE_RUN") - ocn_grid = case.get_value("OCN_GRID") - ocn_ncpl = case.get_value("OCN_NCPL") - blom_unit = case.get_value("BLOM_UNIT") - blom_vcoord = case.get_value("BLOM_VCOORD") - pio_typename_ocn = case.get_value("PIO_TYPENAME_OCN") - pio_netcdf_format_ocn = case.get_value("PIO_NETCDF_FORMAT_OCN") - is_test = case.get_value("TEST") - blom_river_nutrients = case.get_value("BLOM_RIVER_NUTRIENTS") - blom_n_deposition = case.get_value("BLOM_N_DEPOSITION") - blom_ndep_scenario = case.get_value("BLOM_NDEP_SCENARIO") - blom_coupling = case.get_value("BLOM_COUPLING") - blom_tracer_modules = case.get_value("BLOM_TRACER_MODULES") - hamocc_vsls = case.get_value("HAMOCC_VSLS") - hamocc_ciso = case.get_value("HAMOCC_CISO") - hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP") - hamocc_sedspinup_yr_start = case.get_value("HAMOCC_SEDSPINUP_YR_START") - hamocc_sedspinup_yr_end = case.get_value("HAMOCC_SEDSPINUP_YR_END") - hamocc_sedspinup_ncycle = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") - - # error checks - if hamocc_vsls and ocn_grid != "tnx1v4": - expect(False, - "HAMOCC_VSLS is not supported at this grid resolution (no swa-climatology available)") - # create config dictionary - used in namelist_definition_blom.xml config = {} - config['ocn_grid'] = ocn_grid config['ocn_ncpl'] = str(ocn_ncpl) config['pio_typename_ocn'] = pio_typename_ocn config['pio_netcdf_format_ocn'] = pio_netcdf_format_ocn config["continue_run"] = "yes" if continue_run else "no" - config["is_test"] = "yes" if is_test else "no" - if is_test: - testcase = case.get_value("TESTCASE") - config["is_test_pfs"] = "yes" if testcase == "PFS" else "no" - config["empty_hist"] = "yes" if testcase == "PFS" else "no" - config['blom_unit'] = blom_unit if blom_unit else "unset" config['blom_vcoord'] = blom_vcoord config["blom_river_nutrients"] = "yes" if blom_river_nutrients else "no" @@ -185,13 +166,16 @@ def buildnml(case, caseroot, compname): config["blom_n_deposition"] = "yes" if blom_n_deposition else "no" config["blom_coupling"] = blom_coupling config["blom_tracer_modules"] = blom_tracer_modules - - config["hamocc_vsls"] = "yes" if hamocc_vsls else "no" - config["hamocc_ciso"] = "yes" if hamocc_ciso else "no" + config["hamocc_ciso"] = "yes" if hamocc_ciso else "no" config["hamocc_sedspinup"] = "yes" if hamocc_sedspinup else "no" config["hamocc_sedspinup_yr_start"] = hamocc_sedspinup_yr_start config["hamocc_sedspinup_yr_end"] = hamocc_sedspinup_yr_end config["hamocc_sedspinup_ncycle"] = hamocc_sedspinup_ncycle + config["is_test"] = "yes" if is_test else "no" + if is_test: + testcase = case.get_value("TESTCASE") + config["is_test_pfs"] = "yes" if testcase == "PFS" else "no" + config["empty_hist"] = "yes" if testcase == "PFS" else "no" #--------------------------------- # Set all ParamGen namelist values: @@ -199,6 +183,24 @@ def buildnml(case, caseroot, compname): pg_blom.reduce_ocn_in(case, config) + #---------------------------------------------------- + # Reset values of some variables + #---------------------------------------------------- + + run_startdate = case.get_value("RUN_STARTDATE") + idate = run_startdate.replace('-','') + pg_blom.set_value("idate", idate) + pg_blom.set_value("idate0", idate) + + if pg_blom.get_value('swaclimfile') == 'UNSET': + pg_blom.set_value('swaclimfile', value='') + + if pg_blom.get_value('inid13c') == 'UNSET': + pg_blom.set_value('inid13c', value='') + + if pg_blom.get_value('inid14c') == 'UNSET': + pg_blom.set_value('inid14c', value='') + #--------------------------- # Write out Fortran namelist: #--------------------------- @@ -212,6 +214,8 @@ def buildnml(case, caseroot, compname): # Create BLOM namelist groups=['limits','diffusion','merdia','secdia','diaphy'] + groups.append('cwmod') + if case.get_value("BLOM_VCOORD") == "cntiso_hybrid": groups.append('vcoord') @@ -230,13 +234,32 @@ def buildnml(case, caseroot, compname): filename.write_text(filename.read_text().replace('mer_regflg3','mer_regflg(3,:)')) filename.write_text(filename.read_text().replace('mer_regflg4','mer_regflg(4,:)')) - # Write out blom.input_data_list data_list_path = os.path.join(case.get_case_root(), "Buildconf", "blom.input_data_list") if os.path.exists(data_list_path): os.remove(data_list_path) pg_blom.write_inputdata(data_list_path, groups) + # To compare with previous namelist generation, make namelist variable uppercase and + # use single quotes instead of back quotes and make sure that file variables set to UNSET + # get changed to blank quotes + namelist_file_temp = os.path.join(confdir, "ocn_in_temp") + with open(namelist_file, "r") as fread: + with open(namelist_file_temp, "w") as fwrite: + for line_read in fread: + # replace single quote with double quote to generate same namelist as using + # csh buildnml + line = line_read.replace('"',"'") + # make all namelists upper case to generate same namelist as using csh buildnml + tokens = line.split('=',maxsplit=1) + if len(tokens) == 2: + # Change UNSET values for files to lower case + if 'UNSET' in tokens[1]: + tokens[1] = "'unset'" + fwrite.write(f" {tokens[0].upper().strip()} = {tokens[1].strip()}\n") + else: + fwrite.write(line) + shutil.move(namelist_file_temp, namelist_file) ############################################################################### def _main_func(): diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 15dc964a..0f088bb6 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -90,7 +90,7 @@ Experiment configuration (a) - + char limits limits @@ -772,7 +772,7 @@ - + char vcoord vcoord @@ -1216,7 +1216,7 @@ cwmod cwmod - unset + '','' 'Gibraltar','Gibraltar' 'Gibraltar','Gibraltar' @@ -3485,7 +3485,7 @@ - + real bgcnml bgcnml @@ -3599,7 +3599,7 @@ Logical switch to activate sediment spin-upLogical switch to activate sediment spin-up - + integer bgcnml bgcnml @@ -3610,7 +3610,7 @@ Start year for sediment spinup - + integer bgcnml bgcnml diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index 4ca2bcc1..e6b0e913 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -915,7 +915,7 @@ def check_nml_def_elems(self): """ Function that checks if certain namelist definition - file elements/tags that are optional for ParamGen + file elements/tags that are optional for ParamGen but required are present """ @@ -1023,7 +1023,7 @@ def append_ocn_in_pg(self, ocn_pg_obj): self.__nml_def_vars.update(ocn_pg_obj.__nml_def_vars) #Also combine PG object var-group dictionary needed for - #appending "user_nl_cam": + #appending "user_nl_blom": self.__var_group_dict.update(ocn_pg_obj.__var_group_dict) #Append input PG object to this object: @@ -1072,7 +1072,7 @@ def get_user_nl_var_array_info(self, var_str): #End if #Check that variable actually exists in ParamGen object: - + if var_name in self.__var_group_dict: #Extract namelist group list for variable: data_group = self.__var_group_dict[var_name] @@ -1081,7 +1081,7 @@ def get_user_nl_var_array_info(self, var_str): #Raise error that namelist variable isn't listed in #anywhere in a definition file: emsg = f"Variable '{var_name}' not found in any namelist definition files." - emsg += " Please double-check 'user_nl_cam'." + emsg += " Please double-check 'user_nl_blom'." raise OcnInParamGenError(emsg) #End if @@ -1094,7 +1094,7 @@ def get_user_nl_var_array_info(self, var_str): #Determine if variable is actually an array or not: is_array = bool(array_type_dims) - #Exit function here if no array indices were used in user_nl_cam file: + #Exit function here if no array indices were used in user_nl_blom file: if not array_syntax_match: #No parantheses used, so no indices need to be checked: @@ -1102,10 +1102,10 @@ def get_user_nl_var_array_info(self, var_str): #End if #If variable is not an array, but array indices are being - #used in user_nl_cam, then throw an error: + #used in user_nl_blom, then throw an error: if not is_array: emsg = f"Variable '{var_name}' is not an array, but array" - emsg += " dimensions are being specified in 'user_nl_cam'." + emsg += " dimensions are being specified in 'user_nl_blom'." raise OcnInParamGenError(emsg) #End if @@ -1153,7 +1153,7 @@ def get_user_nl_var_array_info(self, var_str): #Raise error with proper message: emsg = f"Variable '{var_name}' has {num_user_dims}" - emsg += f" {user_dim_str} used in 'user_nl_cam', but is defined" + emsg += f" {user_dim_str} used in 'user_nl_blom', but is defined" emsg += f" to have {num_arr_dims} {array_dim_str}" raise OcnInParamGenError(emsg) #End if @@ -1290,15 +1290,15 @@ def check_array_indices(self, var_name, arr_index_list): def append_user_nl_file(self, user_nl_file): """ - Reads in user_nl_cam files and converts + Reads in user_nl_blom files and converts them to the proper ParamGen syntax. ---------- - user_nl_file -> Path (str) to user_nl_cam file. + user_nl_file -> Path (str) to user_nl_blom file. """ #Create ordered dictionary to store namelist groups, - #variables, and values from user_nl_cam file: + #variables, and values from user_nl_blom file: _data = OrderedDict() #Initialize flag preventing duplicate namelist entries: @@ -1310,7 +1310,7 @@ def append_user_nl_file(self, user_nl_file): #Initialize flag to mark whether the line is an array continuation line: is_continue_line = False - #Open user_nl_cam file: + #Open user_nl_blom file: with open(user_nl_file,'r', encoding='utf-8') as user_file: for line_num, line in enumerate(user_file): if len(line)>1: @@ -1354,7 +1354,7 @@ def append_user_nl_file(self, user_nl_file): #in-between. Technically this is allowed, #but in practice it is VERY likely a mistake, #so raise an error here: - emsg = f"Line number {line_num+1} in 'user_nl_cam'" + emsg = f"Line number {line_num+1} in 'user_nl_blom'" emsg += " starts with a comma (,) but the" emsg += " previous line ended with a comma." emsg += "\nPlease remove one of the commas." @@ -1365,7 +1365,7 @@ def append_user_nl_file(self, user_nl_file): is_continue_line = True else: #The previous variable is not an array, so throw an error: - emsg = f"Line number {line_num+1} in 'user_nl_cam'" + emsg = f"Line number {line_num+1} in 'user_nl_blom'" emsg += " starts with a comma (,) but the" emsg += " associated namelist variable is not an array." raise OcnInParamGenError(emsg) @@ -1384,6 +1384,15 @@ def append_user_nl_file(self, user_nl_file): is_array, var_name, arr_indxs, data_group = \ self.get_user_nl_var_array_info(var_str) + #Check if variable can actually be set in user_nl_blom - or must be specified + #only via xmlchange + user_only_modify_via_xml = self._data[data_group][var_str]["modify_via_xml"] != 'unset' + if user_only_modify_via_xml: + xml_var = self._data[data_group][var_str]["modify_via_xml"] + emsg = f"Cannot change {var_str} in user_nl_blom file," + emsg += f" can only set {var_str} via xmlchange to {xml_var.upper()} \n" + raise OcnInParamGenError(emsg) + #Are there array indices specified: if arr_indxs: @@ -1438,7 +1447,7 @@ def append_user_nl_file(self, user_nl_file): if len(no_equals_line) != len(line): #This looks like the start of a new namelist entry without the #proper ending of the previous entry. So raise an error here: - emsg = f"Line number {line_num+1} in 'user_nl_cam' appears" + emsg = f"Line number {line_num+1} in 'user_nl_blom' appears" emsg += " to be starting a new namelist entry,\nbut" emsg += " the previous entry has a trailing comma (,). Please fix." raise OcnInParamGenError(emsg) @@ -1462,29 +1471,60 @@ def append_user_nl_file(self, user_nl_file): #End for #End with - #Check if any user_nl_cam data is present: + #Check if any user_nl_blom data is present: if _data: #If so, then create new ParamGen object: pg_user = ParamGen(_data) - #Append new user_nl_cam object to main ocn_in namelist object: + #Append new user_nl_blom object to main ocn_in namelist object: self.append(pg_user) #End if #### - def write_nmlfile(self, output_path, groups): + def set_value(self, variable, value): + """ + Reset value of namelist variable + ---------- + """ + + #Loop through namelist groups in alphabetical order: + for nml_group in sorted(self._data): + #Create function to properly sort variables with array indices: + var_sort_key = lambda var : var[:var.index("(")] if "(" in var else var + # Change value of variable + for var in sorted(self._data[nml_group], key=var_sort_key): + if var == variable: + self._data[nml_group][var]["values"] = value + break + + def get_value(self, variable): + """ + Get value of namelist variable + ---------- + """ + + #Loop through namelist groups in alphabetical order: + for nml_group in sorted(self._data): + #Create function to properly sort variables with array indices: + var_sort_key = lambda var : var[:var.index("(")] if "(" in var else var + # Change value of variable + for var in sorted(self._data[nml_group], key=var_sort_key): + if var == variable: + value = self._data[nml_group][var]["values"] + break + return value + def write_nmlfile(self, output_path, groups): """ Write data to Fortran namelist file. ---------- output_path -> path (str) to Fortran namelist (ocn_in) file - """ # Make sure ParamGen object has been reduced: if not self.reduced: emsg = "ParamGen object for ocn_in must be reduced before being " - emsg += "written to file. Please check CAM's buildnml script." + emsg += "written to file. Please check BLOM's buildnml script." raise OcnInParamGenError(emsg) #End if @@ -1610,7 +1650,6 @@ def write_inputdata(self, output_path, groups): def reduce_ocn_in(self, case, ocn_attr_dict): - """ Reduce XML namelist attributes (i.e. replace attribute/guard dictionary with value) From 2f5937014871fda49caa8ecd5c5e55ea523e5667 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 7 Aug 2023 11:46:36 +0200 Subject: [PATCH 18/33] updates and bug fixes for using paramgen --- cime_config/README.ipynb | 1100 ++++++++++++++++++++++ cime_config/XML_NML.ipynb | 338 +++++++ cime_config/buildnml | 11 +- cime_config/case_dict.py | 9 + cime_config/namelist_definition_blom.xml | 14 +- cime_config/ocn_in_paramgen.py | 24 +- cime_config/paramgen.py | 556 +++++++++++ cime_config/paramgen_utils.py | 233 +++++ cime_config/xml_schema/entry_id_pg.xsd | 91 ++ 9 files changed, 2360 insertions(+), 16 deletions(-) create mode 100644 cime_config/README.ipynb create mode 100644 cime_config/XML_NML.ipynb create mode 100644 cime_config/case_dict.py create mode 100644 cime_config/paramgen.py create mode 100644 cime_config/paramgen_utils.py create mode 100644 cime_config/xml_schema/entry_id_pg.xsd diff --git a/cime_config/README.ipynb b/cime_config/README.ipynb new file mode 100644 index 00000000..874f55be --- /dev/null +++ b/cime_config/README.ipynb @@ -0,0 +1,1100 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# ParamGen Quickstart Guide\n", + "Alper Altuntas, NCAR\\\n", + "Boulder, CO - 2021" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Introduction\n", + "\n", + "ParamGen is a lightweight, generic Python module for generating runtime parameters for earth system modeling applications. The module supports arbitrary Python expressions for the specification of parameter values. This provides a high level of flexibility and genericity.\n", + "\n", + "ParamGen infers the values of model parameters from inclusive sets of *default parameters databases* (DPD) to be put together and maintained by the model developers. These databases are typically stored in a file written in a markup language such as xml, yaml or json. ParamGen is generic, i.e., it is agnostic of any details of a particular modeling framework, model component, or input/output format. By default, the base ParamGen class supports xml, yaml and json as DPD (input) format. The only out-of-the-box output format, on the other hand, is the Fortran namelist format. New input and output formats can easily be introduced by application developers via class inheritance as will be discussed in this document. \n", + "\n", + "The primary property of a ParamGen instance is its `.data` member, which is of type Python dictionary, i.e., a collection of key-value pairs. When a ParamGen instance gets created, a dictionary must be provided to the ParamGen constructor to be accepted as its initial `.data`. This initial dictionary corresponds to the DPD, which may be read from xml, yaml, json, etc.\n", + "\n", + "In the simplest case, the keys correspond to parameter names and the values correspond to parameter values. In a more involved case, the `.data` member may be formed as a nested dictionary for grouping model parameters into seperate namelist modules. Moreover, the keys of the `.data` member may consist of logical expressions, i.e., *guards*. The notion of guards is one of the most important concepts in ParamGen. A *guard* is a proposition of a parameter value (similar to how guards are propositions of commands in Dijkstra's Guarded Command Language). Take the following data, for instance:\n", + "\n", + "```\n", + "NIGLOBAL:\n", + " $OCN_GRID == \"gx1v6\":\n", + " 320\n", + " $OCN_GRID == \"tx0.66v1\": \n", + " 540\n", + "...\n", + "```\n", + "\n", + "In the above nested dictionary, `NIGLOBAL` is interpreted as one of the parameter names. Within the inner dictionary, however, we have two keys, both of which are logical expressions. These logical expressions, or guards, are regarded as propositions of the values following them. After the instantiation, the `.reduce()` method may be called to evaluate the guards and determine the values of model parameters. In the above example, assuming the expandable variable `OCN_GRID` is `\"tx0.66v1\"`, calling the reduce method results in: \n", + "\n", + "```\n", + "NIGLOBAL:\n", + " 540\n", + "...\n", + "```\n", + "\n", + "Finally, the `.write()` method may be called to write the set of parameters in a desired format.\n", + "\n", + "*Note: not sure about the \"default parameters database\" (DPD) term. Any alternative suggestions welcome.* -aa" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. ParamGen in Action\n", + "\n", + "#### Obtaining ParamGen\n", + "\n", + "Although ParamGen is model-agnostic, it is currently distributed within an experimental CESM fork. To obtain this CESM version, run the following commands:\n", + "\n", + "```\n", + "git clone https://github.com/alperaltuntas/CESM.git -b paramGenBeta\n", + "(cd CESM; ./manage_externals/checkout_externals -o)\n", + "```\n", + "\n", + "In the above CESM sandbox, ParamGen is located in `CESM/cime/scripts/lib/CIME/ParamGen`\n", + "\n", + "#### Importing ParamGen class\n", + "\n", + "The first step of working with ParamGen is to import the module. \n", + "To import this experimental version of ParamGen module:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from paramgen import ParamGen" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note: In the case of a CESM model, ParamGen would be imported from a buildnml script. To do so, one would first append the ParamGen directory to the PATH. See `CESM/components/mom/cime_config/buildnml` as an example." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Instantiating a ParamGen object:\n", + "ParamGen constructor expects a `data` argument, that is a Python dictionary which may be nested or not. This dictionary corresponds to the default parameters database (DPD) that is the collection of parameter name-value pairs for all possible configurations. Let's first define a simple Python dictionary containing three variables `X`, `Y`, and `Z`:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "DPD_dict = {\"X\" : 1.0,\n", + " \"Y\" : True,\n", + " \"Z\" : \"foo\" }" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, create a ParamGen instance with this DPD dictionary:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "pg = ParamGen(DPD_dict)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'X': 1.0, 'Y': True, 'Z': 'foo'}" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can now call the reduce method to generate the final version of `.data`:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "pg.reduce()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'X': 1.0, 'Y': True, 'Z': 'foo'}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As expected, the reduced data is not any different from the initial data we passed to ParamGen constructor. The `.reduce()` method makes a difference only when the initial data contains conditionals, variable expansion, or Python expressions. Before describing these mechanisms, let's generate the same ParamGen instance via yaml and json formats:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Instantiating a ParamGen object via yaml or json:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "ParamGen can be instantiated via yaml or json files using the following methods:\n", + "\n", + "- `.from_yaml()`\n", + "- `.from_json()`\n", + "\n", + "\n", + "Under the hood, these methods simply create a Python dictionary from files with these formats and then call the ParamGen constructor with the generated dictionary." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### yaml" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing DPD.yaml\n" + ] + } + ], + "source": [ + "%%writefile DPD.yaml\n", + "X: 1.0\n", + "Y: True\n", + "Z: foo" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'X': 1.0, 'Y': True, 'Z': 'foo'}" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# (2) Create a ParamGen instance:\n", + "pg = ParamGen.from_yaml(\"DPD.yaml\")\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### json" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing DPD.json\n" + ] + } + ], + "source": [ + "%%writefile DPD.json\n", + "{\n", + " \"X\": 1.0,\n", + " \"Y\": true,\n", + " \"Z\": \"foo\"\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'X': 1.0, 'Y': True, 'Z': 'foo'}" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# (2) Create a ParamGen instance:\n", + "pg = ParamGen.from_json(\"DPD.json\")\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Instantiating a ParamGen object via XML:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In a similar fashion, a ParamGen object may be created from an XML file. However, when working with XML, a specific schema must be satisfied. See the XML_NML.ipynb document for more information on how to work with XML within the ParamGen framework.\n", + "\n", + "Out of the three commonly used markup languages, yaml has the most readible and concise syntax, especially when working with large number of parameters and nested entries. The disadvantage of yaml is that it is not distributed with the standard Python, unlike xml and json. So a third party yaml parser, e.g., PyYAML, is required.\n", + "\n", + "Instead of using these file formats, we will continue to create ParamGen instances using Python dictionaries explicitly in the remainder of this documentation. Recall that ParamGen converts these formats to a dictionary before creating an instance so the instructions below apply to all ParamGen instances regardless of which DPD format is used." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## ParamGen Mechanisms\n", + "- Variable Expansion\n", + "- Guards\n", + "- Formulas\n", + "- Appending" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Variable expansion\n", + "\n", + "Similar to shell parameter expansion mechanism in Linux, The `$` character may be used to introduce expandable variables in DPDs. These variables are expanded, i.e., replaced with their values, when the `.reduce()` method is called. Variable expansion may be employed in both keys and values of DPD dictionaries. To illustrate this mechanism, we define a new ParamGen instance:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "pg = ParamGen({\n", + " \"${alpha}\": 1.0,\n", + " \"Y\": \"$beta\",\n", + " \"$gamma\": \"foo\"\n", + "})" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'${alpha}': 1.0, 'Y': '$beta', '$gamma': 'foo'}" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the above ParamGen instantiation, we specify three expandable variables in keys and values: `alpha`, `beta`, `gamma`. \n", + "When expandable variables are included in the initial data, an `expand_func` must be provided. This function is required to take a string as an argument and return a scalar, i.e., a string, integer, float, or a boolean variable. The passed string corresponds to the variable name, while the return value corresponds the value of the expandable variable. A rather simple `expand_func` is defined below for demonstration purposes." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "def expand_func(varname):\n", + " if varname == \"alpha\":\n", + " return \"X\"\n", + " elif varname == \"beta\":\n", + " return True\n", + " elif varname == \"gamma\":\n", + " return \"Z\"\n", + " else:\n", + " raise RuntimeError(\"Unknown variable\")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "pg.reduce(expand_func)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'X': 1.0, 'Y': 'True', '\"Z\"': 'foo'}" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As seen above, all the expandable variables are expanded, i.e., replaced with their respective values. Notice that variable `beta` is converted from bool to string during variable expansion. The same behavior applies to numeric variables as well. However, this behavior is not restrictive because (1) all values are converted to strings before they are written out to text files anyways and (2) all logical expressions and formulas are to be strings to be evaluated. \n", + "\n", + "**Warning:** There is a behavioral difference between specifying string variables with curly braces vs. without curly braces. When a variable of type string gets specified ***without*** curly braces, it's value is automatically enclosed by quotes when the `reduce()` method is called. However, string variables specified ***with*** curly braces are not automatically enclosed by quotes. This behavior can be observed with the variable `gamma` which expands to `'\"Z\"'`. Had we specified gamma with curly braces, i.e., `${gamma}`, the value would rather be `'Z'`, and not `'\"Z\"'`. This can be confirmed with the variable `alpha` above, which expands to `'X'`.\n", + "\n", + "This behavior is introduced in ParamGen as a means of keeping conditional expressions more concise. Compare the following two logical ParamGen expressions, which are equivalent, but the first one has expandable variables defined with curly braces. In the first version, not only do we have to explicitly enclose expandable variables with quotes (`\"${...}\"`), but also the entire expression (`'...'`) so as to make sure that YAML parser treats the entire logical formula as a single expression. In the second version, neither of the quotes is necessary, except, of course, for the literal strings `\"gx1v7\"` and `\"datm\"`.\n", + "\n", + "`' \"${OCN_GRID}\" == \"gx1v7\" and \"${COMP_ATM}\" == \"datm\" ':`\n", + "\n", + "`$OCN_GRID == \"gx1v7\" and $COMP_ATM == \"datm\":`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### CESM/CIME XML variables as expandable variables" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Within the CESM framework, CIME XML variables may easily be specified in DBDs as expandable variables. Typically, `ParamGen` is utilized in `buildnml` scripts of components. The first argument of all `buildnml` methods is the `case` variable which is an instance of `CIME.case.Case`. This CIME case object has a `.get_value()` method that returns the value of a given XML variable. This method may simply be passed to the `reduce()` method of ParamGen as an expand function:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```\n", + "def expand_func(varname):\n", + " case.get_value(varname)\n", + " \n", + "pg.reduce(expand_func)\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Or, more concisely:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```\n", + "pg.reduce(lambda varname: case.get_value(varname))\n", + "\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Examples of this usage can be found in MOM6 implementation of ParamGen. Check out the following derived ParamGen classes of MOM6:\n", + "\n", + " - CESM/components/mom/cime_config/MOM_RPS/FType_input_nml.py\n", + " - CESM/components/mom/cime_config/MOM_RPS/FType_MOM_params.py\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Guards" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Recall that the keys of the `.data` dictionary specify the parameter names while the values correspond to the respective parameter values. Depending on the context, the keys may also be interpreted as guards, i.e., propositions of parameter values. The keys are interpreted as guards if all the keys at a certain level are logical expressions that evaluate to True or False. A data dictionary *without* any guards:" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "dict1 = {\n", + " \"var1\": 1,\n", + " \"var2\": 2\n", + "}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A data dictionary with some guards:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "dict2 = {\n", + " \"var1\": {\n", + " True: 1,\n", + " False: 0\n", + " },\n", + " \"var2\": 2\n", + "}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the above dictionary `dict2`, the variable `var1` has two options, `1` and `0`. Which value gets picked for \"var1\" depends on the guards, i.e., the propositions `True` and `False`. Now let's create a ParamGen instance with the dictionary `dict2`:" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'var1': {True: 1, False: 0}, 'var2': 2}" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg = ParamGen(dict2)\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Observe the effect of calling the reduce method below:" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'var1': 1, 'var2': 2}" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg.reduce()\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Logical Python expressions as guards\n", + "\n", + "The guards above are trivially specified to be `True` and `False`. In practice, however, guards are arbitrary Python expressions that evaluate to `True` or `False`. These expressions may have expandable variables, standard Python operators, method calls, etc. For an expression to be regarded as a guard, then, the expression must evaluate to `True` or `False`.\n", + "\n", + "Note: In YAML, the quotes enclosing the expressions are not necessary, since the YAML parser automatically interprets those logical expressions as strings.\n", + " \n", + "The following is an example with arbitrary Python expressions as guards:" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'var1': 1, 'var2': 2}" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def expand_func(varname):\n", + " if varname == \"one\":\n", + " return 1.0\n", + " elif varname == \"two\":\n", + " return 2.0\n", + " else:\n", + " raise RuntimeError(\"Unknown variable\")\n", + " \n", + " \n", + "dict3 = {\n", + " \"var1\": {\n", + " '$one < $two' : 1,\n", + " '$one > $two' : 0\n", + " },\n", + " \"var2\": 2\n", + "}\n", + "\n", + "pg = ParamGen(dict3)\n", + "pg.reduce(expand_func)\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Guard behavior\n", + "\n", + "- If multiple guards evaluate to True, the last option gets picked. If it is desired to pick the first valid option, however, the default behavior may be changed by setting the optional `match` argument of ParamGen to `first`. For example: `pg = ParamGen(dict2, match='first')`\n", + "- If no guards evaluate to True, the parameter value gets set to `None`. In a model-specific write method, the parameters with the value `None` may, for example, be chosen to be omitted by the application developer. \n", + "- the `else` keyword evaluates to True only if all other guards evaluate to False.\n", + "- When an expandable variable is attempted to be expanded, and if the value is undefined, ParamGen throws an error. In some cases, certain expandable variables may be defined only for certain configurations. \n", + "For instance, in the below example, the variable `INIT_LAYERS_FROM_Z_FILE` is defined only if the `OCN_GRID` is one of `[\"gx1v6\", \"tx0.66v1\", \"tx0.25v1\"]`. Therefore, to avoid undefined expandable variable error, we place the `INIT_LAYERS_FROM_Z_FILE` check below the `OCN_GRID` check, as follows:\n", + "\n", + "```\n", + " tempsalt:\n", + " $OCN_GRID in [\"gx1v6\", \"tx0.66v1\", \"tx0.25v1\"]:\n", + " $INIT_LAYERS_FROM_Z_FILE == \"True\":\n", + " \"${INPUTDIR}/${TEMP_SALT_Z_INIT_FILE}\"\n", + "```\n", + "\n", + " This ensures that ParamGen attempts to expand `INIT_LAYERS_FROM_Z_FILE` variable only when `$OCN_GRID in [\"gx1v6\", \"tx0.66v1\", \"tx0.25v1\"]` evaluates to True." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Formulas" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In ParamGen, a variable value may be specified as a formula to be evaluated. This is done by setting the first character of a value to a space delimited `=` character. See the below example:" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'var1': 5}" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg = ParamGen({\n", + " 'var1' : '= 2+3'\n", + "})\n", + "pg.reduce()\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that formulas may also include expandable variables:" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'var1': 2.5}" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg = ParamGen({\n", + " 'var1' : '= (2+3) / $two'\n", + "})\n", + "pg.reduce(expand_func)\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Appending" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `append()` method of ParamGen adds the data of a given ParamGen instance to the existing data. If a data entry with the same name already exists, it's value gets overriden with the new value. Otherwise, the new data entry is simply appended to the existing data." + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 1, 'b': 3, 'c': 4}" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg1 = ParamGen({'a':1, 'b':2})\n", + "pg2 = ParamGen({'b':3, 'c':4})\n", + "pg1.append(pg2)\n", + "pg1.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Special Use Cases\n", + "\n", + "### Referencing across multiple ParamGen instances\n", + "\n", + "The genericity that comes with the custom expand functions allows us to reference the data of a ParamGen instance in another ParamGen instance. To illustrate this use case, we define two ParamGen instances:" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "pg1 = ParamGen({\n", + " 'var1' : 'foo',\n", + " 'var2' : 'bar'\n", + "})\n", + "\n", + "pg2 = ParamGen({\n", + " 'var3': '${var1}${var2}' \n", + "})" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Notice above that the second ParamGen instance, pg2, data includes references to variables defined in pg1 data. Now let's reduce the data of pg2 and pass a lambda function that returns the values of pg1 variables:" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "pg2.reduce(lambda varname: pg1.data[varname])" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'var3': 'foobar'}" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg2.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Note:** Cross-referencing, i.e., references to variables within the same instance, is not supported. (May be added later on if need be. -aa)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Custom value inference\n", + "\n", + "More involved expand functions may allow higher customizations. In the below example, for instance, we read in an xarray dataset `ds` and set the value of an expandable variable `my_fields_list` to the list of all variables in `ds`, that is `\"lat air lon time\"`." + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "pg1 = ParamGen({\n", + " 'var1' : 'foo',\n", + " 'var2' : 'bar'\n", + "})\n", + "\n", + "pg2 = ParamGen({\n", + " 'param1': '${var1}${var2}',\n", + " 'param2': '$my_fields_list'\n", + "})\n", + "\n", + "def expand_function(varname):\n", + " if varname in pg1.data:\n", + " return pg1.data[varname]\n", + " elif varname == \"my_fields_list\":\n", + " try:\n", + " import xarray as xr\n", + " ds = xr.tutorial.load_dataset(\"air_temperature\")\n", + " return ' '.join([var for var in ds.variables])\n", + " except:\n", + " print(\"Cannot load xarray module. Skipping...\")\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "pg2.reduce(expand_function)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'param1': 'foobar', 'param2': '\"lat air lon time\"'}" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg2.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Regular expression searches as guards\n", + "\n", + "In some cases, it may be desirable to do regex searches as opposed to simpler string comparisons. One such example use case is provided below:" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "pg = ParamGen({\n", + " 'USE_MARBL_TRACERS': {\n", + " 'bool(re.search(\"MOM6%[^_]*MARBL\", $COMPSET ))': True,\n", + " 'else': False\n", + " }\n", + "})" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'USE_MARBL_TRACERS': True}" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pg.reduce(lambda varname:'1850_DATM%NYF_SLND_DICE%SSMI_MOM6%MARBL_DROF%NYF_SGLC_SWAV')\n", + "pg.data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Notice how the `re.search()` method is used above in the first value guard. The guard evaluates to true since the `re.search()` method is able to find `\"MOM6%[^_]*MARBL\"` regex pattern in the specified COMPSET: \n", + "`1850_DATM%NYF_SLND_DICE%SSMI_MOM6%MARBL_DROF%NYF_SGLC_SWAV`." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Notes on ParamGen for MOM6 in CESM\n", + "\n", + "Here, we briefly describe how ParamGen is used within CESM to generate MOM6 runtime parameters. Called from the `buildnml` script of MOM6+CESM, the ParamGen module is used to generate the four main MOM6 runtime input files:\n", + "\n", + " 1. **MOM_input:** Default MOM6 runtime parameters. The file syntax is based on the simple `key = value` pair. Example parameter entries from a typical MOM6 experiment:\n", + " \n", + " ```\n", + " DIABATIC_FIRST = True ! If true, apply diabatic and thermodynamic processes...\n", + " DT_THERM = 3600.0 ! The thermodynamic and tracer advection time step.\n", + " MIN_SALINITY = 0.0. ! The minimum value of salinity when BOUND_SALINITY=True.\n", + " ```\n", + " \n", + " 2. **MOM_override:** An auxiliary file to override parameter values set in MOM_input\n", + " 3. **input.nml:** A file to set some general MOM6 and FMS variables. The file is in classical Fortran namelist format.\n", + " 4. **diag_table:** An input file to configure the model diagnostics. It has a relatively complex syntax. See https://mom6.readthedocs.io/en/latest/api/generated/pages/Diagnostics.html\n", + " \n", + " In addition to these files, ParamGen is used to generate the MOM6 version of the `input_data_list` file needed by CIME.\n", + " \n", + " ### Default Parameters Databases \n", + " \n", + " For each of the input files mentioned above, we have a DBD that includes all of the default parameter values for any possible model configuration. In the case of `MOM_input` for instance, we have a DBD called `MOM_input.yaml` located in `components/mom/param_templates`. An example entry from this file:\n", + " \n", + " ```\n", + " DT_THERM:\n", + " description: |\n", + " \"[s] default = 3600.0\n", + " The thermodynamic and tracer advection time step.\n", + " value:\n", + " $OCN_GRID == \"MISOMIP\": 1800.0\n", + " else: >\n", + " = ( ( $NCPL_BASE_PERIOD ==\"decade\") * 86400.0 * 3650 +\n", + " ( $NCPL_BASE_PERIOD ==\"year\") * 86400.0 * 365 +\n", + " ( $NCPL_BASE_PERIOD ==\"day\") * 86400.0 +\n", + " ( $NCPL_BASE_PERIOD ==\"hour\") * 3600.0 ) / $OCN_NCPL\n", + "```\n", + "\n", + "In the above entry, the default value of the runtime parameter `DT_THERM` is specified, which depends on a few CIME variables such as `OCN_GRID`, and `OCN_NCPL`. Notice the usage of expandable variables, guards, and a formula.\n", + "\n", + "Assuming `$OCN_GRID != \"MISOMIP\"`, `$NCPL_BASE_PERIOD == \"day\"`, and `$OCN_NCPL==24`, the runtime parameter `DT_THERM` gets reduced to 3600.0 when `.reduce()` method is called. \n", + "\n", + "### Utilizing ParamGen class as a base\n", + "\n", + "For each of the file category, we have developed individual classes derived from the `ParamGen` class. These classes are located in `CESM/components/mom/cime_config/MOM_RPS/` and are utilized in the `buildnml` file to generate the corresponding input files. \n", + "\n", + " - FType_MOM_params.py\n", + " - FType_diag_table.py\n", + " - FType_input_data_list.py\n", + " - FType_input_nml.py\n", + "\n", + "Since the Fortran namelist syntax is already available as an out-of the box format, the most straightforward one is `FType_input_nml.py` which produces the `input.nml` file. The whole module consists of 15 lines of code:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import os, sys\n", + "\n", + "CIMEROOT = os.environ.get(\"CIMEROOT\")\n", + "if CIMEROOT is None:\n", + " raise SystemExit(\"ERROR: must set CIMEROOT environment variable\")\n", + "sys.path.append(os.path.join(CIMEROOT, \"scripts\", \"lib\", \"CIME\", \"ParamGen\"))\n", + "from paramgen import ParamGen\n", + "\n", + "class FType_input_nml(ParamGen):\n", + " \"\"\"Encapsulates data and read/write methods for MOM6 (FMS) input.nml file\"\"\"\n", + "\n", + " def write(self, output_path, case):\n", + " self.reduce(lambda varname: case.get_value(varname))\n", + " self.write_nml(output_path)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Within the `buildnml` script, the above class is instantiated and utilized as follows:\n", + "\n", + "```\n", + "...\n", + "input_nml = FType_input_nml.from_json(input_nml_src)\n", + "input_nml.write(input_nml_dest, case)\n", + "```\n", + "\n", + "#### (todo) more descriptions and notes to come." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "base", + "language": "python", + "name": "base" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/cime_config/XML_NML.ipynb b/cime_config/XML_NML.ipynb new file mode 100644 index 00000000..bf87f0d7 --- /dev/null +++ b/cime_config/XML_NML.ipynb @@ -0,0 +1,338 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# XML Namelist Format in ParamGen\n", + "Alper Altuntas, NCAR\\\n", + "Boulder, CO - 2021" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Introduction\n", + "\n", + "Here, we briefly describe a special use case of ParamGen: XML-based namelist format. This document is complementary to the README.ipynb file, which describes ParamGen in a broader context and with more detail. It is advised to read the README.ipynb file first." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. XML Namelist Template" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The YAML and JSON frontends of ParamGen are quite flexible in terms of the data layout, or schema. In the case of XML, however, we work with a predefined schema that resembles CESM's `entry_id_namelist.xsd`. The new ParamGen schema, called `entry_id_pg.xsd`, is located in `cime/scripts/lib/CIME/ParamGen/xml_schema/`\n", + "\n", + "We first write an example xml file, named `my_tamplate.xml` below that conforms to this new schema." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing my_template.xml\n" + ] + } + ], + "source": [ + "%%writefile my_template.xml\n", + "\n", + "\n", + "\n", + "\n", + " \n", + " real\n", + " setup_nml\n", + " Days per year\n", + " \n", + " 365\n", + " \n", + " \n", + "\n", + "\n", + " \n", + " logical\n", + " icefields_nml\n", + " f_anglet\n", + " \n", + " .true.\n", + " .false.\n", + " \n", + " \n", + "\n", + " \n", + " char\n", + " setup_nml\n", + " Method of ice cover initialization.\n", + " \n", + " UNSET\n", + " ${DIN_LOC_ROOT}/ice/cice/b40.t31x3.20th.cice.r.2006-01-01-00000.nc\n", + " ${DIN_LOC_ROOT}/ice/cice/b.e15.B1850G.f09_g16.pi_control.25.cice.r.0041-01-01-00000.nc\n", + " ${DIN_LOC_ROOT}/ice/cice/g.e11.G.T62_t12.002.cice.r.0016-01-01-00000.nc\n", + " ${DIN_LOC_ROOT}/ice/cice/cice5ic/r26RBRCICE5g0.cice.r.1990-09-01-00000.nc\n", + " \n", + " \n", + "\n", + "\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The above xml file includes three namelist variable definitions taken from CICE `namelist_definition_cice.xml`. Notice how the format is very similar to the original namelist definition format. Some of the differences between the original `entry_id_namelist.xsd` vs the new `entry_id_pg.xsd:`\n", + "\n", + "- To easily distinguish these schemas, the root element in the new schema is called `entry_id_pg`, and not `entry_id`.\n", + "- Currently, only a subset of descriptive child elements are supported for `entry_id_pg` entries. These are `type`, `group`, and `desc`. More elements may be added as needed.\n", + "- In the traditional format, value propositions would be specified with arbitrary ``, attributes, e.g., `hgrid=\"gx3v7`\". The new format also supports this specification type. And within a value entry, multiple key=value attributes may be specified, in which case they are joined with logical AND. In ParamGen implementation of XML specification, however, there is an alternative method of specifying guards, which brings about greater flexibility. \n", + "- The more flexible method is based on specifying guards via the `guard=` attribute. A `guard=` attribute can be any arbitrary Python expression that evalutes to True or False. These expressions can involve any variables (see `expand_func` description in README.ipynb) and any standard Python operators, methods, list comprehensions, etc. Notice how the `.startswith()` method is used to abbreviate the `ice_ic` value list compared to the the traditional proposition specification which would require multiple value entries for each grid starting with \"gx1v\", \"tx0.1v\", and \"ar9v3\"." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Before showcasing the ParamGen module, we define an `expand_func`. Recall that ParamGen makes use of custom `expand_func` to infer the values of expandable variables. In the above xml file, we have three such variables: `cice_mode`, `ICE_GRID`, and `DIN_LOC_ROOT`." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def expand_func_demo(varname):\n", + " return {\n", + " 'ICE_GRID': 'gx1v6',\n", + " 'DIN_LOC_ROOT': '/glade/p/cesmdata/cseg/inputdata',\n", + " 'cice_mode': 'thermo_only',\n", + " }[varname]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "While the above `expand_func_demo` is a trivial one for demonstration purposes, the below `expand_func` is a real-world example taken from MOM6 within CESM:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def expand_func(varname):\n", + " return case.get_value(varname)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where `case` is a CIME case object whose `get_value()` method returns the values of XML variables like `ICE_GRID`, `DIN_LOC_ROOT`, etc." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. ParamGen XML namelist format in action\n", + "\n", + "We first import the ParamGen class as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "from paramgen import ParamGen" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can now instantiate a ParamGen object by passing the `my_template.xml` file path to the `from_xml_nml()` method of ParamGen" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "pg = ParamGen.from_xml_nml(\"./my_template.xml\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "After having instantiated the ParamGen object, we can call its `reduce` method to evaluate guards and infer final namelist variable values. Notice that we pass in the `expand_func_demo` method so ParamGen can infer the values of expandable variables such as `ICE_GRID`." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "pg.reduce(expand_func_demo)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, we can write out a Fortran namelist file as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "pg.write_nml(\"./my_nml_file.nml\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The resulting namelist file is as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "&setup_nml\n", + " days_per_year = 365\n", + " ice_ic = /glade/p/cesmdata/cseg/inputdata/ice/cice/b.e15.B1850G.f09_g16.pi_control.25.cice.r.0041-01-01-00000.nc\n", + "/\n", + "\n", + "&icefields_nml\n", + " f_anglet = .true.\n", + "/\n", + "\n" + ] + } + ], + "source": [ + "!cat ./my_nml_file.nml" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In addition to writing out the namelist file, we can access the data directly, both before and after the `reduce()` method is called. Some examples:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + ".true.\n" + ] + } + ], + "source": [ + "# print out the final value of `f_anglet`:\n", + "print(pg.data['icefields_nml']['f_anglet']['values'])" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Days per year\n" + ] + } + ], + "source": [ + "# print out the description of `days_per_year`:\n", + "print(pg.data['setup_nml']['days_per_year']['desc'])" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "char\n" + ] + } + ], + "source": [ + "# print out the type of `ice_ic`:\n", + "print(pg.data['setup_nml']['ice_ic']['type'])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "CMIP6 2019.10", + "language": "python", + "name": "cmip6-201910" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/cime_config/buildnml b/cime_config/buildnml index f89f1b16..34380183 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -22,6 +22,7 @@ from CIME.XML.standard_module_setup import * from CIME.buildnml import create_namelist_infile, parse_input from CIME.case import Case from CIME.utils import expect +from case_dict import CaseDict # Save local (cime_config) directory path: _CIME_CONFIG_PATH = os.path.dirname(os.path.abspath(__file__)) @@ -181,7 +182,15 @@ def buildnml(case, caseroot, compname): # Set all ParamGen namelist values: #--------------------------------- - pg_blom.reduce_ocn_in(case, config) + case_dict = CaseDict() + var_list = ('DIN_LOC_ROOT', 'RUN_TYPE', 'BLOM_VCOORD', + 'CCSM_CO2_PPMV', 'HAMOCC_SEDSPINUP_YR_START', + 'HAMOCC_SEDSPINUP_YR_END') + + for item in var_list: + case_dict[item] = case.get_value(item) + + pg_blom.reduce_ocn_in(case_dict, config) #---------------------------------------------------- # Reset values of some variables diff --git a/cime_config/case_dict.py b/cime_config/case_dict.py new file mode 100644 index 00000000..6a747555 --- /dev/null +++ b/cime_config/case_dict.py @@ -0,0 +1,9 @@ +class CaseDict(dict): + """Class to handle using a case as a dictionary rather + than a CIME case object""" + + def get_value(self, key): + if key in self: + return self[key] + else: + return None diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 0f088bb6..4eb67a28 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -3562,7 +3562,7 @@ bgcnml bgcnml - UNSET + '' $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_1850_CMIP6_tnx2v1_20180321.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_2000_CMIP6_tnx2v1_20200826.nc $DIN_LOC_ROOT/ocn/blom/bndcon/ndep_185001-201412_tnx2v1_20190702.nc @@ -3696,7 +3696,7 @@ bgcnml bgcnml - UNSET + '' $DIN_LOC_ROOT/ocn/blom/inicon/d13C_permil_20180609.nc add desc @@ -3707,7 +3707,7 @@ bgcnml bgcnml - UNSET + '' $DIN_LOC_ROOT/ocn/blom/inicon/d14C_permil_20180609.nc add desc @@ -3728,7 +3728,7 @@ bgcnml bgcnml - UNSET + '' File name (incl. full path) for surface PI pH input data. @@ -3750,7 +3750,7 @@ bgcnml bgcnml - UNSET + '' File name (incl. full path) for sediment porosity @@ -3767,7 +3767,7 @@ bgcoafx bgcoafx - UNSET + '' Name of alkalinization scenario ('const', 'ramp', or 'file') @@ -3777,7 +3777,7 @@ bgcoafx bgcoafx - UNSET + '' Full path of the input file for the alkalinization scenario 'file' diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index e6b0e913..a30ed5f3 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -26,13 +26,12 @@ raise SystemExit("ERROR: must set CIMEROOT environment variable") sys.path.append(os.path.join(_CIME_ROOT, "CIME", "Tools")) -_PARAMGEN_ROOT = os.path.join(_CIME_ROOT, "CIME", "ParamGen") - -if not os.path.exists(_PARAMGEN_ROOT): - _EMSG = f"ERROR: Cannot find '{_PARAMGEN_ROOT}' directory. Did you run checkout_externals?" - raise SystemExit(_EMSG) +#_PARAMGEN_ROOT = os.path.join(_CIME_ROOT, "CIME", "ParamGen") +# if not os.path.exists(_PARAMGEN_ROOT): +# _EMSG = f"ERROR: Cannot find '{_PARAMGEN_ROOT}' directory. Did you run checkout_externals?" +# raise SystemExit(_EMSG) #End if -sys.path.append(_PARAMGEN_ROOT) +#sys.path.append(_PARAMGEN_ROOT) #pylint: disable=wrong-import-position from paramgen import ParamGen #pylint: enable=wrong-import-position @@ -642,6 +641,10 @@ def _check_string_quotes(var_name, var_val): #Make sure variable has been stripped: var_val_strip = var_val.strip() + # If string is empty, just return + if var_val_strip is '': + return True + #Set error message (just in case): emsg = f"Namelist entry '{var_name}' is of type character" emsg += " but its input value:" @@ -1644,8 +1647,13 @@ def write_inputdata(self, output_path, groups): if self._data[nml_group][var]["is_inputdata"] == 'yes': val = self._data[nml_group][var]["values"].strip() - val = val.replace('"','') - if 'unset' not in val and 'UNSET' not in val: + val = val.replace('"',"'") + write_val = True + if val == "''": + write_val = False + elif 'unset' in val or 'UNSET' in val: + write_val = False + if write_val: ocn_in_fil.write(f"{var} = {val} \n") diff --git a/cime_config/paramgen.py b/cime_config/paramgen.py new file mode 100644 index 00000000..edc18b17 --- /dev/null +++ b/cime_config/paramgen.py @@ -0,0 +1,556 @@ +import os +import sys +import re +from copy import deepcopy +import logging +import subprocess + +try: + from paramgen_utils import is_logical_expr, is_formula, has_unexpanded_var + from paramgen_utils import eval_formula +except ModuleNotFoundError: + from CIME.ParamGen.paramgen_utils import ( + is_logical_expr, + is_formula, + has_unexpanded_var, + ) + from CIME.ParamGen.paramgen_utils import eval_formula + +assert ( + sys.version_info.major == 3 and sys.version_info.minor >= 6 +), "ParamGen requires Python 3.6 or later." + +logger = logging.getLogger(__name__) + + +class ParamGen: + """ + ParamGen is a versatile, generic, lightweight base class to be used when developing namelist + and parameter generator tools for scientific modeling applications. + + Attributes + ---------- + data : dict + The data attribute to operate over. See Methods for the list of operations. + match: str + "first" or "last". + + Methods + ------- + from_json(input_path) + Reads in a given json input file and initializes a ParamGen object. + from_yaml(input_path) + Reads in a given yaml input file and initializes a ParamGen object. + """ + + def __init__(self, data_dict, match="last"): + assert isinstance( + data_dict, dict + ), "ParamGen class requires a dict as the initial data." + # self._validate_schema(data_dict) + self._original_data = deepcopy(data_dict) + self._data = deepcopy(data_dict) + self._reduced = False + self._match = match + + @property + def data(self): + """Returns the data attribute of the ParamGen instance.""" + return self._data + + @property + def reduced(self): + """Returns True if reduce() method is called for this instance of ParamGen.""" + return self._reduced + + @property + def is_empty(self): + """Returns True if the data property is empty.""" + return len(self._data) == 0 + + @classmethod + def from_json(cls, input_path, match="last"): + """ + Reads in a given json input file and initializes a ParamGen object. + + Parameters + ---------- + input_path: str + Path to json input file containing the defaults. + match: str + "first" or "last" + Returns + ------- + ParamGen + A ParamGen object with the data read from input_path. + """ + + import json + + with open(input_path) as json_file: + _data = json.load(json_file) + return cls(_data, match) + + @classmethod + def from_yaml(cls, input_path, match="last"): + """ + Reads in a given yaml input file and initializes a ParamGen object. + + Parameters + ---------- + input_path: str + Path to yaml input file containing the defaults. + match: str + "first" or "last" + Returns + ------- + ParamGen + A ParamGen object with the data read from input_path. + """ + + import yaml + + with open(input_path) as yaml_file: + _data = yaml.safe_load(yaml_file) + return cls(_data, match) + + @classmethod + def from_xml_nml(cls, input_path, match="last", no_duplicates=False): + """ + Reads in a given xml input file and initializes a ParamGen object. The XML file must conform to the + entry_id_pg.xsd schema that's defined within ParamGen. + + Parameters + ---------- + input_path: str + Path to xml input file containing the defaults. + match: str + "first" or "last" + no_duplicates: bool + If True, then any duplicate entry ids in the XML file will result in an error. + + Returns + ------- + ParamGen + A ParamGen object with the data read from input_path. + """ + + # First check whether the given xml file conforms to the entry_id_pg.xsd schema + from distutils.spawn import find_executable + + xmllint = find_executable("xmllint") + if xmllint is None: + logger.warning("Couldn't find xmllint. Skipping schema check") + else: + schema_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + "xml_schema", + "entry_id_pg.xsd", + ) + xmllint_cmd = "{} --xinclude --noout --schema {} {}".format( + xmllint, schema_path, input_path + ) + stat = subprocess.run( + xmllint_cmd, shell=True, capture_output=True, text=True, check=True + ) + assert ( + stat.returncode == 0 + ), "While checking file {} against nml schema, received following errmsg: {}".format( + input_path, stat.stderr + ) + + import xml.etree.ElementTree as ET + + xml_tree = ET.parse(input_path) + root = xml_tree.getroot() + data = {} + + # Loop over all entries (namelist variables) + for entry in list(root): + # where each entry corresponds to a namelist variable, i.e., parameter + param_name = entry.attrib["id"] + if no_duplicates and param_name in data: + # No duplicate namelist entries allowed, so raise error: + emsg = "Entry id '{}' listed twice in file:\n'{}'" + raise ValueError(emsg.format(param_name, input_path)) + else: + data[param_name] = {} + + if "is_inputdata" in entry.attrib: + data[param_name]["is_inputdata"] = entry.attrib["is_inputdata"] + else: + data[param_name]["is_inputdata"] = "no" + + if "modify_via_xml" in entry.attrib: + data[param_name]["modify_via_xml"] = entry.attrib["modify_via_xml"] + else: + data[param_name]["modify_via_xml"] = 'unset' + + # loop over child entries and attributes of the parameter + for child in list(entry): + if child.tag == "values": + data[param_name]["values"] = {} + values = list(child) + + # check if the values have logical guards as propositions + guards = {} + for value in values: + if "guard" in value.attrib: + assert len(value.attrib) == 1, ( + "If an explicit guard attribute is provided for a value," + + "no other attribute may be provided. Check parameter {}".format( + param_name + ) + ) + guards[value] = value.attrib["guard"] + elif len(value.attrib) > 0: + guards[value] = " and ".join( + [ + '"${{{}}}" == "{}"'.format( + str(guard_var), str(guard_val) + ) + for guard_var, guard_val in value.attrib.items() + ] + ) + else: + assert "else" not in guards.values(), ( + "Multiple values with no guards (proposition)" + + "detected in variable {}".format(param_name) + ) + guards[value] = "else" + + if len(values) == 1 and guards[values[0]] == "else": + data[param_name]["values"] = list(values)[0].text.strip() + else: + for value, guard in guards.items(): + data[param_name]["values"][guard] = value.text.strip() + + else: + # a child element other than the element (.e.g, type, desc, group, etc.) + data[param_name][child.tag] = child.text.strip() + + # now group the parameters according to their group_id's: + _data = {} # grouped data + for param_name in data: + param_group = data[param_name]["group"] + if param_group not in _data: + _data[param_group] = {} + _data[param_group][param_name] = data[param_name] + + return cls(_data, match) + + @staticmethod + def _expand_vars(expr, expand_func): + """Replaces the expandable variables with their values in a given expression (expr) of type str. + + Parameters + ---------- + expr: str + expression with expandable variables, e.g., "$OCN_GRID == "tx0.66v1" + expand_func: + a callable objects that can return the value of any expandable variable specified in expr" + Returns + ------- + an expresion of type string where the expandable variables are replaced with their values. + + Example + ------- + >>> ParamGen._expand_vars("$x + 2 == $z", (lambda var: 1 if var=='x' else 3) ) + '1 + 2 == 3' + """ + + if expand_func is None: + return expr # No expansion function is provided, so return. + + assert isinstance( + expr, str + ), "Expression passed to _expand_vars must be string." + expandable_vars = re.findall(r"(\$\w+|\${\w+\})", expr) + for word in expandable_vars: + word_stripped = ( + word.strip().replace("$", "").replace("{", "").replace("}", "") + ) + word_expanded = expand_func(word_stripped) + assert ( + word_expanded is not None + ), "Cannot determine the value of the variable: {}.".format(word) + + # enclose with quotes if expanded var is a string and is expression sans curly braces + if isinstance(word_expanded, str) and word[1] != "{": + word_expanded = '"' + word_expanded + '"' + else: + word_expanded = str(word_expanded) + + expr = re.sub( + r"(\$\b" + word_stripped + r"\b|\$\{" + word_stripped + r"\})", + word_expanded, + expr, + ) + + return expr + + @staticmethod + def _is_guarded_dict(data_dict): + """Returns true if all the keys of a dictionary are logical expressions, i.e., guards. + + Parameters + ---------- + data_dict: dict + A dictionary where the keys may be logical expressions (of type string) + + Example + ------- + >>> ParamGen._is_guarded_dict({True: 'x', 'False': 'y'}) + True + >>> ParamGen._is_guarded_dict({ "'tx0.66v1' == 'tx0.66v1'": 'x', False: 'y'}) + True + >>> ParamGen._is_guarded_dict({'i':'x', 'j':'y'}) + False + """ + if not isinstance(data_dict, dict): + return False + + keys_logical = [is_logical_expr(str(key)) for key in data_dict] + if all(keys_logical): + return True + if any(keys_logical): + raise RuntimeError( + "Only subset of the following are guarded entries, i.e., logical " + + "expressions as keys:\n\t" + + str(data_dict) + ) + return False + + def _impose_guards(self, data_dict): + + """Given a data_dict with guarded entries, evaluates the guards and returns the entry whose guard (key) + evaluates to True. If multiple guards evaluate to true, the first or the last entry with the True guard is + returned, depending on the "match" arg passed to ParamGen initializer. This method is intended to be called + from _reduce_recursive only. + + Parameters + ---------- + data_dict: dict + A dictionary whose keys are all logical expressions, i.e., guards. + + Example + ------- + >>> obj = ParamGen({1>2: 'a', 3>2: 'b'}) + >>> new_data = obj._impose_guards(obj.data) + >>> new_data + 'b' + """ + + def _eval_guard(guard): + """returns true if a guard evaluates to true.""" + assert isinstance( + guard, str + ), "Expression passed to _eval_guard must be string." + + if has_unexpanded_var(guard): + raise RuntimeError( + "The guard " + + guard + + " has an expandable variable ($var) " + + "that's not expanded yet. All variables must already be expanded before " + + "guards can be evaluated." + ) + + guard_evaluated = eval_formula(guard) + assert isinstance(guard_evaluated, bool), "Guard is not boolean: {}".format( + guard + ) + return guard_evaluated + + if not ParamGen._is_guarded_dict(data_dict): + return data_dict + + guards_eval_true = [] # list of guards that evaluate to true. + for guard in data_dict: + if guard == "else" or _eval_guard(str(guard)) is True: + guards_eval_true.append(guard) + + if len(guards_eval_true) > 1 and "else" in guards_eval_true: + guards_eval_true.remove("else") + elif len(guards_eval_true) == 0: + return None + + if self._match == "first": + return data_dict[guards_eval_true[0]] + if self._match == "last": + return data_dict[guards_eval_true[-1]] + raise RuntimeError("Unknown match option.") + + def _reduce_recursive(self, data_dict, expand_func=None): + + """A recursive method to reduce a given data_dict. This method is intended to be called by the reduce method + only. Check the docstring of the reduce method for more information.""" + + # (1) Expand variables in keys, .e.g, "$OCN_GRID" to "gx1v7": + def _expand_vars_in_keys(data_dict): + if expand_func is not None: + new_data_dict = {} + for key in data_dict: + new_key = key + if has_unexpanded_var(key): + new_key = ParamGen._expand_vars(key, expand_func) + new_data_dict[new_key] = data_dict[key] + return new_data_dict + return data_dict + + data_dict = _expand_vars_in_keys(data_dict) + + # (2) Evaluate the keys if they are all logical expressions, i.e., guards. + # Pick the value of the first or last key evaluating to True and drop everything else. + while ParamGen._is_guarded_dict(data_dict): + data_dict = self._impose_guards(data_dict) + if isinstance(data_dict, dict): + data_dict = _expand_vars_in_keys(data_dict) + + # If the data_dict is reduced to a string, expand vars and eval formulas as a last step. + if isinstance(data_dict, str): + + # (3) Expand variables in values, .e.g, "$OCN_GRID" to "gx1v7": + data_dict = ParamGen._expand_vars(data_dict, expand_func) + + # (4) Evaluate the formulas as values, e.g., "= 3+4", "= [i for i in range(5)]", etc. + if is_formula(data_dict): + data_dict = eval_formula(data_dict.strip()[1:]) + + # Continue reducing the data if it is still a dictionary (nested or not). + elif isinstance(data_dict, dict): + + # (3) Expand variables in values, .e.g, "$OCN_GRID" to "gx1v7": + for key, val in data_dict.copy().items(): + if isinstance(val, str): + data_dict[key] = ParamGen._expand_vars(val, expand_func) + + # (4) Evaluate the formulas as values, e.g., "= 3+4", "= [i for i in range(5)]", etc. + for key, val in data_dict.copy().items(): + if is_formula(val): + data_dict[key] = eval_formula(val.strip()[1:]) + + # (5) Recursively call _reduce_recursive for the remaining nested dicts before returning + keys_of_nested_dicts = [] # i.e., keys of values that are of type dict + for key, val in data_dict.items(): + if isinstance(val, dict): + keys_of_nested_dicts.append(key) + for key in keys_of_nested_dicts: + data_dict[key] = self._reduce_recursive(data_dict[key], expand_func) + + return data_dict + + def reduce(self, expand_func=None): + """ + Reduces the data of a ParamGen instances by recursively expanding its variables, + imposing conditional guards, and evaluating the formulas in values to determine + the final values of parameters. + + Parameters + ---------- + expand_func: (optional) + a callable objects that can return the value of any expandable variable specified." + + Example + ------- + >>> obj = ParamGen({1>2: 'a', 3>2: 'b'}) + >>> obj.reduce() + >>> obj.data + 'b' + """ + + assert ( + callable(expand_func) or expand_func is None + ), "expand_func argument must be a function" + assert not self.reduced, "ParamGen data already reduced." + assert not self.is_empty, "Empty ParamGen data." + + self._data = self._reduce_recursive(self._data, expand_func) + self._reduced = True + + def append(self, pg_obj): + """Adds the data of a given ParamGen instance to the self data. If a data entry already exists in self, + the value is overriden. Otherwise, the new data entry is simply added to self. + + Parameters + ---------- + pg_obj: ParamGen object + A ParamGen instance whose data is to be appended to the self data + + Example + ------- + >>> obj1 = ParamGen({'a':1, 'b':2}) + >>> obj2 = ParamGen({'b':3, 'c':4}) + >>> obj1.append(obj2) + >>> obj1.data + {'a': 1, 'b': 3, 'c': 4} + """ + + assert isinstance(pg_obj, ParamGen), "can only append ParamGen to Paramgen" + assert ( + self.reduced == pg_obj.reduced + ), "Cannot append reduced ParamGen instance to unreduced, and vice versa." + + def _append_recursive(old_dict, new_dict): + for key, val in new_dict.items(): + if key in old_dict: + old_val = old_dict[key] + if isinstance(val, dict) and isinstance(old_val, dict): + _append_recursive(old_dict[key], new_dict[key]) + else: + old_dict[key] = new_dict[key] + else: + old_dict[key] = new_dict[key] + + _append_recursive(self._data, pg_obj._data) + + def reset(self): + """Resets the ParamGen object to its initial state, i.e., undoes the reduce method. + + Example + ------- + >>> obj = ParamGen({True:1, False:0}) + >>> obj.reduce() + >>> obj.data + 1 + >>> obj.reset() + >>> obj.data + {True: 1, False: 0} + """ + self._data = deepcopy(self._original_data) + self._reduced = False + + def write_nml(self, output_path): + """Writes the reduced data in Fortran namelist format if the data conforms to the format. + + Parameters + ---------- + output_path: str object + Path to the namelist file to be created. + """ + + assert ( + self._reduced + ), "The data may be written only after the reduce method is called." + + # check *schema* after reduction + for grp, var in self.data.items(): + # grp is the namelist module name, while var is a dictionary corresponding to the vars in namelist + assert isinstance(grp, str), "Invalid data format" + assert isinstance(var, dict), "Invalid data format" + for vls in var.values(): + # vnm is the var name, and vls is its values element + assert isinstance(vls, dict), "Invalid data format" + for val in vls: + # val is a value in the values dict + assert isinstance(val, str), "Invalid data format" + + # write the namelist file + with open(output_path, "w") as nml: + for module in self._data: + nml.write("&{}\n".format(module)) + for var in self._data[module]: + val = str(self._data[module][var]["values"]).strip() + if val is not None: + nml.write(" {} = {}\n".format(var, val)) + nml.write("/\n\n") diff --git a/cime_config/paramgen_utils.py b/cime_config/paramgen_utils.py new file mode 100644 index 00000000..19e44fd5 --- /dev/null +++ b/cime_config/paramgen_utils.py @@ -0,0 +1,233 @@ +"""Auxiliary functions to be used in ParamGen and derived classes""" + +import re + + +def is_number(var): + """ + Returns True if the passed var (of type string) is a number. Returns + False if var is not a string or if it is not a number. + This function is an alternative to isnumeric(), which can't handle + scientific notation. + + Parameters + ---------- + var: str + variable to check whether number or not + Returns + ------- + True or False + + Example + ------- + >>> "1e-6".isnumeric() + False + >>> is_number("1e-6") and is_number(1) and is_number(3.14) + True + >>> is_number([1,2]) or is_number("hello") + False + """ + try: + float(var) + except ValueError: + return False + except TypeError: + return False + return True + + +def is_logical_expr(expr): + """ + Returns True if a string is a logical expression. + + Please note that fortran array syntax allows for + the use of parantheses and colons in namelist + variable names, which "eval" counts as a syntax error. + + Parameters + ---------- + expr: str + expression to check whether logical or not + Returns + ------- + True or False + + Example + ------- + >>> is_logical_expr("0 > 1000") + True + >>> is_logical_expr("3+4") + False + """ + + assert isinstance( + expr, str + ), "Expression passed to is_logical_expr function must be a string." + + # special case: + if expr.strip() == "else": + return True + + try: + return isinstance(eval(expr), bool) + except (NameError, SyntaxError): + return False + + +def is_formula(expr): + """ + Returns True if expr is a ParamGen formula to evaluate. This is determined by + checking whether expr is a string with a length of 1 or greater and if the + first character of expr is '='. + + Parameters + ---------- + expr: str + expression to check whether formula or not + Returns + ------- + True or False + + Example + ------- + >>> is_formula("3*5") + False + >>> is_formula("= 3*5") + True + """ + + return isinstance(expr, str) and len(expr) > 0 and expr.strip()[0] == "=" + + +def has_unexpanded_var(expr): + """ + Checks if a given expression has an expandable variable, e.g., $OCN_GRID, + that's not expanded yet. + + Parameters + ---------- + expr: str + expression to check + Returns + ------- + True or False + + Example + ------- + >>> has_unexpanded_var("${OCN_GRID} == tx0.66v1") + True + """ + + return isinstance(expr, str) and bool(re.search(r"(\$\w+|\${\w+\})", expr)) + + +def get_expandable_vars(expr): + """ + Returns the set of expandable vars from an expression. + + Parameters + ---------- + expr: str + expression to look for + Returns + ------- + a set of strings containing the expandable var names. + + Example + ------- + >>> get_expandable_vars("var1 $var2") + {'var2'} + >>> get_expandable_vars("var3 ${var4}") + {'var4'} + """ + expandable_vars = re.findall(r"(\$\w+|\${\w+\})", expr) + expandable_vars_stripped = set() + for var in expandable_vars: + var_stripped = var.strip().replace("$", "").replace("{", "").replace("}", "") + expandable_vars_stripped.add(var_stripped) + return expandable_vars_stripped + + +def _check_comparison_types(formula): + """ + A check to detect the comparison of different data types. This function + replaces equality comparisons with order comparisons to check whether + any variables of different types are compared. From Python 3.6 documentation: + A default order comparison (<, >, <=, and >=) is not provided; an attempt + raises TypeError. A motivation for this default behavior is the lack of a + similar invariant as for equality. + + Parameters + ---------- + formula: str + formula to check if it includes comparisons of different data types + Returns + ------- + True (or raises TypeError) + + Example + ------- + >>> _check_comparison_types("3.1 > 3") + True + >>> _check_comparison_types("'3.1' == 3.1") + Traceback (most recent call last): + ... + TypeError: The following formula may be comparing different types of variables: '3.1' == 3.1 + """ + guard_test = formula.replace("==", ">").replace("!=", ">").replace("<>", ">") + try: + eval(guard_test) + except TypeError as type_error: + raise TypeError( + "The following formula may be comparing different types of variables: {}".format( + formula + ) + ) from type_error + return True + + +def eval_formula(formula): + """ + This function evaluates a given formula and returns the result. It also + carries out several sanity checks before evaluation. + + Parameters + ---------- + formula: str + formula to evaluate + Returns + ------- + eval(formula) + + Example + ------- + >>> eval_formula("3*5") + 15 + >>> eval_formula("'tx0.66v1' != 'gx1v6'") + True + >>> eval_formula('$OCN_GRID != "gx1v6"') + Traceback (most recent call last): + ... + AssertionError + """ + + # make sure no expandable var exists in the formula. (They must already + # be expanded before this function is called.) + assert not has_unexpanded_var(formula) + + # Check whether any different data types are being compared + _check_comparison_types(formula) + + # now try to evaluate the formula: + try: + result = eval(formula) + except (TypeError, NameError, SyntaxError) as error: + raise RuntimeError("Cannot evaluate formula: " + formula) from error + + return result + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/cime_config/xml_schema/entry_id_pg.xsd b/cime_config/xml_schema/entry_id_pg.xsd new file mode 100644 index 00000000..4142a179 --- /dev/null +++ b/cime_config/xml_schema/entry_id_pg.xsd @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 50941e93f32753b65e668a4ef336d6613a2b37cc Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 7 Aug 2023 14:06:43 +0200 Subject: [PATCH 19/33] updates to get paramgen working --- cime_config/{ => ParamGen}/README.ipynb | 0 cime_config/{ => ParamGen}/XML_NML.ipynb | 0 cime_config/{ => ParamGen}/paramgen.py | 0 cime_config/{ => ParamGen}/paramgen_utils.py | 0 .../{ => ParamGen}/xml_schema/entry_id_pg.xsd | 0 cime_config/ocn_in_paramgen.py | 25 ++++++------------- 6 files changed, 8 insertions(+), 17 deletions(-) rename cime_config/{ => ParamGen}/README.ipynb (100%) rename cime_config/{ => ParamGen}/XML_NML.ipynb (100%) rename cime_config/{ => ParamGen}/paramgen.py (100%) rename cime_config/{ => ParamGen}/paramgen_utils.py (100%) rename cime_config/{ => ParamGen}/xml_schema/entry_id_pg.xsd (100%) diff --git a/cime_config/README.ipynb b/cime_config/ParamGen/README.ipynb similarity index 100% rename from cime_config/README.ipynb rename to cime_config/ParamGen/README.ipynb diff --git a/cime_config/XML_NML.ipynb b/cime_config/ParamGen/XML_NML.ipynb similarity index 100% rename from cime_config/XML_NML.ipynb rename to cime_config/ParamGen/XML_NML.ipynb diff --git a/cime_config/paramgen.py b/cime_config/ParamGen/paramgen.py similarity index 100% rename from cime_config/paramgen.py rename to cime_config/ParamGen/paramgen.py diff --git a/cime_config/paramgen_utils.py b/cime_config/ParamGen/paramgen_utils.py similarity index 100% rename from cime_config/paramgen_utils.py rename to cime_config/ParamGen/paramgen_utils.py diff --git a/cime_config/xml_schema/entry_id_pg.xsd b/cime_config/ParamGen/xml_schema/entry_id_pg.xsd similarity index 100% rename from cime_config/xml_schema/entry_id_pg.xsd rename to cime_config/ParamGen/xml_schema/entry_id_pg.xsd diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index a30ed5f3..e2400c2d 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -1,8 +1,6 @@ """ -Wrapper-class for the ParamGen -CIME tool, and associated methods -needed to generated the "ocn_in" -Fortran namelist file. +Wrapper-class for the BLOM ParamGen tool, and associated methods +needed to generated the "ocn_in" Fortran namelist file. To run doctests on this file: python -m doctest ocn_in_paramgen.py """ @@ -21,17 +19,10 @@ # Import ParamGen #---------------- -_CIME_ROOT = os.environ.get("CIMEROOT") -if _CIME_ROOT is None: - raise SystemExit("ERROR: must set CIMEROOT environment variable") -sys.path.append(os.path.join(_CIME_ROOT, "CIME", "Tools")) - -#_PARAMGEN_ROOT = os.path.join(_CIME_ROOT, "CIME", "ParamGen") -# if not os.path.exists(_PARAMGEN_ROOT): -# _EMSG = f"ERROR: Cannot find '{_PARAMGEN_ROOT}' directory. Did you run checkout_externals?" -# raise SystemExit(_EMSG) -#End if -#sys.path.append(_PARAMGEN_ROOT) +file_path = os.path.abspath(__file__) +directory = os.path.dirname(file_path) +print (f"DEBUG: directory dir is {directory}") +sys.path.append(os.path.join(directory, "ParamGen")) #pylint: disable=wrong-import-position from paramgen import ParamGen #pylint: enable=wrong-import-position @@ -1662,7 +1653,7 @@ def reduce_ocn_in(self, case, ocn_attr_dict): Reduce XML namelist attributes (i.e. replace attribute/guard dictionary with value) ---------- - case -> CIME case object + case -> dictionary replicating a case object ocn_attr_dict -> dictionary containing attribute values """ @@ -1684,7 +1675,7 @@ def __expand_func(self, varname): their associated values. """ - #Check if varname matches a CIME case variable: + #Check if varname matches a case dictionary variable: val = self.__case.get_value(varname) #If not, then attempt to extract variable from From aa66f87ecc59984bd5dc8d815903b74d6291a681 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Thu, 10 Aug 2023 11:49:32 +0200 Subject: [PATCH 20/33] merge to #PR 261 and creation of new namelist bgcparams --- cime_config/buildnml | 8 + cime_config/buildnml.csh | 1674 ---------------------- cime_config/namelist_definition_blom.xml | 284 ++++ cime_config/ocn_in.readme | 4 +- cime_config/ocn_in_paramgen.py | 1 - 5 files changed, 294 insertions(+), 1677 deletions(-) delete mode 100644 cime_config/buildnml.csh diff --git a/cime_config/buildnml b/cime_config/buildnml index 34380183..78763719 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -173,11 +173,18 @@ def buildnml(case, caseroot, compname): config["hamocc_sedspinup_yr_end"] = hamocc_sedspinup_yr_end config["hamocc_sedspinup_ncycle"] = hamocc_sedspinup_ncycle config["is_test"] = "yes" if is_test else "no" + + # TODO: the following needs to have new ways to turn this to "yes" + config["use_agg"] = "no" + config["use_wlin"] = "yes" + if is_test: testcase = case.get_value("TESTCASE") config["is_test_pfs"] = "yes" if testcase == "PFS" else "no" config["empty_hist"] = "yes" if testcase == "PFS" else "no" + + #--------------------------------- # Set all ParamGen namelist values: #--------------------------------- @@ -232,6 +239,7 @@ def buildnml(case, caseroot, compname): groups.append("bgcnml") groups.append("bgcoafx") groups.append("diabgc") + groups.append("bgcparams") pg_blom.write_nmlfile(namelist_file, groups) diff --git a/cime_config/buildnml.csh b/cime_config/buildnml.csh deleted file mode 100644 index caf1f533..00000000 --- a/cime_config/buildnml.csh +++ /dev/null @@ -1,1674 +0,0 @@ -#! /bin/csh -f - -#------------------------------------------------------------------------------ -# Get variables from Case XML-files -#------------------------------------------------------------------------------ - -set CASEROOT = `./xmlquery CASEROOT --value` -set OCN_GRID = `./xmlquery OCN_GRID --value` -set BLOM_VCOORD = `./xmlquery BLOM_VCOORD --value` -set BLOM_UNIT = `./xmlquery BLOM_UNIT --value` -set DIN_LOC_ROOT = `./xmlquery DIN_LOC_ROOT --value` -set RUN_TYPE = `./xmlquery RUN_TYPE --value` -set CONTINUE_RUN = `./xmlquery CONTINUE_RUN --value` -set CASEBUILD = `./xmlquery CASEBUILD --value` -set CCSM_CO2_PPMV = `./xmlquery CCSM_CO2_PPMV --value` -set OCN_NCPL = `./xmlquery OCN_NCPL --value` -set BLOM_COUPLING = `./xmlquery BLOM_COUPLING --value` -set RUNDIR = `./xmlquery RUNDIR --value` -set BLOM_TRACER_MODULES = `./xmlquery BLOM_TRACER_MODULES --value` -set BLOM_RIVER_NUTRIENTS = `./xmlquery BLOM_RIVER_NUTRIENTS --value` -set BLOM_N_DEPOSITION = `./xmlquery BLOM_N_DEPOSITION --value` -set BLOM_NDEP_SCENARIO = `./xmlquery BLOM_NDEP_SCENARIO --value` -set HAMOCC_VSLS = `./xmlquery HAMOCC_VSLS --value` -set HAMOCC_CISO = `./xmlquery HAMOCC_CISO --value` -set HAMOCC_SEDSPINUP = `./xmlquery HAMOCC_SEDSPINUP --value` -set HAMOCC_SEDSPINUP_YR_START = `./xmlquery HAMOCC_SEDSPINUP_YR_START --value` -set HAMOCC_SEDSPINUP_YR_END = `./xmlquery HAMOCC_SEDSPINUP_YR_END --value` -set HAMOCC_SEDSPINUP_NCYCLE = `./xmlquery HAMOCC_SEDSPINUP_NCYCLE --value` -set RUN_STARTDATE = `./xmlquery RUN_STARTDATE --value` -set PIO_TYPENAME_OCN = `./xmlquery PIO_TYPENAME_OCN --value` -set PIO_NETCDF_FORMAT_OCN = `./xmlquery PIO_NETCDF_FORMAT_OCN --value` -set NINST_OCN = `./xmlquery NINST_OCN --value` -set TEST=`./xmlquery TEST --value` - -#------------------------------------------------------------------------------ -# Check if HAMOCC is requested -#------------------------------------------------------------------------------ - -set ecosys = FALSE -set tracers = (`echo $BLOM_TRACER_MODULES`) -if ($#tracers != 0) then - foreach module ($tracers) - if ($module == ecosys) then - set ecosys = TRUE - endif - end -endif - -#------------------------------------------------------------------------------ -# Set RUN_TYPE to 'continue' if CONTINUE_RUN equals TRUE -#------------------------------------------------------------------------------ - -if ("$CONTINUE_RUN" == TRUE) then - set RUN_TYPE = continue -endif - -#------------------------------------------------------------------------------ -# Get start date -#------------------------------------------------------------------------------ - -set YEAR0 = `echo $RUN_STARTDATE | cut -c1-4 ` -set MONTH0 = `echo $RUN_STARTDATE | cut -c6-7 ` -set DAY0 = `echo $RUN_STARTDATE | cut -c9-10` - -#------------------------------------------------------------------------------ -# Set namelist variables -#------------------------------------------------------------------------------ - -#------------------------------ -# set LIMITS defaults -#------------------------------ -set NDAY1 = 0 -set NDAY2 = 0 -set IDATE = $YEAR0$MONTH0$DAY0 -set IDATE0 = $YEAR0$MONTH0$DAY0 -set RUNID = "'unset'" -set EXPCNF = "'cesm'" -set RUNTYP = "'$RUN_TYPE'" -set GRFILE = "'unset'" -set ICFILE = "'unset'" -if ("$BLOM_UNIT" == cgs) then - set PREF = 2000.e5 -else - set PREF = 2000.e4 -endif -set BACLIN = 1800. -set BATROP = 36. -if ("$BLOM_UNIT" == cgs) then - set MDV2HI = 2. - set MDV2LO = .4 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 5000.e4 - set MDC2LO = 300.e4 -else - set MDV2HI = .02 - set MDV2LO = .004 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 5000. - set MDC2LO = 300. -endif -set VSC2HI = .5 -set VSC2LO = .5 -set VSC4HI = 0. -set VSC4LO = 0. -if ("$BLOM_UNIT" == cgs) then - set CBAR = 5. -else - set CBAR = .05 -endif -set CB = .002 -set CWBDTS = 5.e-5 -set CWBDLS = 25. -set MOMMTH = "'enscon'" -set BMCMTH = "'uc'" -set RMPMTH = "'eitvel'" -set MLRTTP = "'constant'" -set RM0 = 1.2 -set RM5 = 0. -set CE = .06 -set TDFILE = "'unset'" -set NIWGF = 0. -set NIWBF = .35 -set NIWLF = .5 -set SWAMTH = "'jerlov'" -set JWTYPE = 3 -set CHLOPT = "'climatology'" -set CCFILE = "'unset'" -set TRXDAY = 0. -set SRXDAY = 0. -set TRXDPT = 1. -set SRXDPT = 1. -set TRXLIM = 1.5 -set SRXLIM = .5 -set APTFLX = .false. -set APSFLX = .false. -set DITFLX = .false. -set DISFLX = .false. -set SRXBAL = .false. -set SCFILE = "'unset'" -set WAVSRC = "'none'" -set SMTFRC = .true. -set SPRFAC = .false. -set ATM_PATH = "'unset'" -set ITEST = 60 -set JTEST = 60 -set CNSVDI = .false. -set CSDIAG = .false. -set RSTFRQ = 1 -if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then - set RSTFMT = 1 -else - set RSTFMT = 0 -endif -set RSTCMP = 0 -if ("$PIO_TYPENAME_OCN" == pnetcdf) then - set IOTYPE = 1 -else - set IOTYPE = 0 -endif - -#------------------------------ -# set VCOORD defaults -#------------------------------ -set VCOORD_TYPE = "'$BLOM_VCOORD'" -set RECONSTRUCTION_METHOD = "'ppm'" -set DENSITY_LIMITING = "'monotonic'" -set TRACER_LIMITING = "'non_oscillatory'" -set VELOCITY_LIMITING = "'non_oscillatory'" -set DENSITY_PC_UPPER_BNDR = .false. -set DENSITY_PC_LOWER_BNDR = .false. -set TRACER_PC_UPPER_BNDR = .true. -set TRACER_PC_LOWER_BNDR = .false. -set VELOCITY_PC_UPPER_BNDR = .true. -set VELOCITY_PC_LOWER_BNDR = .false. -set DPMIN_SURFACE = 2.5 -set DPMIN_INFLATION_FACTOR = 1.08 -set DPMIN_INTERIOR = .1 -set DKTZU = 4 -set DKTZL = 1 - -#------------------------------ -# set DIFFUSION defaults -#------------------------------ -set EITMTH = "'gm'" -set EDRITP = "'large scale'" -set EDWMTH = "'smooth'" -set EDDF2D = .false. -set EDSPRS = .true. -set EGC = 0.85 -set EGGAM = 200. -if ("$BLOM_UNIT" == cgs) then - set EGLSMN = 4000.e2 - set EGMNDF = 100.e4 - set EGMXDF = 1500.e4 -else - set EGLSMN = 4000. - set EGMNDF = 100. - set EGMXDF = 1500. -endif -set EGIDFQ = 1. -set TBFILE = "'unset'" -set RHISCF = 0. -set EDANIS = .false. -set REDI3D = .false. -set RHSCTP = .false. -set RI0 = 1.2 -set BDMTYP = 2 -if ("$BLOM_UNIT" == cgs) then - set BDMC1 = 5.e-4 - set BDMC2 = .1 -else - set BDMC1 = 5.e-8 - set BDMC2 = 1.e-5 -endif -set TKEPF = .006 -set SMOBLD = .true. -set LNGMTP = "'none'" -if ("$BLOM_VCOORD" == isopyc_bulkml) then - set BDMLDP = .true. - set LTEDTP = "'layer'" -else - set BDMLDP = .false. - set LTEDTP = "'neutral'" -endif - -#------------------------------ -# set BGCNML defaults -#------------------------------ -set ATM_CO2 = "$CCSM_CO2_PPMV" -if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set DO_RIVINPT = .true. -else - set DO_RIVINPT = .false. -endif -if ("$BLOM_N_DEPOSITION" == TRUE) then - set DO_NDEP = .true. - if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx2v1) then - set NDEPFNAME = ndep_1850_CMIP6_tnx2v1_20180321.nc - else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_1850_CMIP6_tnx1v4_20171106.nc - else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx0.25v4) then - set NDEPFNAME = ndep_1850_CMIP6_tnx0.25v4_20190912.nc - else if( "$BLOM_NDEP_SCENARIO" == 1850 && "$OCN_GRID" == tnx0.125v4) then - set NDEPFNAME = ndep_1850_CMIP6_tnx0.125v4_20221013.nc - else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx2v1) then - set NDEPFNAME = ndep_2000_CMIP6_tnx2v1_20200826.nc - else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_2000_CMIP6_tnx1v4_20200826.nc - else if( "$BLOM_NDEP_SCENARIO" == 2000 && "$OCN_GRID" == tnx0.25v4) then - set NDEPFNAME = ndep_2000_CMIP6_tnx0.25v4_20200826.nc - else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx2v1) then - set NDEPFNAME = ndep_185001-201412_tnx2v1_20190702.nc - else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_185001-201412_tnx1v4_20180613.nc - else if( "$BLOM_NDEP_SCENARIO" == hist && "$OCN_GRID" == tnx0.25v4) then - set NDEPFNAME = ndep_185001-201412_tnx0.25v4_20190705.nc - else if( `echo $BLOM_NDEP_SCENARIO | cut -c1-3` == ssp && "$OCN_GRID" == tnx1v4) then - set NDEPFNAME = ndep_201501-210012-${BLOM_NDEP_SCENARIO}_tnx1v4_20191112.nc - else if( "$BLOM_NDEP_SCENARIO" == UNSET ) then - set DO_NDEP = .false. - set NDEPFNAME = "''" - endif -else - set DO_NDEP = .false. - set NDEPFNAME = "''" -endif -if ("$HAMOCC_SEDSPINUP" == TRUE) then - set DO_SEDSPINUP = .true. - set SEDSPIN_YR_S = $HAMOCC_SEDSPINUP_YR_START - set SEDSPIN_YR_E = $HAMOCC_SEDSPINUP_YR_END - set SEDSPIN_NCYC = $HAMOCC_SEDSPINUP_NCYCLE -else - set DO_SEDSPINUP = .false. - set SEDSPIN_YR_S = -1 - set SEDSPIN_YR_E = -1 - set SEDSPIN_NCYC = -1 -endif -# VSLS is currently only available for the tnx1v4 grid, since a climatlogy file for -# short wave radiation is needed. -if ("$HAMOCC_VSLS" == TRUE && "$OCN_GRID" != tnx1v4) then - echo "$0 ERROR: HAMOCC_VSLS == TRUE not possible with this grid resolution (no swa-climatology available) " - exit -1 -endif -# For the following options, there are currently no switches in Case-XML files. -# These options can be activated by expert users via user namelist. -set DO_OALK = .false. -set BGCOAFX_OALKSCEN = "''" -set BGCOAFX_OALKFILE = "''" -set BGCOAFX_ADDALK = 0.135 -set BGCOAFX_CDRMIP_LATMAX = 70.0 -set BGCOAFX_CDRMIP_LATMIN = -60.0 -set BGCOAFX_RAMP_START = 2025 -set BGCOAFX_RAMP_END = 2035 -set WITH_DMSPH = .false. -set PI_PH_FILE = "''" -set L_3DVARSEDPOR = .false. -set SEDPORFILE = "''" - - -#------------------------------ -# set DIAPHY defaults -#------------------------------ -set GLB_FNAMETAG = "'hd','hm','hy'" -set GLB_AVEPERIO = '1, 30, 365' -if ("$TEST" == TRUE) then - set GLB_FILEFREQ = '1, 30, 365' -else - set GLB_FILEFREQ = '30, 30, 365' -endif -set GLB_COMPFLAG = '0, 0, 0' -if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then - set GLB_NCFORMAT = '1, 1, 1' -else - set GLB_NCFORMAT = '0, 0, 0' -endif -set H2D_ABSWND = '0, 4, 0' - -set H2D_ALB = '0, 0, 0' - -set H2D_BTMSTR = '0, 4, 0' -set H2D_BRNFLX = '0, 4, 0' -set H2D_BRNPD = '0, 4, 0' - -set H2D_DFL = '0, 0, 0' - -set H2D_EVA = '0, 4, 0' -set H2D_FICE = '0, 4, 0' -set H2D_FMLTFZ = '0, 4, 0' - -set H2D_HICE = '0, 0, 0' - -set H2D_HMLTFZ = '0, 4, 0' - -set H2D_HSNW = '0, 0, 0' -set H2D_IAGE = '0, 0, 0' - -set H2D_IDKEDT = '0, 4, 0' -set H2D_LAMULT = '0, 4, 0' -set H2D_LASL = '0, 4, 0' -set H2D_LIP = '0, 4, 0' - -set H2D_MAXMLD = '4, 4, 0' - -set H2D_MLD = '0, 4, 0' - -set H2D_MLTS = '4, 4, 0' - -set H2D_MLTSMN = '0, 4, 0' -set H2D_MLTSMX = '0, 4, 0' -set H2D_MLTSSQ = '0, 4, 0' -set H2D_MTKEUS = '0, 4, 0' -set H2D_MTKENI = '0, 4, 0' -set H2D_MTKEBF = '0, 4, 0' -set H2D_MTKERS = '0, 4, 0' -set H2D_MTKEPE = '0, 4, 0' -set H2D_MTKEKE = '0, 4, 0' -set H2D_MTY = '0, 4, 0' -set H2D_NSF = '0, 4, 0' -set H2D_PBOT = '0, 4, 0' -set H2D_PSRF = '0, 4, 0' -set H2D_RFIFLX = '0, 4, 0' -set H2D_RNFFLX = '0, 4, 0' -set H2D_SALFLX = '0, 4, 0' -set H2D_SALRLX = '0, 4, 0' -set H2D_SBOT = '0, 4, 0' - -set H2D_SEALV = '4, 4, 0' - -set H2D_SLVSQ = '0, 4, 0' -set H2D_SFL = '0, 4, 0' -set H2D_SOP = '0, 4, 0' -set H2D_SIGMX = '0, 4, 0' - -set H2D_SSS = '4, 4, 0' -set H2D_SSSSQ = '4, 4, 0' -set H2D_SST = '4, 4, 0' -set H2D_SSTSQ = '4, 4, 0' - -set H2D_SURFLX = '0, 4, 0' -set H2D_SURRLX = '0, 4, 0' -set H2D_SWA = '0, 4, 0' - -set H2D_T20D = '4, 4, 0' - -set H2D_TAUX = '0, 4, 0' -set H2D_TAUY = '0, 4, 0' -set H2D_TBOT = '0, 4, 0' - -set H2D_TICE = '0, 0, 0' -set H2D_TSRF = '0, 0, 0' - -set H2D_UB = '0, 4, 0' - -set H2D_UICE = '0, 0, 0' - -set H2D_USTAR = '0, 4, 0' -set H2D_USTAR3 = '0, 4, 0' - -set H2D_USTOKES = '0, 0, 0' - -set H2D_VB = '0, 4, 0' - -set H2D_VICE = '0, 0, 0' -set H2D_VSTOKES = '0, 0, 0' - -set H2D_ZTX = '0, 4, 0' -set LYR_BFSQ = '0, 4, 0' -set LYR_DIFDIA = '0, 4, 0' -set LYR_DIFVMO = '0, 4, 0' -set LYR_DIFVHO = '0, 4, 0' -set LYR_DIFVSO = '0, 4, 0' -set LYR_DIFINT = '0, 4, 0' -set LYR_DIFISO = '0, 4, 0' -set LYR_DP = '0, 4, 0' -set LYR_DZ = '0, 4, 0' -set LYR_SALN = '0, 4, 0' -set LYR_TEMP = '0, 4, 0' - -set LYR_TRC = '0, 0, 0' - -set LYR_UFLX = '0, 4, 0' -set LYR_UTFLX = '0, 4, 0' -set LYR_USFLX = '0, 4, 0' - -set LYR_UMFLTD = '0, 0, 4' -set LYR_UMFLSM = '0, 0, 4' -set LYR_UTFLTD = '0, 0, 4' -set LYR_UTFLSM = '0, 0, 4' -set LYR_UTFLLD = '0, 0, 4' -set LYR_USFLTD = '0, 0, 4' -set LYR_USFLSM = '0, 0, 4' -set LYR_USFLLD = '0, 0, 4' - -set LYR_UVEL = '0, 4, 0' -set LYR_VFLX = '0, 4, 0' -set LYR_VTFLX = '0, 4, 0' -set LYR_VSFLX = '0, 4, 0' - -set LYR_VMFLTD = '0, 0, 4' -set LYR_VMFLSM = '0, 0, 4' -set LYR_VTFLTD = '0, 0, 4' -set LYR_VTFLSM = '0, 0, 4' -set LYR_VTFLLD = '0, 0, 4' -set LYR_VSFLTD = '0, 0, 4' -set LYR_VSFLSM = '0, 0, 4' -set LYR_VSFLLD = '0, 0, 4' - -set LYR_VVEL = '0, 4, 0' -set LYR_WFLX = '0, 4, 0' -set LYR_WFLX2 = '0, 4, 0' -set LYR_PV = '0, 4, 0' -set LYR_TKE = '0, 4, 0' -set LYR_GLS_PSI = '0, 4, 0' -set LYR_IDLAGE = '0, 4, 0' -set LVL_BFSQ = '0, 4, 0' -set LVL_DIFDIA = '0, 4, 0' -set LVL_DIFVMO = '0, 4, 0' -set LVL_DIFVHO = '0, 4, 0' -set LVL_DIFVSO = '0, 4, 0' -set LVL_DIFINT = '0, 4, 0' -set LVL_DIFISO = '0, 4, 0' -set LVL_DZ = '0, 4, 0' -set LVL_SALN = '0, 4, 0' -set LVL_TEMP = '0, 4, 0' - -set LVL_TRC = '0, 0, 0' - -set LVL_UFLX = '0, 4, 0' -set LVL_UTFLX = '0, 4, 0' -set LVL_USFLX = '0, 4, 0' - -set LVL_UMFLTD = '0, 0, 4' -set LVL_UMFLSM = '0, 0, 4' -set LVL_UTFLTD = '0, 0, 4' -set LVL_UTFLSM = '0, 0, 4' -set LVL_UTFLLD = '0, 0, 4' -set LVL_USFLTD = '0, 0, 4' -set LVL_USFLSM = '0, 0, 4' -set LVL_USFLLD = '0, 0, 4' - -set LVL_UVEL = '0, 4, 0' -set LVL_VFLX = '0, 4, 0' -set LVL_VTFLX = '0, 4, 0' -set LVL_VSFLX = '0, 4, 0' - -set LVL_VMFLTD = '0, 0, 4' -set LVL_VMFLSM = '0, 0, 4' -set LVL_VTFLTD = '0, 0, 4' -set LVL_VTFLSM = '0, 0, 4' -set LVL_VTFLLD = '0, 0, 4' -set LVL_VSFLTD = '0, 0, 4' -set LVL_VSFLSM = '0, 0, 4' -set LVL_VSFLLD = '0, 0, 4' - -set LVL_VVEL = '0, 4, 0' -set LVL_WFLX = '0, 4, 0' -set LVL_WFLX2 = '0, 4, 0' -set LVL_PV = '0, 4, 0' -set LVL_TKE = '0, 4, 0' -set LVL_GLS_PSI = '0, 4, 0' -set LVL_IDLAGE = '0, 4, 0' -set MSC_MMFLXL = '0, 4, 0' -set MSC_MMFLXD = '0, 4, 0' -set MSC_MMFTDL = '0, 4, 0' -set MSC_MMFSML = '0, 4, 0' -set MSC_MMFTDD = '0, 4, 0' -set MSC_MMFSMD = '0, 4, 0' -set MSC_MHFLX = '0, 4, 0' -set MSC_MHFTD = '0, 4, 0' -set MSC_MHFSM = '0, 4, 0' -set MSC_MHFLD = '0, 4, 0' -set MSC_MSFLX = '0, 4, 0' -set MSC_MSFTD = '0, 4, 0' -set MSC_MSFSM = '0, 4, 0' -set MSC_MSFLD = '0, 4, 0' -set MSC_VOLTR = '0, 4, 0' -set MSC_MASSGS = '0, 4, 0' -set MSC_VOLGS = '0, 4, 0' -set MSC_SALNGA = '0, 4, 0' -set MSC_TEMPGA = '0, 4, 0' -set MSC_SSSGA = '0, 4, 0' -set MSC_SSTGA = '0, 4, 0' - -#------------------------------ -# set DIABGC defaults -#------------------------------ -set BGC_FNAMETAG = "'hbgcd','hbgcm','hbgcy'" -set BGC_AVEPERIO = '1,30,365' -set BGC_FILEFREQ = '30,30,365' -if ("$TEST" == TRUE) then - set BGC_FILEFREQ = ' 1,30,365' -else - set BGC_FILEFREQ = '30,30,365' -endif -set BGC_COMPFLAG = '0, 0, 0' -if ("$PIO_NETCDF_FORMAT_OCN" == 64bit_offset) then - set BGC_NCFORMAT = '1, 1, 1' -else - set BGC_NCFORMAT = '0, 0, 0' -endif -set BGC_INVENTORY = '0, 1, 0' -set SRF_PHOSPH = '0, 2, 2' -set SRF_OXYGEN = '0, 2, 2' -set SRF_IRON = '0, 2, 2' -set SRF_ANO3 = '0, 2, 2' -set SRF_ALKALI = '4, 2, 2' -set SRF_SILICA = '0, 2, 2' -set SRF_DIC = '4, 2, 2' -set SRF_PHYTO = '4, 2, 2' -set SRF_PH = '0, 2, 2' -set SRF_EXPORT = '0, 2, 2' -set SRF_EXPOSI = '0, 2, 2' -set SRF_EXPOCA = '0, 2, 2' -set SRF_KWCO2 = '0, 2, 2' -set SRF_KWCO2KHM = '0, 2, 2' -set SRF_CO2KH = '0, 2, 2' -set SRF_CO2KHM = '0, 2, 2' -set SRF_PCO2 = '0, 2, 2' -set SRF_PCO2M = '0, 2, 2' -set SRF_CO2FXD = '4, 2, 2' -set SRF_CO2FXU = '4, 2, 2' -set SRF_OXFLUX = '0, 2, 2' -set SRF_NIFLUX = '0, 2, 2' -set SRF_N2OFX = '0, 0, 2' -set SRF_DMSFLUX = '0, 2, 2' -set SRF_DMS = '0, 2, 2' -set SRF_DMSPROD = '0, 2, 2' -set SRF_DMS_BAC = '0, 2, 2' -set SRF_DMS_UV = '0, 2, 2' -set SRF_ATMCO2 = '0, 2, 2' -set SRF_ATMO2 = '0, 2, 2' -set SRF_ATMN2 = '0, 2, 2' -set SRF_NATDIC = '0, 2, 2' -set SRF_NATALKALI = '0, 2, 2' -set SRF_NATPH = '0, 2, 2' -set SRF_NATPCO2 = '0, 2, 2' -set SRF_NATCO2FX = '0, 2, 2' -set SRF_CO213FXD = '0, 2, 2' -set SRF_CO213FXU = '0, 2, 2' -set SRF_CO214FXD = '0, 2, 2' -set SRF_CO214FXU = '0, 2, 2' -set SRF_CFC11 = '0, 2, 2' -set SRF_CFC12 = '0, 2, 2' -set SRF_SF6 = '0, 2, 2' -set SRF_BROMO = '0, 2, 2' -set SRF_BROMOFX = '0, 2, 2' -set INT_BROMOPRO = '0, 2, 2' -set INT_BROMOUV = '0, 2, 2' -set INT_PHOSY = '4, 2, 2' -set INT_NFIX = '0, 2, 2' -set INT_DNIT = '0, 2, 2' -if ("$BLOM_N_DEPOSITION" == TRUE) then -set FLX_NDEP = '0, 2, 2' -else -set FLX_NDEP = '0, 0, 0' -endif -set FLX_OALK = '0, 0, 0' -set FLX_CAR0100 = '0, 2, 2' -set FLX_CAR0500 = '0, 2, 2' -set FLX_CAR1000 = '0, 2, 2' -set FLX_CAR2000 = '0, 2, 2' -set FLX_CAR4000 = '0, 2, 2' -set FLX_CAR_BOT = '0, 2, 2' -set FLX_BSI0100 = '0, 2, 2' -set FLX_BSI0500 = '0, 2, 2' -set FLX_BSI1000 = '0, 2, 2' -set FLX_BSI2000 = '0, 2, 2' -set FLX_BSI4000 = '0, 2, 2' -set FLX_BSI_BOT = '0, 2, 2' -set FLX_CAL0100 = '0, 2, 2' -set FLX_CAL0500 = '0, 2, 2' -set FLX_CAL1000 = '0, 2, 2' -set FLX_CAL2000 = '0, 2, 2' -set FLX_CAL4000 = '0, 2, 2' -set FLX_CAL_BOT = '0, 2, 2' -set LYR_PHYTO = '0, 0, 2' -set LYR_GRAZER = '0, 0, 2' -set LYR_DOC = '0, 0, 2' -set LYR_PHOSY = '0, 0, 2' -set LYR_PHOSPH = '0, 0, 2' -set LYR_OXYGEN = '0, 0, 4' -set LYR_IRON = '0, 0, 2' -set LYR_ANO3 = '0, 0, 2' -set LYR_ALKALI = '0, 0, 2' -set LYR_SILICA = '0, 0, 2' -set LYR_DIC = '0, 0, 2' -set LYR_POC = '0, 0, 2' -set LYR_CALC = '0, 0, 2' -set LYR_OPAL = '0, 0, 2' -set LYR_CO3 = '0, 0, 2' -set LYR_N2O = '0, 0, 0' -set LYR_PH = '0, 0, 2' -set LYR_OMEGAC = '0, 0, 2' -set LYR_OMEGAA = '0, 0, 2' -set LYR_PREFO2 = '0, 0, 4' -set LYR_O2SAT = '0, 0, 4' -set LYR_PREFPO4 = '0, 0, 2' -set LYR_PREFALK = '0, 0, 2' -set LYR_PREFDIC = '0, 0, 2' -set LYR_DICSAT = '0, 0, 2' -set LYR_NATDIC = '0, 0, 2' -set LYR_NATALKALI = '0, 0, 2' -set LYR_NATCO3 = '0, 0, 2' -set LYR_NATCALC = '0, 0, 2' -set LYR_NATPH = '0, 0, 2' -set LYR_NATOMEGAC = '0, 0, 2' -set LYR_NATOMEGAA = '0, 0, 2' -set LYR_DIC13 = '0, 0, 2' -set LYR_DIC14 = '0, 0, 2' -set LYR_D13C = '0, 0, 2' -set LYR_D14C = '0, 0, 2' -set LYR_BIGD14C = '0, 0, 2' -set LYR_POC13 = '0, 0, 2' -set LYR_DOC13 = '0, 0, 2' -set LYR_CALC13 = '0, 0, 2' -set LYR_PHYTO13 = '0, 0, 2' -set LYR_GRAZER13 = '0, 0, 2' -set LYR_CFC11 = '0, 0, 2' -set LYR_CFC12 = '0, 0, 2' -set LYR_SF6 = '0, 0, 2' -set LYR_NOS = '0, 0, 2' -set LYR_WPHY = '0, 0, 2' -set LYR_WNOS = '0, 0, 2' -set LYR_EPS = '0, 0, 0' -set LYR_ASIZE = '0, 0, 0' -set LYR_BROMO = '0, 0, 2' -set BGC_DP = '0, 2, 2' -set LVL_PHYTO = '0, 2, 2' -set LVL_GRAZER = '0, 2, 2' -set LVL_DOC = '0, 2, 2' -set LVL_PHOSY = '0, 2, 2' -set LVL_PHOSPH = '0, 2, 2' -set LVL_OXYGEN = '0, 4, 4' -set LVL_IRON = '0, 2, 2' -set LVL_ANO3 = '0, 2, 2' -set LVL_ALKALI = '0, 2, 2' -set LVL_SILICA = '0, 2, 2' -set LVL_DIC = '0, 2, 2' -set LVL_POC = '0, 2, 2' -set LVL_CALC = '0, 2, 2' -set LVL_OPAL = '0, 2, 2' -set LVL_CO3 = '0, 2, 2' -set LVL_N2O = '0, 0, 2' -set LVL_PH = '0, 2, 2' -set LVL_OMEGAC = '0, 2, 2' -set LVL_OMEGAA = '0, 2, 2' -set LVL_PREFO2 = '0, 4, 4' -set LVL_O2SAT = '0, 4, 4' -set LVL_PREFPO4 = '0, 2, 2' -set LVL_PREFALK = '0, 2, 2' -set LVL_PREFDIC = '0, 2, 2' -set LVL_DICSAT = '0, 2, 2' -set LVL_NATDIC = '0, 2, 2' -set LVL_NATALKALI = '0, 2, 2' -set LVL_NATCO3 = '0, 2, 2' -set LVL_NATCALC = '0, 2, 2' -set LVL_NATPH = '0, 2, 2' -set LVL_NATOMEGAC = '0, 2, 2' -set LVL_NATOMEGAA = '0, 2, 2' -set LVL_DIC13 = '0, 2, 2' -set LVL_DIC14 = '0, 2, 2' -set LVL_D13C = '0, 2, 2' -set LVL_POC13 = '0, 2, 2' -set LVL_DOC13 = '0, 2, 2' -set LVL_CALC13 = '0, 2, 2' -set LVL_PHYTO13 = '0, 2, 2' -set LVL_GRAZER13 = '0, 2, 2' -set LVL_CFC11 = '0, 2, 2' -set LVL_CFC12 = '0, 2, 2' -set LVL_SF6 = '0, 2, 2' -set LVL_NOS = '0, 2, 2' -set LVL_WPHY = '0, 2, 2' -set LVL_WNOS = '0, 2, 2' -set LVL_EPS = '0, 0, 0' -set LVL_ASIZE = '0, 0, 0' -set LVL_BROMO = '0, 2, 2' -set FLX_SEDIFFIC = '0, 0, 2' -set FLX_SEDIFFAL = '0, 0, 2' -set FLX_SEDIFFPH = '0, 0, 2' -set FLX_SEDIFFOX = '0, 0, 2' -set FLX_SEDIFFN2 = '0, 0, 2' -set FLX_SEDIFFNO3 = '0, 0, 2' -set FLX_SEDIFFSI = '0, 0, 2' -set SDM_POWAIC = '0, 0, 2' -set SDM_POWAAL = '0, 0, 2' -set SDM_POWAPH = '0, 0, 2' -set SDM_POWAOX = '0, 0, 2' -set SDM_POWN2 = '0, 0, 2' -set SDM_POWNO3 = '0, 0, 2' -set SDM_POWASI = '0, 0, 2' -set SDM_SSSO12 = '0, 0, 2' -set SDM_SSSSIL = '0, 0, 2' -set SDM_SSSC12 = '0, 0, 2' -set SDM_SSSTER = '0, 0, 2' -set BUR_SSSO12 = '0, 0, 2' -set BUR_SSSSIL = '0, 0, 2' -set BUR_SSSC12 = '0, 0, 2' -set BUR_SSSTER = '0, 0, 2' - -# if partial coupling, enable SSS relaxation -if ("$BLOM_COUPLING" =~ *partial*) then - if ("$BLOM_VCOORD" == isopyc_bulkml) then - set SRXDAY = 6. - else - set SRXDAY = 60. - set SRXDPT = 10. - endif - set SPRFAC = .true. - set SRXBAL = .true. -endif - -# set grid dependent parameters -if ("$OCN_GRID" == gx1v5 || "$OCN_GRID" == gx1v6) then - set BACLIN = 1800. - set BATROP = 36. -else if ("$OCN_GRID" == gx3v7) then - set BACLIN = 3600. - set BATROP = 72. -else if ("$OCN_GRID" == tnx2v1 ) then - set BACLIN = 4800. - set BATROP = 96. - set EGC = 0.5 - if ("$BLOM_UNIT" == cgs) then - set EGMXDF = 1000.e4 - else - set EGMXDF = 1000. - endif - set CWMTAG = "'Gibraltar','Gibraltar'" - set CWMEDG = " 'u', 'u'" - set CWMI = " 53, 54" - set CWMJ = " 137, 137" - set CWMWTH = " 30.e3, 30.e3" -else if ("$OCN_GRID" == tnx1.5v1 ) then - set BACLIN = 4800. - set BATROP = 96. - set EGC = 0.5 - if ("$BLOM_UNIT" == cgs) then - set EGMXDF = 1000.e4 - else - set EGMXDF = 1000. - endif -else if ("$OCN_GRID" == tnx1v1 || "$OCN_GRID" == tnx1v3 || "$OCN_GRID" == tnx1v4) then - if ("$OCN_NCPL" == 24) then - set BACLIN = 3600. - set BATROP = 60. - set CWBDTS = .75e-4 - set NIWGF = .4 - set SMTFRC = .false. - if ("$BLOM_VCOORD" == isopyc_bulkml) then - set CE = .5 - endif - else - set BACLIN = 3200. - set BATROP = 64. - endif - set CWMTAG = "'Gibraltar','Gibraltar'" - set CWMEDG = " 'u', 'u'" - set CWMI = " 105, 106" - set CWMJ = " 273, 273" - set CWMWTH = " 30.e3, 30.e3" -else if ("$OCN_GRID" == tnx0.25v1 || "$OCN_GRID" == tnx0.25v3 || "$OCN_GRID" == tnx0.25v4) then - set BACLIN = 900. - set BATROP = 15. - if ("$BLOM_UNIT" == cgs) then - set MDV2HI = .15 - set MDV2LO = .15 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300.e4 - set MDC2LO = 300.e4 - else - set MDV2HI = .0015 - set MDV2LO = .0015 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300. - set MDC2LO = 300. - endif - set VSC2HI = .15 - set VSC2LO = .15 - set VSC4HI = 0.0625 - set VSC4LO = 0.0625 - set CWBDTS = 0.75e-4 - set CWBDLS = 25. - set EDWMTH = "'step'" - set EGC = 0.85 - if ("$BLOM_UNIT" == cgs) then - set EGMXDF = 1500.e4 - else - set EGMXDF = 1500. - endif - if ("$BLOM_VCOORD" == isopyc_bulkml) then - set CE = 1.0 - endif -else if ("$OCN_GRID" == tnx0.125v4) then - set BACLIN = 300. - set BATROP = 6. - set EGMNDF = 0. - set EGMXDF = 0. - set EDWMTH = "'step'" - set CWBDTS = .75e-4 - set CWBDLS = 25 - if ("$BLOM_UNIT" == cgs) then - set MDV2HI = .1 - set MDV2LO = .1 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300.e4 - set MDC2LO = 100.e4 - else - set MDV2HI = .001 - set MDV2LO = .001 - set MDV4HI = 0. - set MDV4LO = 0. - set MDC2HI = 300. - set MDC2LO = 100. - endif - set VSC2HI = 0. - set VSC2LO = 0. - set VSC4HI = .06 - set VSC4LO = .06 - set LTEDTP = "'layer'" -else - echo "OCN_GRID is $OCN_GRID \n" - echo "$0 ERROR: Cannot deal with GRID equal to $OCN_GRID " - exit -1 -endif - -# set grid independent input files (iHAMOCC initial conditions) -set INIDIC = "'$DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_Ct_preind_OMIPinit_20171107.nc'" -set INIALK = "'$DIN_LOC_ROOT/ocn/blom/inicon/glodapv2_At_OMIPinit_20171107.nc'" -set INIPO4 = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_phosphate_OMIPinit_20171107.nc'" -set INIOXY = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_oxygen_OMIPinit_20171107.nc'" -set ININO3 = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_nitrate_OMIPinit_20171107.nc'" -set INISIL = "'$DIN_LOC_ROOT/ocn/blom/inicon/woa13_silicate_OMIPinit_20171107.nc'" -if ("$HAMOCC_CISO" == TRUE) then -set INID13C = "'$DIN_LOC_ROOT/ocn/blom/inicon/d13C_permil_20180609.nc'" -set INID14C = "'$DIN_LOC_ROOT/ocn/blom/inicon/d14C_permil_20180609.nc'" -else -set INID13C = "''" -set INID14C = "''" -endif - -# set grid dependent input files -if ("$OCN_GRID" == tnx2v1) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx2v1_20130206.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx2v1_20130419.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx2v1_20130419.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx2v1_20190826.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx2v1_20190826.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx2v1_20190826.dat'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx2v1_20130927.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx2v1_20130506.nc'" - set SWACLIMFILE = "''" - set SEDPORFILE = "''" - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx2v1_20170915.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else if ("$OCN_GRID" == tnx1v4) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx1v4_20170622.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx1v4_20170622.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx1v4_20170605.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx1v4_20190729.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx1v4_20190615.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx1v4_20190611.dat'" - set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx1v4_20170608.nc'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx1v4_20170604.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx1v4_20171107.nc'" - set SEDPORFILE = "''" - if ("$HAMOCC_VSLS" == TRUE) then - set SWACLIMFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc'" - else - set SWACLIMFILE = "''" - endif - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx1v4_20170820.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else if ("$OCN_GRID" == tnx0.25v4) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.25v4_20170622.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.25v4_20170623.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.25v4_20170626.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.25v4_20190612.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.25v4_20190701.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.25v4_20190612.dat'" - set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.25v4_20170623.nc'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.25v4_20170623.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.25v4_20181004.nc'" - set SWACLIMFILE = "''" - set SEDPORFILE = "''" - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.25v4_20170821.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else if ("$OCN_GRID" == tnx0.125v4) then - set GRFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/grid_tnx0.125v4_20221013.nc'" - set ICFILE = "'$DIN_LOC_ROOT/ocn/blom/inicon/inicon_tnx0.125v4_20230318.nc'" - set TDFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/tidal_dissipation_tnx0.125v4_20221013.nc'" - set MER_ORFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/ocean_regions_tnx0.125v4_20221013.nc'" - set MER_MIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/mertra_index_tnx0.125v4_20221013.dat'" - set SEC_SIFILE = "'$DIN_LOC_ROOT/ocn/blom/grid/section_index_tnx0.125v4_20221013.dat'" - set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx0.125v4_20221013.nc'" - set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20221013.nc'" - set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.125v4_20221013.nc'" - set SWACLIMFILE = "''" - set SEDPORFILE = "''" - if ("$BLOM_RIVER_NUTRIENTS" == TRUE) then - set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.125v4_20221013.nc'" - else - set RIVINFILE = "''" - endif - if ("$BLOM_N_DEPOSITION" == TRUE) then - set NDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/$NDEPFNAME'" - else - set NDEPFILE = "''" - endif -else - echo "$0 ERROR: Cannot deal with GRID = $OCN_GRID " - exit -1 -endif - - -#------------------------------------------------------------------------------ -# Create resolved namelist -#------------------------------------------------------------------------------ -foreach mem ("`seq $NINST_OCN`") - if ( ${NINST_OCN} == '1' ) then - set inststr = '' - else - set inststr = ("`printf '_%4.4d' $mem`") - endif - - # modify namelist variables as specified in user_nl_blom - foreach line ("`grep = $CASEROOT/user_nl_blom$inststr`") - if (`echo "$line" | tr -d ' ' | cut -c -1` != '#') then - set var = `echo "$line" | sed 's/=.*//' | tr '[a-z]' '[A-Z]'` - set val = `echo "$line" | sed 's/.*=//'` - eval 'set $var = "$val"' - endif - end - -cp ocn_in.readme $RUNDIR/. - -cat >! $RUNDIR/ocn_in$inststr << EOF -&LIMITS - NDAY1 = $NDAY1 - NDAY2 = $NDAY2 - IDATE = $IDATE - IDATE0 = $IDATE0 - RUNID = $RUNID - EXPCNF = $EXPCNF - RUNTYP = $RUNTYP - GRFILE = $GRFILE - ICFILE = $ICFILE - PREF = $PREF - BACLIN = $BACLIN - BATROP = $BATROP - MDV2HI = $MDV2HI - MDV2LO = $MDV2LO - MDV4HI = $MDV4HI - MDV4LO = $MDV4LO - MDC2HI = $MDC2HI - MDC2LO = $MDC2LO - VSC2HI = $VSC2HI - VSC2LO = $VSC2LO - VSC4HI = $VSC4HI - VSC4LO = $VSC4LO - CBAR = $CBAR - CB = $CB - CWBDTS = $CWBDTS - CWBDLS = $CWBDLS - MOMMTH = $MOMMTH - BMCMTH = $BMCMTH - RMPMTH = $RMPMTH - MLRTTP = $MLRTTP - RM0 = $RM0 - RM5 = $RM5 - CE = $CE - TDFILE = $TDFILE - NIWGF = $NIWGF - NIWBF = $NIWBF - NIWLF = $NIWLF - SWAMTH = $SWAMTH - JWTYPE = $JWTYPE - CHLOPT = $CHLOPT - CCFILE = $CCFILE - TRXDAY = $TRXDAY - SRXDAY = $SRXDAY - TRXDPT = $TRXDPT - SRXDPT = $SRXDPT - TRXLIM = $TRXLIM - SRXLIM = $SRXLIM - APTFLX = $APTFLX - APSFLX = $APSFLX - DITFLX = $DITFLX - DISFLX = $DISFLX - SRXBAL = $SRXBAL - SCFILE = $SCFILE - WAVSRC = $WAVSRC - SMTFRC = $SMTFRC - SPRFAC = $SPRFAC - ATM_PATH = $ATM_PATH - ITEST = $ITEST - JTEST = $JTEST - CNSVDI = $CNSVDI - CSDIAG = $CSDIAG - RSTFRQ = $RSTFRQ - RSTFMT = $RSTFMT - RSTCMP = $RSTCMP - IOTYPE = $IOTYPE -/ -EOF - -if ("$BLOM_VCOORD" == cntiso_hybrid) then -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&VCOORD - VCOORD_TYPE = $VCOORD_TYPE - RECONSTRUCTION_METHOD = $RECONSTRUCTION_METHOD - DENSITY_LIMITING = $DENSITY_LIMITING - TRACER_LIMITING = $TRACER_LIMITING - VELOCITY_LIMITING = $VELOCITY_LIMITING - DENSITY_PC_UPPER_BNDR = $DENSITY_PC_UPPER_BNDR - DENSITY_PC_LOWER_BNDR = $DENSITY_PC_LOWER_BNDR - TRACER_PC_UPPER_BNDR = $TRACER_PC_UPPER_BNDR - TRACER_PC_LOWER_BNDR = $TRACER_PC_LOWER_BNDR - VELOCITY_PC_UPPER_BNDR = $VELOCITY_PC_UPPER_BNDR - VELOCITY_PC_LOWER_BNDR = $VELOCITY_PC_LOWER_BNDR - DPMIN_SURFACE = $DPMIN_SURFACE - DPMIN_INFLATION_FACTOR = $DPMIN_INFLATION_FACTOR - DPMIN_INTERIOR = $DPMIN_INTERIOR - DKTZU = $DKTZU - DKTZL = $DKTZL -/ -EOF -endif - -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&DIFFUSION - EITMTH = $EITMTH - EDRITP = $EDRITP - EDWMTH = $EDWMTH - EDDF2D = $EDDF2D - EDSPRS = $EDSPRS - EGC = $EGC - EGGAM = $EGGAM - EGLSMN = $EGLSMN - EGMNDF = $EGMNDF - EGMXDF = $EGMXDF - EGIDFQ = $EGIDFQ - TBFILE = $TBFILE - RHISCF = $RHISCF - EDANIS = $EDANIS - REDI3D = $REDI3D - RHSCTP = $RHSCTP - RI0 = $RI0 - BDMTYP = $BDMTYP - BDMC1 = $BDMC1 - BDMC2 = $BDMC2 - BDMLDP = $BDMLDP - TKEPF = $TKEPF - SMOBLD = $SMOBLD - LNGMTP = $LNGMTP - LTEDTP = $LTEDTP -/ -EOF - -if ($?CWMTAG) then -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&CWMOD - CWMTAG = $CWMTAG - CWMEDG = $CWMEDG - CWMI = $CWMI - CWMJ = $CWMJ - CWMWTH = $CWMWTH -/ -EOF -endif - -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&MERDIA - MER_ORFILE = $MER_ORFILE - MER_MIFILE = $MER_MIFILE - MER_REGNAM = 'atlantic_arctic_ocean', 'atlantic_arctic_extended_ocean', 'indian_pacific_ocean', 'global_ocean' - MER_REGFLG(1,:) = 2, 4 - MER_REGFLG(2,:) = 2, 4, 6, 7, 8, 9 - MER_REGFLG(3,:) = 3, 5 - MER_REGFLG(4,:) = 0 - MER_MINLAT = -34., -34., -34., -90. - MER_MAXLAT = 90., 90., 90., 90. -/ - -&SECDIA - SEC_SIFILE = $SEC_SIFILE -/ - -&DIAPHY - GLB_FNAMETAG = $GLB_FNAMETAG - GLB_AVEPERIO = $GLB_AVEPERIO - GLB_FILEFREQ = $GLB_FILEFREQ - GLB_COMPFLAG = $GLB_COMPFLAG - GLB_NCFORMAT = $GLB_NCFORMAT - H2D_ABSWND = $H2D_ABSWND - H2D_ALB = $H2D_ALB - H2D_BTMSTR = $H2D_BTMSTR - H2D_BRNFLX = $H2D_BRNFLX - H2D_BRNPD = $H2D_BRNPD - H2D_DFL = $H2D_DFL - H2D_EVA = $H2D_EVA - H2D_FICE = $H2D_FICE - H2D_FMLTFZ = $H2D_FMLTFZ - H2D_HICE = $H2D_HICE - H2D_HMLTFZ = $H2D_HMLTFZ - H2D_HSNW = $H2D_HSNW - H2D_IAGE = $H2D_IAGE - H2D_IDKEDT = $H2D_IDKEDT - H2D_LAMULT = $H2D_LAMULT - H2D_LASL = $H2D_LASL - H2D_LIP = $H2D_LIP - H2D_MAXMLD = $H2D_MAXMLD - H2D_MLD = $H2D_MLD - H2D_MLTS = $H2D_MLTS - H2D_MLTSMN = $H2D_MLTSMN - H2D_MLTSMX = $H2D_MLTSMX - H2D_MLTSSQ = $H2D_MLTSSQ - H2D_MTKEUS = $H2D_MTKEUS - H2D_MTKENI = $H2D_MTKENI - H2D_MTKEBF = $H2D_MTKEBF - H2D_MTKERS = $H2D_MTKERS - H2D_MTKEPE = $H2D_MTKEPE - H2D_MTKEKE = $H2D_MTKEKE - H2D_MTY = $H2D_MTY - H2D_NSF = $H2D_NSF - H2D_PBOT = $H2D_PBOT - H2D_PSRF = $H2D_PSRF - H2D_RFIFLX = $H2D_RFIFLX - H2D_RNFFLX = $H2D_RNFFLX - H2D_SALFLX = $H2D_SALFLX - H2D_SALRLX = $H2D_SALRLX - H2D_SBOT = $H2D_SBOT - H2D_SEALV = $H2D_SEALV - H2D_SLVSQ = $H2D_SLVSQ - H2D_SFL = $H2D_SFL - H2D_SOP = $H2D_SOP - H2D_SIGMX = $H2D_SIGMX - H2D_SSS = $H2D_SSS - H2D_SSSSQ = $H2D_SSSSQ - H2D_SST = $H2D_SST - H2D_SSTSQ = $H2D_SSTSQ - H2D_SURFLX = $H2D_SURFLX - H2D_SURRLX = $H2D_SURRLX - H2D_SWA = $H2D_SWA - H2D_T20D = $H2D_T20D - H2D_TAUX = $H2D_TAUX - H2D_TAUY = $H2D_TAUY - H2D_TBOT = $H2D_TBOT - H2D_TICE = $H2D_TICE - H2D_TSRF = $H2D_TSRF - H2D_UB = $H2D_UB - H2D_UICE = $H2D_UICE - H2D_USTAR = $H2D_USTAR - H2D_USTAR3 = $H2D_USTAR3 - H2D_USTOKES = $H2D_USTOKES - H2D_VB = $H2D_VB - H2D_VICE = $H2D_VICE - H2D_VSTOKES = $H2D_VSTOKES - H2D_ZTX = $H2D_ZTX - LYR_BFSQ = $LYR_BFSQ - LYR_DIFDIA = $LYR_DIFDIA - LYR_DIFVMO = $LYR_DIFVMO - LYR_DIFVHO = $LYR_DIFVHO - LYR_DIFVSO = $LYR_DIFVSO - LYR_DIFINT = $LYR_DIFINT - LYR_DIFISO = $LYR_DIFISO - LYR_DP = $LYR_DP - LYR_DZ = $LYR_DZ - LYR_SALN = $LYR_SALN - LYR_TEMP = $LYR_TEMP - LYR_TRC = $LYR_TRC - LYR_UFLX = $LYR_UFLX - LYR_UTFLX = $LYR_UTFLX - LYR_USFLX = $LYR_USFLX - LYR_UMFLTD = $LYR_UMFLTD - LYR_UMFLSM = $LYR_UMFLSM - LYR_UTFLTD = $LYR_UTFLTD - LYR_UTFLSM = $LYR_UTFLSM - LYR_UTFLLD = $LYR_UTFLLD - LYR_USFLTD = $LYR_USFLTD - LYR_USFLSM = $LYR_USFLSM - LYR_USFLLD = $LYR_USFLLD - LYR_UVEL = $LYR_UVEL - LYR_VFLX = $LYR_VFLX - LYR_VTFLX = $LYR_VTFLX - LYR_VSFLX = $LYR_VSFLX - LYR_VMFLTD = $LYR_VMFLTD - LYR_VMFLSM = $LYR_VMFLSM - LYR_VTFLTD = $LYR_VTFLTD - LYR_VTFLSM = $LYR_VTFLSM - LYR_VTFLLD = $LYR_VTFLLD - LYR_VSFLTD = $LYR_VSFLTD - LYR_VSFLSM = $LYR_VSFLSM - LYR_VSFLLD = $LYR_VSFLLD - LYR_VVEL = $LYR_VVEL - LYR_WFLX = $LYR_WFLX - LYR_WFLX2 = $LYR_WFLX2 - LYR_PV = $LYR_PV - LYR_TKE = $LYR_TKE - LYR_GLS_PSI = $LYR_GLS_PSI - LYR_IDLAGE = $LYR_IDLAGE - LVL_BFSQ = $LVL_BFSQ - LVL_DIFDIA = $LVL_DIFDIA - LVL_DIFVMO = $LVL_DIFVMO - LVL_DIFVHO = $LVL_DIFVHO - LVL_DIFVSO = $LVL_DIFVSO - LVL_DIFINT = $LVL_DIFINT - LVL_DIFISO = $LVL_DIFISO - LVL_DZ = $LVL_DZ - LVL_SALN = $LVL_SALN - LVL_TEMP = $LVL_TEMP - LVL_TRC = $LVL_TRC - LVL_UFLX = $LVL_UFLX - LVL_UTFLX = $LVL_UTFLX - LVL_USFLX = $LVL_USFLX - LVL_UMFLTD = $LVL_UMFLTD - LVL_UMFLSM = $LVL_UMFLSM - LVL_UTFLTD = $LVL_UTFLTD - LVL_UTFLSM = $LVL_UTFLSM - LVL_UTFLLD = $LVL_UTFLLD - LVL_USFLTD = $LVL_USFLTD - LVL_USFLSM = $LVL_USFLSM - LVL_USFLLD = $LVL_USFLLD - LVL_UVEL = $LVL_UVEL - LVL_VFLX = $LVL_VFLX - LVL_VTFLX = $LVL_VTFLX - LVL_VSFLX = $LVL_VSFLX - LVL_VMFLTD = $LVL_VMFLTD - LVL_VMFLSM = $LVL_VMFLSM - LVL_VTFLTD = $LVL_VTFLTD - LVL_VTFLSM = $LVL_VTFLSM - LVL_VTFLLD = $LVL_VTFLLD - LVL_VSFLTD = $LVL_VSFLTD - LVL_VSFLSM = $LVL_VSFLSM - LVL_VSFLLD = $LVL_VSFLLD - LVL_VVEL = $LVL_VVEL - LVL_WFLX = $LVL_WFLX - LVL_WFLX2 = $LVL_WFLX2 - LVL_PV = $LVL_PV - LVL_TKE = $LVL_TKE - LVL_GLS_PSI = $LVL_GLS_PSI - LVL_IDLAGE = $LVL_IDLAGE - MSC_MMFLXL = $MSC_MMFLXL - MSC_MMFLXD = $MSC_MMFLXD - MSC_MMFTDL = $MSC_MMFTDL - MSC_MMFSML = $MSC_MMFSML - MSC_MMFTDD = $MSC_MMFTDD - MSC_MMFSMD = $MSC_MMFSMD - MSC_MHFLX = $MSC_MHFLX - MSC_MHFTD = $MSC_MHFTD - MSC_MHFSM = $MSC_MHFSM - MSC_MHFLD = $MSC_MHFLD - MSC_MSFLX = $MSC_MSFLX - MSC_MSFTD = $MSC_MSFTD - MSC_MSFSM = $MSC_MSFSM - MSC_MSFLD = $MSC_MSFLD - MSC_VOLTR = $MSC_VOLTR - MSC_MASSGS = $MSC_MASSGS - MSC_VOLGS = $MSC_VOLGS - MSC_SALNGA = $MSC_SALNGA - MSC_TEMPGA = $MSC_TEMPGA - MSC_SSSGA = $MSC_SSSGA - MSC_SSTGA = $MSC_SSTGA -/ -EOF - -if ("$ecosys" == TRUE) then -cat >>! $RUNDIR/ocn_in$inststr << EOF - -&BGCNML - ATM_CO2 = $CCSM_CO2_PPMV - FEDEPFILE = $FEDEPFILE - SWACLIMFILE = $SWACLIMFILE - DO_RIVINPT = $DO_RIVINPT - RIVINFILE = $RIVINFILE - DO_NDEP = $DO_NDEP - NDEPFILE = $NDEPFILE - DO_OALK = $DO_OALK - DO_SEDSPINUP = $DO_SEDSPINUP - SEDSPIN_YR_S = $SEDSPIN_YR_S - SEDSPIN_YR_E = $SEDSPIN_YR_E - SEDSPIN_NCYC = $SEDSPIN_NCYC - INIDIC = $INIDIC - INIALK = $INIALK - INIPO4 = $INIPO4 - INIOXY = $INIOXY - ININO3 = $ININO3 - INISIL = $INISIL - INID13C = $INID13C - INID14C = $INID14C - WITH_DMSPH = $WITH_DMSPH - PI_PH_FILE = $PI_PH_FILE - L_3DVARSEDPOR = $L_3DVARSEDPOR - SEDPORFILE = $SEDPORFILE -/ - -&BGCOAFX - OALKSCEN = $BGCOAFX_OALKSCEN - OALKFILE = $BGCOAFX_OALKFILE - ADDALK = $BGCOAFX_ADDALK - CDRMIP_LATMAX = $BGCOAFX_CDRMIP_LATMAX - CDRMIP_LATMIN = $BGCOAFX_CDRMIP_LATMIN - RAMP_START = $BGCOAFX_RAMP_START - RAMP_END = $BGCOAFX_RAMP_END -/ - -&DIABGC - GLB_FNAMETAG = $BGC_FNAMETAG - GLB_AVEPERIO = $BGC_AVEPERIO - GLB_FILEFREQ = $BGC_FILEFREQ - GLB_COMPFLAG = $BGC_COMPFLAG - GLB_NCFORMAT = $BGC_NCFORMAT - GLB_INVENTORY = $BGC_INVENTORY - SRF_PHOSPH = $SRF_PHOSPH - SRF_OXYGEN = $SRF_OXYGEN - SRF_IRON = $SRF_IRON - SRF_ANO3 = $SRF_ANO3 - SRF_ALKALI = $SRF_ALKALI - SRF_SILICA = $SRF_SILICA - SRF_DIC = $SRF_DIC - SRF_PHYTO = $SRF_PHYTO - SRF_PH = $SRF_PH - SRF_EXPORT = $SRF_EXPORT - SRF_EXPOSI = $SRF_EXPOSI - SRF_EXPOCA = $SRF_EXPOCA - SRF_KWCO2 = $SRF_KWCO2 - SRF_KWCO2KHM = $SRF_KWCO2KHM - SRF_CO2KH = $SRF_CO2KH - SRF_CO2KHM = $SRF_CO2KHM - SRF_PCO2 = $SRF_PCO2 - SRF_PCO2M = $SRF_PCO2M - SRF_CO2FXD = $SRF_CO2FXD - SRF_CO2FXU = $SRF_CO2FXU - SRF_OXFLUX = $SRF_OXFLUX - SRF_NIFLUX = $SRF_NIFLUX - SRF_N2OFX = $SRF_N2OFX - SRF_DMSFLUX = $SRF_DMSFLUX - SRF_DMS = $SRF_DMS - SRF_DMSPROD = $SRF_DMSPROD - SRF_DMS_BAC = $SRF_DMS_BAC - SRF_DMS_UV = $SRF_DMS_UV - SRF_ATMCO2 = $SRF_ATMCO2 - SRF_ATMO2 = $SRF_ATMO2 - SRF_ATMN2 = $SRF_ATMN2 - SRF_NATDIC = $SRF_NATDIC - SRF_NATALKALI = $SRF_NATALKALI - SRF_NATPH = $SRF_NATPH - SRF_NATPCO2 = $SRF_NATPCO2 - SRF_NATCO2FX = $SRF_NATCO2FX - SRF_CO213FXD = $SRF_CO213FXD - SRF_CO213FXU = $SRF_CO213FXU - SRF_CO214FXD = $SRF_CO214FXD - SRF_CO214FXU = $SRF_CO214FXU - SRF_CFC11 = $SRF_CFC11 - SRF_CFC12 = $SRF_CFC12 - SRF_SF6 = $SRF_SF6 - SRF_BROMO = $SRF_BROMO - SRF_BROMOFX = $SRF_BROMOFX - INT_BROMOPRO = $INT_BROMOPRO - INT_BROMOUV = $INT_BROMOUV - INT_PHOSY = $INT_PHOSY - INT_NFIX = $INT_NFIX - INT_DNIT = $INT_DNIT - FLX_NDEP = $FLX_NDEP - FLX_OALK = $FLX_OALK - FLX_CAR0100 = $FLX_CAR0100 - FLX_CAR0500 = $FLX_CAR0500 - FLX_CAR1000 = $FLX_CAR1000 - FLX_CAR2000 = $FLX_CAR2000 - FLX_CAR4000 = $FLX_CAR4000 - FLX_CAR_BOT = $FLX_CAR_BOT - FLX_BSI0100 = $FLX_BSI0100 - FLX_BSI0500 = $FLX_BSI0500 - FLX_BSI1000 = $FLX_BSI1000 - FLX_BSI2000 = $FLX_BSI2000 - FLX_BSI4000 = $FLX_BSI4000 - FLX_BSI_BOT = $FLX_BSI_BOT - FLX_CAL0100 = $FLX_CAL0100 - FLX_CAL0500 = $FLX_CAL0500 - FLX_CAL1000 = $FLX_CAL1000 - FLX_CAL2000 = $FLX_CAL2000 - FLX_CAL4000 = $FLX_CAL4000 - FLX_CAL_BOT = $FLX_CAL_BOT - LYR_PHYTO = $LYR_PHYTO - LYR_GRAZER = $LYR_GRAZER - LYR_DOC = $LYR_DOC - LYR_PHOSY = $LYR_PHOSY - LYR_PHOSPH = $LYR_PHOSPH - LYR_OXYGEN = $LYR_OXYGEN - LYR_IRON = $LYR_IRON - LYR_ANO3 = $LYR_ANO3 - LYR_ALKALI = $LYR_ALKALI - LYR_SILICA = $LYR_SILICA - LYR_DIC = $LYR_DIC - LYR_POC = $LYR_POC - LYR_CALC = $LYR_CALC - LYR_OPAL = $LYR_OPAL - LYR_CO3 = $LYR_CO3 - LYR_N2O = $LYR_N2O - LYR_PH = $LYR_PH - LYR_OMEGAC = $LYR_OMEGAC - LYR_OMEGAA = $LYR_OMEGAA - LYR_PREFO2 = $LYR_PREFO2 - LYR_O2SAT = $LYR_O2SAT - LYR_PREFPO4 = $LYR_PREFPO4 - LYR_PREFALK = $LYR_PREFALK - LYR_PREFDIC = $LYR_PREFDIC - LYR_DICSAT = $LYR_DICSAT - LYR_NATDIC = $LYR_NATDIC - LYR_NATALKALI = $LYR_NATALKALI - LYR_NATCO3 = $LYR_NATCO3 - LYR_NATCALC = $LYR_NATCALC - LYR_NATPH = $LYR_NATPH - LYR_NATOMEGAC = $LYR_NATOMEGAC - LYR_NATOMEGAA = $LYR_NATOMEGAA - LYR_DIC13 = $LYR_DIC13 - LYR_DIC14 = $LYR_DIC14 - LYR_D13C = $LYR_D13C - LYR_D14C = $LYR_D14C - LYR_BIGD14C = $LYR_BIGD14C - LYR_POC13 = $LYR_POC13 - LYR_DOC13 = $LYR_DOC13 - LYR_CALC13 = $LYR_CALC13 - LYR_PHYTO13 = $LYR_PHYTO13 - LYR_GRAZER13 = $LYR_GRAZER13 - LYR_CFC11 = $LYR_CFC11 - LYR_CFC12 = $LYR_CFC12 - LYR_SF6 = $LYR_SF6 - LYR_NOS = $LYR_NOS - LYR_WPHY = $LYR_WPHY - LYR_WNOS = $LYR_WNOS - LYR_EPS = $LYR_EPS - LYR_ASIZE = $LYR_ASIZE - LYR_DP = $BGC_DP - LYR_BROMO = $LYR_BROMO - LVL_PHYTO = $LVL_PHYTO - LVL_GRAZER = $LVL_GRAZER - LVL_DOC = $LVL_DOC - LVL_PHOSY = $LVL_PHOSY - LVL_PHOSPH = $LVL_PHOSPH - LVL_OXYGEN = $LVL_OXYGEN - LVL_IRON = $LVL_IRON - LVL_ANO3 = $LVL_ANO3 - LVL_ALKALI = $LVL_ALKALI - LVL_SILICA = $LVL_SILICA - LVL_DIC = $LVL_DIC - LVL_POC = $LVL_POC - LVL_CALC = $LVL_CALC - LVL_OPAL = $LVL_OPAL - LVL_CO3 = $LVL_CO3 - LVL_N2O = $LVL_N2O - LVL_PH = $LVL_PH - LVL_OMEGAC = $LVL_OMEGAC - LVL_OMEGAA = $LVL_OMEGAA - LVL_PREFO2 = $LVL_PREFO2 - LVL_O2SAT = $LVL_O2SAT - LVL_PREFPO4 = $LVL_PREFPO4 - LVL_PREFALK = $LVL_PREFALK - LVL_PREFDIC = $LVL_PREFDIC - LVL_DICSAT = $LVL_DICSAT - LVL_NATDIC = $LVL_NATDIC - LVL_NATALKALI = $LVL_NATALKALI - LVL_NATCO3 = $LVL_NATCO3 - LVL_NATCALC = $LVL_NATCALC - LVL_NATPH = $LVL_NATPH - LVL_NATOMEGAC = $LVL_NATOMEGAC - LVL_NATOMEGAA = $LVL_NATOMEGAA - LVL_DIC13 = $LVL_DIC13 - LVL_DIC14 = $LVL_DIC14 - LVL_D13C = $LVL_D13C - LVL_POC13 = $LVL_POC13 - LVL_DOC13 = $LVL_DOC13 - LVL_CALC13 = $LVL_CALC13 - LVL_PHYTO13 = $LVL_PHYTO13 - LVL_GRAZER13 = $LVL_GRAZER13 - LVL_CFC11 = $LVL_CFC11 - LVL_CFC12 = $LVL_CFC12 - LVL_SF6 = $LVL_SF6 - LVL_NOS = $LVL_NOS - LVL_WPHY = $LVL_WPHY - LVL_WNOS = $LVL_WNOS - LVL_EPS = $LVL_EPS - LVL_ASIZE = $LVL_ASIZE - LVL_BROMO = $LVL_BROMO - FLX_SEDIFFIC = $FLX_SEDIFFIC - FLX_SEDIFFAL = $FLX_SEDIFFAL - FLX_SEDIFFPH = $FLX_SEDIFFPH - FLX_SEDIFFOX = $FLX_SEDIFFOX - FLX_SEDIFFN2 = $FLX_SEDIFFN2 - FLX_SEDIFFNO3 = $FLX_SEDIFFNO3 - FLX_SEDIFFSI = $FLX_SEDIFFSI - SDM_POWAIC = $SDM_POWAIC - SDM_POWAAL = $SDM_POWAAL - SDM_POWAPH = $SDM_POWAPH - SDM_POWAOX = $SDM_POWAOX - SDM_POWN2 = $SDM_POWN2 - SDM_POWNO3 = $SDM_POWNO3 - SDM_POWASI = $SDM_POWASI - SDM_SSSO12 = $SDM_SSSO12 - SDM_SSSSIL = $SDM_SSSSIL - SDM_SSSC12 = $SDM_SSSC12 - SDM_SSSTER = $SDM_SSSTER - BUR_SSSO12 = $BUR_SSSO12 - BUR_SSSSIL = $BUR_SSSSIL - BUR_SSSC12 = $BUR_SSSC12 - BUR_SSSTER = $BUR_SSSTER -/ -EOF -endif - -end ## foreach mem ("`seq $NINST_OCN`") - -#------------------------------------------------------------------------------ -# Generate blom.input_data_list -#------------------------------------------------------------------------------ - -cat > $CASEBUILD/blom.input_data_list << EOF -grid_file = `echo $GRFILE | tr -d '"' | tr -d "'"` -meridional_transport_index_file = `echo $MER_MIFILE | tr -d '"' | tr -d "'"` -meridional_transport_basin_file = `echo $MER_ORFILE | tr -d '"' | tr -d "'"` -section_index_file = `echo $SEC_SIFILE | tr -d '"' | tr -d "'"` -tidal_dissipation_file = `echo $TDFILE | tr -d '"' | tr -d "'"` -EOF -if ($SWAMTH == "'chlorophyll'") then -cat >> $CASEBUILD/blom.input_data_list << EOF -chlorophyll_concentration_file = `echo $CCFILE | tr -d '"' | tr -d "'"` -EOF -endif -if ($SRXDAY != "0.") then -cat >> $CASEBUILD/blom.input_data_list << EOF -sss_climatology_file = `echo $SCFILE | tr -d '"' | tr -d "'"` -EOF -endif - -# iHAMOCC boundary conditions -if ($ecosys == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -dust_file = `echo $FEDEPFILE | tr -d '"' | tr -d "'"` -EOF - if ($BLOM_RIVER_NUTRIENTS == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -river_file = `echo $RIVINFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($BLOM_N_DEPOSITION == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -n_deposition_file = `echo $NDEPFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($BGCOAFX_OALKFILE != "''") then -cat >> $CASEBUILD/blom.input_data_list << EOF -oafx_file = `echo $BGCOAFX_OALKFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($HAMOCC_VSLS == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -swa_clim_file = `echo $SWACLIMFILE | tr -d '"' | tr -d "'"` -EOF - endif - if ($L_3DVARSEDPOR == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -sed_porosity_file = `echo $SEDPORFILE | tr -d '"' | tr -d "'"` -EOF - endif -endif - -# BLOM initial conditions -cat >> $CASEBUILD/blom.input_data_list << EOF -inicon_file = `echo $ICFILE | tr -d '"' | tr -d "'"` -EOF - - -# iHAMOCC initial conditions -if ($ecosys == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inidic_file = `echo $INIDIC | tr -d '"' | tr -d "'"` -inialk_file = `echo $INIALK | tr -d '"' | tr -d "'"` -inipo4_file = `echo $INIPO4 | tr -d '"' | tr -d "'"` -inioxy_file = `echo $INIOXY | tr -d '"' | tr -d "'"` -inino3_file = `echo $ININO3 | tr -d '"' | tr -d "'"` -inisil_file = `echo $INISIL | tr -d '"' | tr -d "'"` -EOF - if ($HAMOCC_CISO == TRUE) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inic13_file = `echo $INID13C | tr -d '"' | tr -d "'"` -inic14_file = `echo $INID14C | tr -d '"' | tr -d "'"` -EOF - endif - if ($RUN_TYPE == startup) then - if ($ICFILE =~ *.blom.r.*) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inicon_bgc_file = `echo $ICFILE | sed 's/.blom.r./.blom.rbgc./' | tr -d '"' | tr -d "'"` -EOF - else if ($ICFILE =~ *.micom.r.*) then -cat >> $CASEBUILD/blom.input_data_list << EOF -inicon_bgc_file = `echo $ICFILE | sed 's/.micom.r./.micom.rbgc./' | tr -d '"' | tr -d "'"` -EOF - endif - endif -endif - - diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 4eb67a28..2c44a118 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -3834,6 +3834,290 @@ End year for ramp up in 'ramp' scenario + + + + + + real + bgcparams + bgcparams + + 4.e-8 + + phytoplankton parameter: kmol/m3 - i.e. 0.04 mmol P/m3 half saturation constant + + + + real + bgcparams + bgcparams + + 0.004 + + phytoplankton parameter: 1/d -mortality rate of phytoplankton + + + + real + bgcparams + bgcparams + + 0.005 + + phytoplankton parameter: 1/d - nitrogen fixation rate by blue green algae (cyanobacteria) + + + + real + bgcparams + bgcparams + + 8.e-8 + + zooplankton parameter: kmol/m3 - i.e. 0.08 mmol P/m3 half saturation constant + + + + real + bgcparams + bgcparams + + 1.2 + + zooplankton parameter: 1/d -grazing rate + + + + real + bgcparams + bgcparams + + 3.e6 + + zooplankton parameter: 1/d -mortality rate + + + + real + bgcparams + bgcparams + + 0.04 + + zooplankton parameter: 1/d -exudation rate + + + + real + bgcparams + bgcparams + + 0.06 + + zooplankton parameter: 1/d -excretion rate + + + + real + bgcparams + bgcparams + + 0.95 + + zooplankton parameter: fraction of mortality as PO_4 + + + + real + bgcparams + bgcparams + + 0.6 + 0.7 + 0.5 + + zooplankton parameter: dimensionless fraction -assimilation efficiency + + + + real + bgcparams + bgcparams + + 0.8 + 0.85 + 0.9 + + zooplankton parameter: dimensionless fraction -fraction of grazing egested + + + + real + bgcparams + bgcparams + + 5.e-6 + + shell production parameter: kmol/m3 - i.e. 4.0 mmol Si/m3 half saturation constant + + + + real + bgcparams + bgcparams + + 40. + 33. + 14. + + shell production parameter: calcium carbonate to organic phosphorous production ratio + + + + real + bgcparams + bgcparams + + 30. + 45. + 10.5 + + shell production parameter: + + + + real + bgcparams + bgcparams + + 0.004 + + remineralization and dissolution parameter: 1/d -remineralization rate (of DOM) + + + + real + bgcparams + bgcparams + + 0.025 + + remineralization and dissolution parameter: 1/d Aerob remineralization rate detritus + + + + real + bgcparams + bgcparams + + 0.003 + + remineralization and dissolution parameter: 1/d Dissolution rate for opal + + + + real + bgcparams + bgcparams + + 0.01 + + remineralization and dissolution parameter: 1/d Remineralization rate of detritus on N2O + + + + real + bgcparams + bgcparams + + 0.005 + + remineralization and dissolution parameter: 1/d Remineralization rate for sulphate reduction + + + + real + bgcparams + bgcparams + + 0.6 + + Dust deposition and iron solubility parameter: factor introduced to tune deposition/solubility + + + + + + + + + + + + + + + real + bgcparams + bgcparams + + 5. + + Sinking parameter: m/d Sinking speed of detritus iris : 5. + + + + real + bgcparams + bgcparams + + 30. + + Sinking parameter: m/d Sinking speed of CaCO3 shell material + + + + real + bgcparams + bgcparams + + 30. + + Sinking parameter: m/d Sinking speed of opal iris : 60 + + + + real + bgcparams + bgcparams + + 1. + + Sinking parameter: m/d minimum sinking speed + + + + real + bgcparams + bgcparams + + 60. + + Sinking parameter: m/d maximum sinking speed + + + + + + + + + + + + + diff --git a/cime_config/ocn_in.readme b/cime_config/ocn_in.readme index d288c614..05f933e6 100644 --- a/cime_config/ocn_in.readme +++ b/cime_config/ocn_in.readme @@ -75,8 +75,8 @@ ! SRXBAL : Balance the SSS relaxation (l) ! SCFILE : Name of file containing SSS climatology used for relaxation (a) ! WAVSRC : Source of wave fields. Valid source: 'none', 'param', 'extern' (a) -! SMTFRC : Smooth NorESM forcing (l) -! SPRFAC : Send precipitation/runoff factor to NorESM coupler (l) +! SMTFRC : Smooth CESM forcing (l) +! SPRFAC : Send precipitation/runoff factor to CESM coupler (l) ! ATM_PATH : Path to forcing fields in case of EXPCNF 'ben02clim' or ! 'ben02syn' (a) ! ITEST : Global i-index of point diagnostics (i) diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index e2400c2d..d88a7d4a 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -21,7 +21,6 @@ file_path = os.path.abspath(__file__) directory = os.path.dirname(file_path) -print (f"DEBUG: directory dir is {directory}") sys.path.append(os.path.join(directory, "ParamGen")) #pylint: disable=wrong-import-position from paramgen import ParamGen From 8d326931acd418dc0877b3aeb619ef218717147a Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Thu, 10 Aug 2023 13:25:08 +0200 Subject: [PATCH 21/33] fix bug in generation of Buildconf/blom.input_data --- cime_config/ocn_in_paramgen.py | 3 ++- cime_config/testdefs/testlist_blom.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index d88a7d4a..5bc3d817 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -1637,13 +1637,14 @@ def write_inputdata(self, output_path, groups): if self._data[nml_group][var]["is_inputdata"] == 'yes': val = self._data[nml_group][var]["values"].strip() - val = val.replace('"',"'") + val = val.replace('"','') write_val = True if val == "''": write_val = False elif 'unset' in val or 'UNSET' in val: write_val = False if write_val: + val = "'" + val + "'" ocn_in_fil.write(f"{var} = {val} \n") diff --git a/cime_config/testdefs/testlist_blom.xml b/cime_config/testdefs/testlist_blom.xml index cdddf99a..83842ba0 100644 --- a/cime_config/testdefs/testlist_blom.xml +++ b/cime_config/testdefs/testlist_blom.xml @@ -10,7 +10,7 @@ - + From 46ad311e58c86e93864722e59e9c7112985d4fde Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Thu, 10 Aug 2023 13:29:38 +0200 Subject: [PATCH 22/33] fix bug in generation of Buildconf/blom.input_data --- cime_config/ocn_in_paramgen.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index 5bc3d817..44a1f00a 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -1644,7 +1644,6 @@ def write_inputdata(self, output_path, groups): elif 'unset' in val or 'UNSET' in val: write_val = False if write_val: - val = "'" + val + "'" ocn_in_fil.write(f"{var} = {val} \n") From 0983a9f85f8bb2c5a8fe2c399f161ba2e45a797f Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Thu, 10 Aug 2023 15:38:17 +0200 Subject: [PATCH 23/33] put in empty namelist for bgcparams as was done in the previous PR --- cime_config/buildnml | 7 +++++-- cime_config/ocn_in_paramgen.py | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 78763719..f79375ce 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -239,9 +239,12 @@ def buildnml(case, caseroot, compname): groups.append("bgcnml") groups.append("bgcoafx") groups.append("diabgc") - groups.append("bgcparams") - pg_blom.write_nmlfile(namelist_file, groups) + # for now don't write out bgcparams - just create an empty namelist + # if "ecosys" in case.get_value("BLOM_TRACER_MODULES"): + # groups.append("bgcparams") + + pg_blom.write_nmlfile(namelist_file, groups, empty_namelists=["bgcparams"]) # Replace MER_REGFLAG1 -> MER_REGFLAG4 with array syntax in ocn_in from pathlib import Path diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index 44a1f00a..5dfad179 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -1507,7 +1507,7 @@ def get_value(self, variable): break return value - def write_nmlfile(self, output_path, groups): + def write_nmlfile(self, output_path, groups, empty_namelists=None): """ Write data to Fortran namelist file. ---------- @@ -1602,6 +1602,10 @@ def write_nmlfile(self, output_path, groups): # Add space for next namelist group: ocn_in_fil.write('/\n\n') #End for (namelist groups) + if empty_namelists is not None: + for empty_namelist in empty_namelists: + ocn_in_fil.write("&"+empty_namelist+"\n") + ocn_in_fil.write('/\n\n') #End with (open ocn_in file) #### From 92ac17e574a9e03a89f93c407110f6cb9715e017 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Thu, 10 Aug 2023 17:09:28 +0200 Subject: [PATCH 24/33] one more fix for empty namelists --- cime_config/ocn_in_paramgen.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cime_config/ocn_in_paramgen.py b/cime_config/ocn_in_paramgen.py index 5dfad179..2b51efcd 100644 --- a/cime_config/ocn_in_paramgen.py +++ b/cime_config/ocn_in_paramgen.py @@ -1601,12 +1601,16 @@ def write_nmlfile(self, output_path, groups, empty_namelists=None): #End for (namelist variables) # Add space for next namelist group: ocn_in_fil.write('/\n\n') + #End for (namelist groups) - if empty_namelists is not None: - for empty_namelist in empty_namelists: - ocn_in_fil.write("&"+empty_namelist+"\n") - ocn_in_fil.write('/\n\n') - #End with (open ocn_in file) + + # Write out empty namelists if needed + if empty_namelists is not None: + for empty_namelist in empty_namelists: + ocn_in_fil.write("&"+empty_namelist+"\n") + ocn_in_fil.write('/\n\n') + + #End with (open ocn_in file) #### From 8609d86f9ceb59d4f93010b0ab7ecd06660172e4 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Tue, 15 Aug 2023 13:18:42 +0200 Subject: [PATCH 25/33] added new 128 pe file for BLOM for tnx1v4 - needed for ERP tests --- bld/tnx1v4/patch.input.128 | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 bld/tnx1v4/patch.input.128 diff --git a/bld/tnx1v4/patch.input.128 b/bld/tnx1v4/patch.input.128 new file mode 100644 index 00000000..94bc2ccc --- /dev/null +++ b/bld/tnx1v4/patch.input.128 @@ -0,0 +1,54 @@ + npes npe mpe idm jdm ibig jbig nreg minsea maxsea avesea + 128 6 22 360 385 60 18 2 0 1080 707 + +ispt( 1) = 57 61 0 0 273 301 +iipe( 1) = 4 23 0 0 28 22 +ispt( 2) = 1 61 178 181 273 301 +iipe( 2) = 60 51 3 3 28 60 +ispt( 3) = 1 61 121 181 241 301 +iipe( 3) = 60 60 60 60 60 60 +ispt( 4) = 1 61 121 181 241 301 +iipe( 4) = 60 60 60 60 60 60 +ispt( 5) = 1 61 121 181 241 301 +iipe( 5) = 60 60 60 60 60 60 +ispt( 6) = 1 61 121 181 241 301 +iipe( 6) = 60 60 60 60 60 60 +ispt( 7) = 1 61 121 181 241 301 +iipe( 7) = 60 60 60 60 60 60 +ispt( 8) = 1 67 121 181 241 301 +iipe( 8) = 41 54 60 60 60 60 +ispt( 9) = 1 71 121 181 241 301 +iipe( 9) = 35 50 60 60 60 60 +ispt( 10) = 1 68 121 181 241 301 +iipe( 10) = 32 53 60 60 60 60 +ispt( 11) = 1 61 121 181 241 301 +iipe( 11) = 60 60 60 60 60 60 +ispt( 12) = 1 61 121 181 241 301 +iipe( 12) = 60 60 60 60 60 60 +ispt( 13) = 1 61 154 181 241 301 +iipe( 13) = 60 56 27 60 60 60 +ispt( 14) = 1 61 149 181 241 301 +iipe( 14) = 60 37 32 60 60 60 +ispt( 15) = 1 61 127 181 241 301 +iipe( 15) = 60 41 54 60 60 60 +ispt( 16) = 1 61 121 229 241 301 +iipe( 16) = 60 60 47 12 60 60 +ispt( 17) = 28 61 121 238 241 301 +iipe( 17) = 33 60 32 3 60 47 +ispt( 18) = 16 61 121 0 247 301 +iipe( 18) = 45 60 18 0 54 43 +ispt( 19) = 16 61 121 0 249 301 +iipe( 19) = 45 60 26 0 52 31 +ispt( 20) = 20 61 121 238 241 301 +iipe( 20) = 41 60 29 3 60 24 +ispt( 21) = 24 61 121 224 241 301 +iipe( 21) = 37 60 34 17 60 32 +ispt( 22) = 1 61 121 181 241 301 +iipe( 22) = 60 60 60 60 60 60 + +jspt( 1) = 1 18 35 52 69 86 104 122 + 140 158 176 194 212 230 248 266 + 284 301 318 335 352 369 +jjpe( 1) = 17 17 17 17 17 18 18 18 + 18 18 18 18 18 18 18 18 + 17 17 17 17 17 17 From 1538c5ee234a498d670e6413435a6ba6207aff2b Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Tue, 15 Aug 2023 18:15:15 +0200 Subject: [PATCH 26/33] updates for tnx2v1 --- cime_config/config_pes.xml | 59 +++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml index a7f93d71..ac18996f 100644 --- a/cime_config/config_pes.xml +++ b/cime_config/config_pes.xml @@ -493,6 +493,43 @@ + + + + Medium sized pe-layout with pes in total + + 15 + 10 + 76 + 155 + 76 + 1 + 1 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 76 + 0 + 91 + 0 + 101 + 0 + 0 + 0 + + + + @@ -570,13 +607,13 @@ - Medium sized pe-layout with 352 pes in total + Medium sized pe-layout with 384 pes in total - 1 - 1 + 18 + 18 76 272 - 80 + 76 1 1 1 @@ -592,13 +629,13 @@ 1 - 0 - 1 - 2 - 4 - 80 - 3 - 3 + 76 + 0 + 94 + 0 + 112 + 0 + 0 0 From 84648b325db21b18ca8d4db50e3cdac5e58f267d Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 18 Aug 2023 11:11:13 +0200 Subject: [PATCH 27/33] premliminary updates for tnx2v1 --- cime_config/namelist_definition_blom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 2c44a118..119c9e39 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -151,6 +151,7 @@ 1800. 4800. + 3600. 4800. 3200. 3600. @@ -167,6 +168,7 @@ 36. 96. + 60. 96. 64. 60. From 9788c599df806fbcb06ca8854ae71b65fb879524 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Wed, 23 Aug 2023 10:57:51 +0200 Subject: [PATCH 28/33] updates to get blom working with cesm2_0_1_release --- cime_config/buildnml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index f79375ce..0dc54dee 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -14,11 +14,10 @@ if _CIMEROOT is None: raise SystemExit("ERROR: must set CIMEROOT environment variable") _LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools") + sys.path.append(_LIBDIR) # pylint: disable=wildcard-import, wrong-import-position # pylint: disable=unused-wildcard-import -from CIME.Tools.standard_script_setup import * -from CIME.XML.standard_module_setup import * from CIME.buildnml import create_namelist_infile, parse_input from CIME.case import Case from CIME.utils import expect @@ -183,8 +182,6 @@ def buildnml(case, caseroot, compname): config["is_test_pfs"] = "yes" if testcase == "PFS" else "no" config["empty_hist"] = "yes" if testcase == "PFS" else "no" - - #--------------------------------- # Set all ParamGen namelist values: #--------------------------------- From 294ce7291f82c0246a1f52d4c8d436a7c2f38f61 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Wed, 23 Aug 2023 12:07:14 +0200 Subject: [PATCH 29/33] updates to get buildnml working with cesm2_0_1_release version of CIME --- cime_config/buildnml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 0dc54dee..5b33c7f7 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -18,10 +18,9 @@ _LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools") sys.path.append(_LIBDIR) # pylint: disable=wildcard-import, wrong-import-position # pylint: disable=unused-wildcard-import -from CIME.buildnml import create_namelist_infile, parse_input -from CIME.case import Case -from CIME.utils import expect -from case_dict import CaseDict +from CIME.buildnml import create_namelist_infile, parse_input +from CIME.case import Case +from CIME.utils import expect # Save local (cime_config) directory path: _CIME_CONFIG_PATH = os.path.dirname(os.path.abspath(__file__)) @@ -29,6 +28,9 @@ _CIME_CONFIG_PATH = os.path.dirname(os.path.abspath(__file__)) # Add local (cime_config) directory to python path: sys.path.append(_CIME_CONFIG_PATH) +# Add ability to handle using a case as a dictionary rather a CIME case object +from case_dict import CaseDict + #Import BLOM's ParamGen class: from ocn_in_paramgen import OcnInParamGen From aefea219b95fb5d30b9bac4ae4a847e8ad8c3e2f Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Wed, 23 Aug 2023 20:51:03 +0200 Subject: [PATCH 30/33] changes to get the model running with cesm2.0.6 --- cime_config/ParamGen/paramgen.py | 10 ++++++---- cime_config/buildnml | 27 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/cime_config/ParamGen/paramgen.py b/cime_config/ParamGen/paramgen.py index edc18b17..f80c5139 100644 --- a/cime_config/ParamGen/paramgen.py +++ b/cime_config/ParamGen/paramgen.py @@ -16,6 +16,9 @@ ) from CIME.ParamGen.paramgen_utils import eval_formula +#print (f"sys.version_info.major is {sys.version_info.major}") +#print (f"sys.version_info.minor is {sys.version_info.minor}") + assert ( sys.version_info.major == 3 and sys.version_info.minor >= 6 ), "ParamGen requires Python 3.6 or later." @@ -150,14 +153,13 @@ def from_xml_nml(cls, input_path, match="last", no_duplicates=False): xmllint_cmd = "{} --xinclude --noout --schema {} {}".format( xmllint, schema_path, input_path ) + stat = subprocess.run( - xmllint_cmd, shell=True, capture_output=True, text=True, check=True + xmllint_cmd, shell=True, check=True ) assert ( stat.returncode == 0 - ), "While checking file {} against nml schema, received following errmsg: {}".format( - input_path, stat.stderr - ) + ), f"While checking file {input_path} against nml schema, run xmllint by hand using command\n{xmllint_cmd}" import xml.etree.ElementTree as ET diff --git a/cime_config/buildnml b/cime_config/buildnml index 5b33c7f7..bf98558f 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -14,13 +14,14 @@ if _CIMEROOT is None: raise SystemExit("ERROR: must set CIMEROOT environment variable") _LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools") +if os.path.exists(_LIBDIR): + sys.path.append(_LIBDIR) +else: + _LIBDIR = os.path.join(_CIMEROOT,"scripts","lib","CIME") + sys.path.append(os.path.join(_CIMEROOT, "scripts", "Tools")) -sys.path.append(_LIBDIR) -# pylint: disable=wildcard-import, wrong-import-position -# pylint: disable=unused-wildcard-import -from CIME.buildnml import create_namelist_infile, parse_input -from CIME.case import Case -from CIME.utils import expect +if not os.path.exists(_LIBDIR): + raise SystemExit("ERROR: _LIBDIR does not exist") # Save local (cime_config) directory path: _CIME_CONFIG_PATH = os.path.dirname(os.path.abspath(__file__)) @@ -29,9 +30,15 @@ _CIME_CONFIG_PATH = os.path.dirname(os.path.abspath(__file__)) sys.path.append(_CIME_CONFIG_PATH) # Add ability to handle using a case as a dictionary rather a CIME case object -from case_dict import CaseDict +# pylint: disable=wildcard-import, wrong-import-position +# pylint: disable=unused-wildcard-import +from standard_script_setup import * +from CIME.buildnml import create_namelist_infile, parse_input +from CIME.case import Case +from CIME.utils import expect +from case_dict import CaseDict -#Import BLOM's ParamGen class: +# Import BLOM's ParamGen class: from ocn_in_paramgen import OcnInParamGen # Open CIME case log: @@ -189,8 +196,8 @@ def buildnml(case, caseroot, compname): #--------------------------------- case_dict = CaseDict() - var_list = ('DIN_LOC_ROOT', 'RUN_TYPE', 'BLOM_VCOORD', - 'CCSM_CO2_PPMV', 'HAMOCC_SEDSPINUP_YR_START', + var_list = ('DIN_LOC_ROOT', 'RUN_TYPE', 'BLOM_VCOORD', + 'CCSM_CO2_PPMV', 'HAMOCC_SEDSPINUP_YR_START', 'HAMOCC_SEDSPINUP_YR_END') for item in var_list: From 284af11a18f1765fc2975728e389264b629b14c2 Mon Sep 17 00:00:00 2001 From: JorgSchwinger Date: Wed, 27 Sep 2023 09:00:40 +0200 Subject: [PATCH 31/33] Set default of swaclimfileto empty string to avoid crash for grids other than tnx1v4 --- cime_config/namelist_definition_blom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 119c9e39..68612039 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -3516,7 +3516,7 @@ bgcnml bgcnml - UNSET + '' $DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc File name (incl. full path) for swa climatology field (needed if bromoform scheme is activated) From c842f567ccc6a926b41ca38ebc8596b6d3ae2a0f Mon Sep 17 00:00:00 2001 From: JorgSchwinger Date: Wed, 27 Sep 2023 14:12:13 +0200 Subject: [PATCH 32/33] Fix missing variables in use statements for C-isotope code --- hamocc/aufr_bgc.F90 | 3 +++ hamocc/aufw_bgc.F90 | 15 +++++++++------ hamocc/beleg_vars.F90 | 3 +++ hamocc/carchm.F90 | 4 ++++ hamocc/mo_boxatm.F90 | 6 +++--- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/hamocc/aufr_bgc.F90 b/hamocc/aufr_bgc.F90 index 3338d2dc..6b40d8fe 100644 --- a/hamocc/aufr_bgc.F90 +++ b/hamocc/aufr_bgc.F90 @@ -129,6 +129,9 @@ SUBROUTINE AUFR_BGC(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc, & use mo_carbch, only: ocetra use mo_biomod, only: bifr13,bifr14,c14fac,re1312,re14to use mo_param1_bgc, only: icalc13,icalc14,idet13,idet14,idoc13,idoc14,iphy13,iphy14,isco213,isco214,izoo13,izoo14,safediv +#ifndef sedbypass + use mo_param1_bgc, only: issso13,issso14,isssc13,isssc14,ipowc13,ipowc14 +#endif #endif #ifdef natDIC use mo_param1_bgc, only: inatalkali,inatcalc,inatsco212 diff --git a/hamocc/aufw_bgc.F90 b/hamocc/aufw_bgc.F90 index ee2132b6..6c615a5b 100644 --- a/hamocc/aufw_bgc.F90 +++ b/hamocc/aufw_bgc.F90 @@ -120,6 +120,9 @@ SUBROUTINE AUFW_BGC(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc, & #endif #ifdef cisonew use mo_param1_bgc, only: icalc13,icalc14,idet13,idet14,idoc13,idoc14,iphy13,iphy14,isco213,isco214,izoo13,izoo14 +#ifndef sedbypass + use mo_param1_bgc, only: issso13,issso14,isssc13,isssc14,ipowc13,ipowc14 +#endif #endif #ifdef natDIC use mo_param1_bgc, only: inatalkali,inatcalc,inatsco212 @@ -672,27 +675,27 @@ SUBROUTINE AUFW_BGC(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc, & #ifdef cisonew CALL NETCDF_DEF_VARDB(ncid,6,'ssso13',3,ncdimst,ncvarid, & & 9,'kmol/m**3',37,'Sediment accumulated organic carbon13', & - & rmasks,81,io_stdo_bgc) + & rmissing,81,io_stdo_bgc) CALL NETCDF_DEF_VARDB(ncid,6,'ssso14',3,ncdimst,ncvarid, & & 9,'kmol/m**3',37,'Sediment accumulated organic carbon14', & - & rmasks,82,io_stdo_bgc) + & rmissing,82,io_stdo_bgc) CALL NETCDF_DEF_VARDB(ncid,6,'sssc13',3,ncdimst,ncvarid, & & 9,'kmol/m**3',40,'Sediment accumulated calcium carbonate13', & - & rmasks,83,io_stdo_bgc) + & rmissing,83,io_stdo_bgc) CALL NETCDF_DEF_VARDB(ncid,6,'sssc14',3,ncdimst,ncvarid, & & 9,'kmol/m**3',40,'Sediment accumulated calcium carbonate14', & - & rmasks,84,io_stdo_bgc) + & rmissing,84,io_stdo_bgc) CALL NETCDF_DEF_VARDB(ncid,6,'powc13',3,ncdimst,ncvarid, & & 9,'kmol/m**3',25,'Sediment pore water DIC13', & - & rmasks,85,io_stdo_bgc) + & rmissing,85,io_stdo_bgc) CALL NETCDF_DEF_VARDB(ncid,6,'powc14',3,ncdimst,ncvarid, & & 9,'kmol/m**3',25,'Sediment pore water DIC14', & - & rmasks,86,io_stdo_bgc) + & rmissing,86,io_stdo_bgc) #endif IF((mnproc==1 .AND. IOTYPE==0) .OR. IOTYPE==1) THEN diff --git a/hamocc/beleg_vars.F90 b/hamocc/beleg_vars.F90 index a470090c..e897d73f 100644 --- a/hamocc/beleg_vars.F90 +++ b/hamocc/beleg_vars.F90 @@ -72,6 +72,9 @@ SUBROUTINE BELEG_VARS(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask, & #ifdef cisonew use mo_biomod, only: bifr13,bifr14,c14fac,re1312,re14to use mo_param1_bgc, only: icalc13,icalc14,idet13,idet14,idoc13,idoc14,iphy13,iphy14,isco213,isco214,izoo13,izoo14,safediv +#ifndef sedbypass + use mo_param1_bgc, only: ipowc13,ipowc14,issso13,issso14,isssc13,isssc14 +#endif #endif #ifdef natDIC use mo_param1_bgc, only: inatcalc diff --git a/hamocc/carchm.F90 b/hamocc/carchm.F90 index 15263ab4..b86cce9a 100644 --- a/hamocc/carchm.F90 +++ b/hamocc/carchm.F90 @@ -113,6 +113,10 @@ SUBROUTINE CARCHM(kpie,kpje,kpke,kbnd, & #ifdef cisonew use mo_carbch, only: co213fxd,co213fxu,co214fxd,co214fxu,c14dec use mo_param1_bgc, only: iatmc13,iatmc14,icalc13,icalc14,idet14,idoc14,iphy14,isco213,isco214,izoo14,safediv +#ifndef sedbypass + use mo_param1_bgc, only: ks,issso14,isssc14,ipowc14 + use mo_sedmnt, only: sedlay,powtra,burial +#endif #endif #ifdef natDIC use mo_carbch, only: atm_co2_nat,nathi,natco3,natpco2d,natomegaa,natomegac diff --git a/hamocc/mo_boxatm.F90 b/hamocc/mo_boxatm.F90 index cbcc9cee..461fad45 100644 --- a/hamocc/mo_boxatm.F90 +++ b/hamocc/mo_boxatm.F90 @@ -62,7 +62,7 @@ subroutine update_boxatm(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask) use mo_carbch, only: c14dec, ocetra use mo_biomod, only: rcar #ifndef sedbypass - use mo_sedmnt, only: seddw,porwat,porsol + use mo_sedmnt, only: powtra,sedlay,seddw,porwat,porsol #endif #endif @@ -141,9 +141,9 @@ subroutine update_boxatm(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask) ztmp1(i,j) = ztmp1(i,j)+ocetra(i,j,k,iphy14) *vol*(1.0-c14dec)*rcar ztmp1(i,j) = ztmp1(i,j)+ocetra(i,j,k,izoo14) *vol*(1.0-c14dec)*rcar #ifndef sedbypass - vol = seddw(k)*pdlxp(i,j)*pdlyp(i,j)*porwat(k)*omask(i,j) ! porewater volume + vol = seddw(k)*pdlxp(i,j)*pdlyp(i,j)*porwat(i,j,k)*omask(i,j) ! porewater volume ztmp1(i,j) = ztmp1(i,j)+powtra(i,j,k,ipowc14) *vol*(1.0-c14dec) - vol = seddw(k)*pdlxp(i,j)*pdlyp(i,j)*porsol(k)*omask(i,j) ! sediment volume + vol = seddw(k)*pdlxp(i,j)*pdlyp(i,j)*porsol(i,j,k)*omask(i,j) ! sediment volume ztmp1(i,j) = ztmp1(i,j)+sedlay(i,j,k,issso14) *vol*(1.0-c14dec)*rcar ztmp1(i,j) = ztmp1(i,j)+sedlay(i,j,k,isssc14) *vol*(1.0-c14dec) #endif From 4556746275d739562f80a98de3b8ffc2f1b1d094 Mon Sep 17 00:00:00 2001 From: Alok Kumar Gupta Date: Tue, 3 Oct 2023 16:09:30 +0200 Subject: [PATCH 33/33] add riverine C-isotope input by Jerry (#277) --- hamocc/mo_apply_rivin.F90 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/hamocc/mo_apply_rivin.F90 b/hamocc/mo_apply_rivin.F90 index 0dfbc528..d81999b7 100644 --- a/hamocc/mo_apply_rivin.F90 +++ b/hamocc/mo_apply_rivin.F90 @@ -90,6 +90,10 @@ subroutine apply_rivin(kpie,kpje,kpke,pddpo,omask,rivin) use mo_param1_bgc, only: nriv,irdin,irdip,irsi,iralk,iriron,irdoc,irdet, & iano3,iphosph,isilica,isco212,iiron,idoc,idet, & ialkali,inatsco212,inatalkali +#ifdef cisonew + use mo_param1_bgc, only: idet13,idet14,idoc13,idoc14,isco213,isco214,safediv +#endif + use mo_vgrid, only: kmle use mo_carbch, only: ocetra,rivinflx @@ -124,6 +128,28 @@ subroutine apply_rivin(kpie,kpje,kpke,pddpo,omask,rivin) volij=volij+pddpo(i,j,k) ENDDO +#ifdef cisonew + ocetra(i,j,1:kmle(i,j),isco213) = ocetra(i,j,1:kmle(i,j),isco213) + & + ocetra(i,j,1:kmle(i,j),isco213)/(ocetra(i,j,1:kmle(i,j),isco212)+safediv)* & + (rivin(i,j,iralk)*fdt/volij + rivin(i,j,irdin)*fdt/volij + rivin(i,j,irdip)*fdt/volij) + ocetra(i,j,1:kmle(i,j),isco214) = ocetra(i,j,1:kmle(i,j),isco214) + & + ocetra(i,j,1:kmle(i,j),isco214)/(ocetra(i,j,1:kmle(i,j),isco212)+safediv)* & + (rivin(i,j,iralk)*fdt/volij + rivin(i,j,irdin)*fdt/volij + rivin(i,j,irdip)*fdt/volij) + + ocetra(i,j,1:kmle(i,j),idoc13) = ocetra(i,j,1:kmle(i,j),idoc13) + & + ocetra(i,j,1:kmle(i,j),idoc13)/(ocetra(i,j,1:kmle(i,j),idoc)+safediv)* & + rivin(i,j,irdoc)*fdt/volij + ocetra(i,j,1:kmle(i,j),idoc14) = ocetra(i,j,1:kmle(i,j),idoc14) + & + ocetra(i,j,1:kmle(i,j),idoc14)/(ocetra(i,j,1:kmle(i,j),idoc)+safediv)* & + rivin(i,j,irdoc)*fdt/volij + + ocetra(i,j,1:kmle(i,j),idet13) = ocetra(i,j,1:kmle(i,j),idet13) + & + ocetra(i,j,1:kmle(i,j),idet13)/(ocetra(i,j,1:kmle(i,j),idet)+safediv)* & + rivin(i,j,irdet)*fdt/volij + ocetra(i,j,1:kmle(i,j),idet14) = ocetra(i,j,1:kmle(i,j),idet14) + & + ocetra(i,j,1:kmle(i,j),idet14)/(ocetra(i,j,1:kmle(i,j),idet)+safediv)* & + rivin(i,j,irdet)*fdt/volij +#endif ! DIC is updated using the assumtions that a_t=a_c+a_n and DIC=a_c (a_t: total ! alkalinity, a_c: carbonate alkalinity, a_n: contribution of nutrients to a_t). ocetra(i,j,1:kmle(i,j),iano3) = ocetra(i,j,1:kmle(i,j),iano3) + rivin(i,j,irdin)*fdt/volij