diff --git a/.github/workflows/check-clm6-aliases.yml b/.github/workflows/check-clm6-aliases.yml index 46e79d6a55..7bdcf8af3b 100644 --- a/.github/workflows/check-clm6-aliases.yml +++ b/.github/workflows/check-clm6-aliases.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Checkout submodules run: | diff --git a/.github/workflows/docker-image-build-publish.yml b/.github/workflows/docker-image-build-publish.yml index 9096434946..d22ab701e6 100644 --- a/.github/workflows/docker-image-build-publish.yml +++ b/.github/workflows/docker-image-build-publish.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - name: Log in to the Container registry @@ -78,7 +78,7 @@ jobs: # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). - name: Generate artifact attestation - uses: actions/attest-build-provenance@v2 + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2 with: subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} subject-digest: ${{ steps.push.outputs.digest }} diff --git a/.github/workflows/docker-image-common.yml b/.github/workflows/docker-image-common.yml index 3522069132..86de4fc2f2 100644 --- a/.github/workflows/docker-image-common.yml +++ b/.github/workflows/docker-image-common.yml @@ -30,14 +30,11 @@ jobs: # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. permissions: contents: read - packages: write - attestations: write - id-token: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Ensure that the repository part of IMAGE_NAME is lowercase. This is needed because Docker requires image names to be entirely lowercase. Note that the *image name* part, set as IMAGE_BASENAME in the env block above, is *not* converted. This will cause the check-version job to fail if the IMAGE_BASENAME contains capitals. We don't want to silently fix that here; rather, we require the user to specify a lowercase IMAGE_BASENAME. - name: Get image name with lowercase repo diff --git a/.github/workflows/docker-image-get-version.yml b/.github/workflows/docker-image-get-version.yml index 1a4ceb87b0..c405b861b5 100644 --- a/.github/workflows/docker-image-get-version.yml +++ b/.github/workflows/docker-image-get-version.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Get version number from Dockerfile and check it id: get-check-version diff --git a/.github/workflows/docs-build-and-deploy.yml b/.github/workflows/docs-build-and-deploy.yml index 1b0c0cb412..a802a0743a 100644 --- a/.github/workflows/docs-build-and-deploy.yml +++ b/.github/workflows/docs-build-and-deploy.yml @@ -40,13 +40,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: # Get all history, ensuring all branches are available for checkout fetch-depth: 0 - name: Setup Pages - uses: actions/configure-pages@v5 + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 # Check out all submodules because we might :literalinclude: something from one - name: Checkout all submodules @@ -60,11 +60,11 @@ jobs: ./build_docs_to_publish -d --site-root https://escomp.github.io/CTSM - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3 with: # Upload publish dir path: 'doc/_publish' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@f33f41b675f0ab2dc5a6863c9a170fe83af3571e # v4 diff --git a/.github/workflows/docs-common.yml b/.github/workflows/docs-common.yml index 9c9d9f386c..a339b0b7f9 100644 --- a/.github/workflows/docs-common.yml +++ b/.github/workflows/docs-common.yml @@ -21,7 +21,7 @@ jobs: build-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 lfs: true @@ -35,12 +35,12 @@ jobs: # Based on https://github.com/actions/cache/blob/main/examples.md#python---pip - name: Install python if: ${{ ! inputs.use_conda }} - uses: actions/setup-python@v2 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.13.2' # needs to be coordinated with version in python/conda_env_ctsm_py.txt - name: Cache pip if: ${{ ! inputs.use_conda }} - uses: actions/cache@v3 + uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('doc/ctsm-docs_container/requirements.txt') }} @@ -54,7 +54,7 @@ jobs: # Do this if using conda - name: Set up conda environment if: ${{ inputs.use_conda }} - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3 with: activate-environment: ${{ inputs.conda_env_name }} environment-file: ${{ inputs.conda_env_file }} diff --git a/.github/workflows/docs-omnibus.yml b/.github/workflows/docs-omnibus.yml index 1c73eb8224..d832478831 100644 --- a/.github/workflows/docs-omnibus.yml +++ b/.github/workflows/docs-omnibus.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 lfs: true @@ -36,7 +36,7 @@ jobs: # Set up conda - name: Set up conda environment - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3 with: activate-environment: ctsm_pylib environment-file: python/conda_env_ctsm_py.yml diff --git a/.github/workflows/docs-update-ctsm_pylib.yml b/.github/workflows/docs-update-ctsm_pylib.yml index 865f092f92..4ea5af396c 100644 --- a/.github/workflows/docs-update-ctsm_pylib.yml +++ b/.github/workflows/docs-update-ctsm_pylib.yml @@ -53,7 +53,7 @@ jobs: needs: test-build-docs-ctsm_pylib runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Create issue uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 diff --git a/.github/workflows/docs-update-dependency-common.yml b/.github/workflows/docs-update-dependency-common.yml index a64e1a8ad5..7bd0fd8839 100644 --- a/.github/workflows/docs-update-dependency-common.yml +++ b/.github/workflows/docs-update-dependency-common.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 lfs: true @@ -38,7 +38,7 @@ jobs: bin/git-fleximod update -o - name: Set up conda environment - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3 with: activate-environment: ${{ inputs.conda_env_name }} environment-file: ${{ inputs.conda_env_file }} @@ -53,7 +53,7 @@ jobs: makefile-method: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 lfs: true @@ -64,7 +64,7 @@ jobs: bin/git-fleximod update -o - name: Set up conda environment - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3 with: activate-environment: ${{ inputs.conda_env_name }} environment-file: ${{ inputs.conda_env_file }} diff --git a/.github/workflows/docs-update-doc-builder.yml b/.github/workflows/docs-update-doc-builder.yml index 0756ed94c5..1194e1c153 100644 --- a/.github/workflows/docs-update-doc-builder.yml +++ b/.github/workflows/docs-update-doc-builder.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 lfs: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 362818eb90..780ba31b64 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -51,7 +51,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Check out all submodules because we might :literalinclude: something from one - name: Checkout all submodules diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a13e594acd..79ad016da2 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -22,10 +22,10 @@ jobs: runs-on: ubuntu-latest steps: # Checkout the code - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Set up the conda environment - - uses: conda-incubator/setup-miniconda@v3 + - uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3 with: activate-environment: ctsm_pylib environment-file: python/conda_env_ctsm_py.yml @@ -42,10 +42,10 @@ jobs: runs-on: ubuntu-latest steps: # Checkout the code - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Set up the conda environment - - uses: conda-incubator/setup-miniconda@v3 + - uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3 with: activate-environment: ctsm_pylib environment-file: python/conda_env_ctsm_py.yml diff --git a/.github/workflows/xml-check.yml b/.github/workflows/xml-check.yml index 18cc6b4079..d944222dfc 100644 --- a/.github/workflows/xml-check.yml +++ b/.github/workflows/xml-check.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.x' diff --git a/.gitmodules b/.gitmodules index b6615c41fc..7798b4b9a2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -44,7 +44,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper [submodule "rtm"] path = components/rtm url = https://github.com/ESCOMP/RTM -fxtag = rtm1_0_87 +fxtag = rtm1_0_88 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/RTM @@ -52,7 +52,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/RTM [submodule "mosart"] path = components/mosart url = https://github.com/ESCOMP/MOSART -fxtag = mosart1.1.09 +fxtag = mosart1.1.10 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/MOSART @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.43 +fxtag = ccs_config_cesm1.0.48 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git @@ -76,7 +76,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git [submodule "cime"] path = cime url = https://github.com/ESMCI/cime -fxtag = cime6.1.102 +fxtag = cime6.1.107 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/cime @@ -84,7 +84,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps1.0.48 +fxtag = cmeps1.1.2 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git @@ -92,7 +92,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git [submodule "cdeps"] path = components/cdeps url = https://github.com/ESCOMP/CDEPS.git -fxtag = cdeps1.0.75 +fxtag = cdeps1.0.79 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git @@ -108,7 +108,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share [submodule "parallelio"] path = libraries/parallelio url = https://github.com/NCAR/ParallelIO -fxtag = pio2_6_4 +fxtag = pio2_6_6 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/ParallelIO diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fa8f41af55..4cd02532f8 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -994,7 +994,7 @@ sub setup_cmdl_bgc { # Set soil matrix (which is needed later for spinup) $var = "use_soil_matrixcn"; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - , 'use_fates'=>$nl_flags->{'use_fates'}, + , 'use_fates'=>$nl_flags->{'use_fates'}, , 'soil_decomp_method'=>$nl_flags->{'soil_decomp_method'}, , 'phys'=>$nl_flags->{'phys'}, clm_accelerated_spinup=>$nl_flags->{'clm_accelerated_spinup'} ); if ( &value_is_true($nl->get_value($var)) ) { @@ -1230,7 +1230,7 @@ sub setup_cmdl_spinup { if ( &value_is_true($nl_flags->{'use_cn'}) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "spinup_state", clm_accelerated_spinup=>$nl_flags->{'clm_accelerated_spinup'}, - use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'}, + use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'}, use_soil_matrixcn=>$nl_flags->{"use_soil_matrixcn"} ); if ( $nl->get_value("spinup_state") ne 0 ) { $nl_flags->{'bgc_spinup'} = "on"; @@ -1803,6 +1803,7 @@ sub process_namelist_inline_logic { # NOTE: After setup_logic_dust_emis # ##################################### setup_logic_megan($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_megan_opts($opts, $nl_flags, $definition, $defaults, $nl); ################################## # namelist group: lai_streams # @@ -4176,6 +4177,7 @@ sub setup_logic_dust_emis { sub setup_logic_megan { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + # Setup megan_emis_nl namelist for drv_flds_in my $var = "megan"; @@ -4205,6 +4207,29 @@ sub setup_logic_megan { #------------------------------------------------------------------------------- +sub setup_logic_megan_opts { + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + # Setup megan_opts namelist + # This should be set when megan is turned on by CTSM, but also when CAM has turned it on + + if ($nl_flags->{'megan'} ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'megan_use_gamma_sm'); + if ( &value_is_true( $nl->get_value('megan_use_gamma_sm') ) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'megan_min_gamma_sm'); + } elsif ( defined($nl->get_value('megan_min_gamma_sm')) ) { + $log->fatal_error("megan_min_gamma_sm should NOT be set when megan_use_gamma_sm NOT TRUE.\n" ); + } + } + else { + if ( defined($nl->get_value('megan_use_gamma_sm')) || + defined($nl->get_value('megan_min_gamma_sm')) ) { + $log->fatal_error("MEGAN options should NOT be set when MEGAN is NOT in use.\n" ); + } + } +} + +#------------------------------------------------------------------------------- + sub setup_logic_soilm_streams { my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; @@ -5016,7 +5041,7 @@ sub setup_logic_exice { # excess ice streams, must be set before initial conditions # my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice', 'phys'=>$physv->as_string()); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice', 'phys'=>$physv->as_string()); my $use_exice = $nl->get_value( 'use_excess_ice' ); # Put use_exice into nl_flags so can be referenced later if ( value_is_true($use_exice) ) { @@ -5230,7 +5255,7 @@ sub write_output_files { @groups = qw(clm_inparm ndepdyn_nml popd_streams urbantv_streams light_streams soil_moisture_streams lai_streams atm2lnd_inparm lnd2atm_inparm clm_canopyhydrology_inparm cnphenology - cropcal_streams + cropcal_streams megan_opts clm_soilhydrology_inparm dynamic_subgrid cnvegcarbonstate finidat_consistency_checks dynpft_consistency_checks clm_initinterp_inparm century_soilbgcdecompcascade diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 4876e5bd14..a435bb3b4a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -152,6 +152,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0 0 + +.true. +0.0d00 + NONE ALL diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 174e5f245f..03c9ba420e 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -8,11 +8,11 @@ - Full pathname of initial conditions file. If blank CLM will startup from arbitrary initial conditions. @@ -29,30 +29,30 @@ creating the output file specified by finidat_interp_dest. This requires that finidat be non-blank. - Full pathname of master restart file for a branch run. (only used if RUN_TYPE=branch) (Set with RUN_REFCASE and RUN_REFDATE) - Component name to use in history and restart files - Full pathname of land fraction data file. @@ -78,8 +78,8 @@ Type of CO2 feedback. -Supplemental Nitrogen mode and for what type of vegetation it's turned on for. -In this mode Nitrogen is unlimited rather than prognosed and in general vegetation is +Supplemental Nitrogen mode and for what type of vegetation it's turned on for. +In this mode Nitrogen is unlimited rather than prognosed and in general vegetation is over-productive. NONE = No vegetation types get supplemental Nitrogen ALL = Supplemental Nitrogen is active for all vegetation types @@ -123,7 +123,7 @@ Otherwise use the fraction straight up (the default for CLM5.0) 10SL_3.5m = standard CLM4 and CLM4.5 version -23SL_3.5m = more vertical layers for permafrost simulations +23SL_3.5m = more vertical layers for permafrost simulations 49SL_10m = 49 layer soil column, 10m of soil, 5 bedrock layers 20SL_8.5m = 20 layer soil column, 8m of soil, 5 bedrock layers 4SL_2m = 4 layer soil column, 2m of soil, 0 bedrock layers @@ -427,7 +427,7 @@ Index of solution method of Richards equation. Change method for richards equation solution and boundary conditions. -CLM 4.5 - soilwater_movement_method = 0 (Zeng and Decker, 2009, method). +CLM 4.5 - soilwater_movement_method = 0 (Zeng and Decker, 2009, method). CLM 5.0 - soilwater_movement_method = 1 (adaptive time stepping moisture form from Martyn Clark). 1 (adaptive time stepping moisture form @@ -447,7 +447,7 @@ lower_boundary_condition = 2 : zero-flux lower boundary condition lower_boundary_condition = 3 : water table head-based lower boundary condition w/ aquifer layer. (use with soilwater_movement_method=adaptive time stepping) lower_boundary_condition = 4 : 11-layer solution w/ aquifer layer (only used with soilwater_movement_method=Zeng&Decker 2009) -TODO(bja, 2015-09) these should be strings so they have meaningful names instead of ints. +TODO(bja, 2015-09) these should be strings so they have meaningful names instead of ints. If TRUE, irrigation will be active. - + If TRUE, fsat will be set to zero for crop columns. - + @@ -731,7 +731,7 @@ feature on will result in more memory usage. + group="clm_inparm" valid_values="" value=".false."> Toggle to turn on the tree damage module in FATES (Only relevant if FATES is on) @@ -742,7 +742,7 @@ Turn on spitfire module to simulate fire by setting fates_spitfire_mode > 0. Allowed values are: 0 : Simulations of fire are off 1 : use a global constant lightning rate found in fates_params. - 2 : use an external lightning dataset. + 2 : use an external lightning dataset. 3 : use an external confirmed ignitions dataset (not available through standard CSEM dataset collection). 4 : use external lightning and population datasets to simulate both natural and anthropogenic 5 : use gross domestic production and population datasets to simulate anthropogenic fire supression @@ -751,20 +751,20 @@ ignitions. + group="clm_inparm" valid_values="" value=".false."> Toggle to turn on fixed biogeography mode (Only relevant if FATES is on) -Toggle to turn on no competition mode (only relevant if FATES is being used). + group="clm_inparm" valid_values="" value=".false."> +Toggle to turn on no competition mode (only relevant if FATES is being used). -Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). + group="clm_inparm" valid_values="" value=".false."> +Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). -Full pathname of fates landuse x pft association static data map. +Full pathname of fates landuse x pft association static data map. The file associates land use types with pfts across a static global map. -This file is necessary for running FATES with use_fates_luh, +This file is necessary for running FATES with use_fates_luh, use_fates_nocomp, and use_fates_fixedbiogeo engaged (note that use_fates_lupft is provided as a namelist option to engage all necessary options). The file is output by the FATES land use data tool (https://github.com/NGEET/tools-fates-landusedata) @@ -1014,12 +1014,12 @@ Full pathname of surface data file. Full pathname of hillslope data file. - SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name - SNICAR (SNow, ICe, and Aerosol Radiative model) snow aging data file name @@ -1167,7 +1167,7 @@ Per tape series maximum number of time samples. -Per tape series history file density (i.e. output precision) +Per tape series history file density (i.e. output precision) 1=double precision 2=single precision Default: 2,2,2,2,2,2,2,2,2,2 @@ -1175,7 +1175,7 @@ Per tape series history file density (i.e. output precision) -Per tape series history write frequency. +Per tape series history write frequency. positive means in time steps 0=monthly negative means hours @@ -1227,7 +1227,7 @@ If TRUE, urban traffic flux will be activated (Currently NOT implemented). group="clm_humanindex_inparm" valid_values="ALL,FAST,NONE" > Human heat stress indices: ALL = All indices will be calculated - FAST = A subset of indices will be calculated (will not include the computationally + FAST = A subset of indices will be calculated (will not include the computationally expensive wet bulb calculation and associated indices) NONE = No indices will be calculated @@ -1316,7 +1316,7 @@ nyr_SASU=1: the fastest SASU, but inaccurate; nyr_SASU=nyr_forcing(eg. 20): the -The restart file will be based on the average of all analytic solutions within the iloop_avg^th loop. +The restart file will be based on the average of all analytic solutions within the iloop_avg^th loop. eg. if nyr_forcing = 20, iloop_avg = 8, the restart file in yr 160 will be based on analytic solutions from yr 141 to 160. The number of the analytic solutions within one loop depends on ratio between nyr_forcing and nyr_SASU. eg. if nyr_forcing = 20, nyr_SASU = 5, number of analytic solutions is 20/5=4 @@ -1332,7 +1332,7 @@ Turn on methane model. Standard part of CLM45BGC model. -CLM Biogeochemistry mode : Carbon Nitrogen model (CN) +CLM Biogeochemistry mode : Carbon Nitrogen model (CN) (or CLM45BGC if phys=clm4_5, vsoilc_centbgc='on', and clm4me='on') @@ -1350,7 +1350,7 @@ Requires the CN model to work (either CN or CNDV). -Nitrification/denitrification splits the prognostic mineral N pool into two +Nitrification/denitrification splits the prognostic mineral N pool into two mineral N pools: NO3 and NH4, and includes the transformations between them. Turned on for BGC FATES currently allows it to be true or false, but will be hardwired to true later @@ -1390,17 +1390,17 @@ Toggle to turn on the prognostic crop model -Toggle to turn on the prognostic fertilizer for crop model +Toggle to turn on the prognostic fertilizer for crop model -Toggle to turn on the 1-year grain product pool in the crop model +Toggle to turn on the 1-year grain product pool in the crop model -Fraction of post-harvest crop residues (leaf and stem) to move to +Fraction of post-harvest crop residues (leaf and stem) to move to 1-year product pool instead of letting them fall as litter. Default: 0.0 @@ -1409,7 +1409,7 @@ Fraction of post-harvest crop residues (leaf and stem) to move to group="crop_inparm" valid_values="constant,varytropicsbylat" value="constant"> Type of mapping to use for base temperature for prognostic crop model constant = Just use baset from the PFT parameter file -varytropicsbylat = Vary the tropics by latitude +varytropicsbylat = Vary the tropics by latitude - Parameter to set the type of ozone vegetation stress method - unset = (default) ozone stress vegetation method is off + Parameter to set the type of ozone vegetation stress method + unset = (default) ozone stress vegetation method is off stress_lombardozzi2015 = ozone stress vegetation functions from Danica Lombardozzi 2015 stress_falk = ozone stress vegetation functions from Stefanie Falk (issue #1224) Default: "unset" - - + + Phenology onset depends on the vegetation type @@ -1631,7 +1631,7 @@ by getco2_historical.ncl - Aerosol deposition file name (only used for aerdepregrid.ncl) @@ -1779,14 +1779,14 @@ Colon delimited list of variables to read from the streams file for nitrogen dep + group="ndepdyn_nml" valid_values="bilinear,nn,redist,consd,consf,none" > Mapping method from Nitrogen deposition input file to the model resolution bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation @@ -1808,21 +1808,33 @@ Filename of input stream data for aeolian roughness length (from Prigent's rough mesh filename of input stream data for aeolian roughness length (from Prigent's roughness dataset) + +Mapping method for the Prigent roughness input file to the model resolution +(Only used when use_prigent_roughness is TRUE and normally only needed with the Leung_2023 dust emission method) + bilinear = bilinear interpolation + nn = nearest neighbor + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation + + + group="zendersoilerod" valid_values="bilinear,nn,redist,consd,consf,none" > Option only applying for the Zender_2003 method for whether the soil erodibility file is handled here in CTSM, or in the ATM model. (only used when dust_emis_method is Zender_2003) bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation -Filename of input stream data for finundated inversion of observed (from Prigent dataset) +Filename of input stream data for finundated inversion of observed (from Prigent dataset) to hydrologic variables (either TWS or ZWT) -mesh filename of input stream data for finundated inversion of observed (from Prigent dataset) +mesh filename of input stream data for finundated inversion of observed (from Prigent dataset) to hydrologic variables (either TWS or ZWT) + +Mapping method for the finundated inversion input file to the model resolution +(Only used when use_ch4 is TRUE) + bilinear = bilinear interpolation + nn = nearest neighbor + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation + + @@ -1935,7 +1959,7 @@ Filename of input stream data for LAI -dtlimit (ratio of max/min stream delta times) for LAI streams, which allows for cycling over a year of data +dtlimit (ratio of max/min stream delta times) for LAI streams, which allows for cycling over a year of data @@ -1945,14 +1969,14 @@ Time interpolation method to use with LAI streams + group="lai_streams" valid_values="bilinear,nn,redist,consd,consf,none" > Mapping method from LAI input file to the model resolution bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation @@ -2091,14 +2115,14 @@ Time interpolation method to use with Lightning streams + group="light_streams" valid_values="bilinear,nn,redist,consd,consf,none" > Mapping method from Lightning input file to the model resolution bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation @@ -2138,14 +2162,14 @@ Time interpolation method to use with human population density streams + group="popd_streams" valid_values="bilinear,nn,redist,consd,consf,none" > Mapping method from human population density input file to the model resolution bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation @@ -2185,14 +2209,14 @@ Time interpolation method to use with urban time varying streams + group="urbantv_streams" valid_values="bilinear,nn,redist,consd,consf,none" > Mapping method from urban time varying input file to the model resolution bilinear = bilinear interpolation nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization + none = no interpolation Land mask description for mksurfdata input files - + @@ -2233,7 +2257,7 @@ Resolution of finundated inversion streams dataset (stream_fldfilename_ch4finund to use for methane model (only applies when CN and methane model are turned on) - + Resolution of Lightning dataset to use for CN or FATES fire model @@ -2252,46 +2276,56 @@ Add a note to the output namelist about the options given to build-namelist -CLM run type. +CLM run type. 'default' use the default type of clm_start type for this configuration 'cold' is a run from arbitrary initial conditions 'arb_ic' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found - 'startup' is an initial run with initial conditions provided. + 'startup' is an initial run with initial conditions provided. 'continue' is a restart run. 'branch' is a restart run in which properties of the output history files may be changed. -Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios +Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios The form is SSPn-m.m Where n is the SSP number and m.m is RCP radiative forcing at peak or 2100 in W/m^2 n is just the whole number of the specific SSP scenario. The lower numbers have higher mitigation - the higher numbers less mitigation, more than one SSP can result in the same RCP forcing hist means do NOT use a future scenario, just use historical data. - + Land mask description - + General configuration of model version and atmospheric forcing to tune the model to run under. -This sets the model to run with constants and initial conditions that were set to run well under +This sets the model to run with constants and initial conditions that were set to run well under the configuration of model version and atmospheric forcing. To run well constants would need to be changed to run with a different type of atmospheric forcing. (Some options for the newest physics will be based on previous tuning, and buildnml will let you know about this) - + -If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) - +If 1, turn on the MEGAN model for BVOC's (Biogenic Volatile Organic Compounds) + + + +If TRUE, use activity factor for soil moisture for MEGAN isoprene emissions. + + + +Minimum activity factor for soil moisture for MEGAN isoprene emissions. + + + @@ -2353,8 +2387,8 @@ NOTE: THIS CORRESPONDS DIRECTLY TO THE env_run.xml VARIABLE OF THE SAME NAME. group="default_settings" valid_values="sp,bgc,fates" > Command line arguement for biogeochemistry mode for CLM4.5 sp = Satellitte Phenology - bgc = CLM4.5 BGC model with: - CENTURY model pools + bgc = CLM4.5 BGC model with: + CENTURY model pools Nitrification/De-nitrification Methane model Vertically resolved Carbon @@ -2372,8 +2406,8 @@ Flag for overriding the crash that should occur if user tries to start the model -Flag for setting the state of the Accelerated decomposition spinup state for the BGC model. - 0 = normal model behavior; +Flag for setting the state of the Accelerated decomposition spinup state for the BGC model. + 0 = normal model behavior; 1 = AD spinup (standard) 2 = AD spinup (accelerated spinup from Ricciuto, doesn't work for CNDV and not implemented for CN soil decomposition) Entering and exiting spinup mode occurs automatically by comparing the namelist and restart file values for this variable. @@ -2433,7 +2467,7 @@ Soil decomposition method CENTURYKoven2013 -- CENTURY model in CTSM from Koven et. al. 2013 MIMICSWieder2015 -- MIMICS model in CTSM from Wieder et. al. 2015 -An active soil decomposition method requires the BGC or FATES model to work +An active soil decomposition method requires the BGC or FATES model to work And both BGC and FATES models require an active soil decomposition model @@ -2581,7 +2615,7 @@ Minimum lake depth to increase non-molecular thermal diffusivities by the factor group="clm_inparm" valid_values="" > Factor to increase non-molecular thermal diffusivities for lakes deeper than deepmixing_depthcrit to account for unresolved 3D processes. -Set to 1 to +Set to 1 to -Allows user to tune the value of aereoxid. If set to FALSE, then use the value of aereoxid from +Allows user to tune the value of aereoxid. If set to FALSE, then use the value of aereoxid from the parameter file (set to 0.0, but may be tuned with values in the range {0.0,1.0}. If set to TRUE, then don't fix aere (see ch4Mod.F90). Default: .true. @@ -2640,7 +2674,7 @@ so the coupled system will NOT conserve carbon in this mode if the methane model -Inundated fraction method type to use for the CH4 submodel (possibly affecting soil +Inundated fraction method type to use for the CH4 submodel (possibly affecting soil heterotrophic respiration and denitrification depending on the configuration), h2osfc ----------- Use prognostic saturated fraction h2osfc value calculated in Soil Hydrology @@ -2826,7 +2860,7 @@ Values less than 5 are mainly useful for testing, and should not be used for sci -Maximum snow depth in mm H2O equivalent. Additional mass gains will be capped when this depth +Maximum snow depth in mm H2O equivalent. Additional mass gains will be capped when this depth is exceeded. Changes in this value should possibly be accompanied by changes in: - nlevsno: larger values of h2osno_max should be accompanied by increases in nlevsno @@ -2945,8 +2979,8 @@ differently in areas below and above reset_snow_glc_ela. Only relevant if reset_snow_glc is .true. When resetting snow pack over glacier columns, one can choose to do this over all glacier -columns, or only those below a certain elevation. A typical use case is to reset only those -columns that have a seasonal snow pack in the real world, i.e. SMB less than 0, also known as +columns, or only those below a certain elevation. A typical use case is to reset only those +columns that have a seasonal snow pack in the real world, i.e. SMB less than 0, also known as the equilibrium line altitude (ELA). This parameter sets a single global ELA value. By setting this parameter to a large value (i.e. 10000 m), all glacier columns will be reset. @@ -2993,7 +3027,7 @@ the related bulk quantities. If .true., run with water isotopes - + @@ -3090,7 +3124,7 @@ Initial soil temperature to use for gridcells with excess ice present during a r -Soil depth below which initial excess ice concentration will be applied during a run starting with coldstart (m). Value only applys if use_excess_ice is true. +Soil depth below which initial excess ice concentration will be applied during a run starting with coldstart (m). Value only applys if use_excess_ice is true. If this is set below depth of the soil depth, only the last soil layer will get excess ice. @@ -3113,10 +3147,13 @@ mesh filename of input stream data for excess ice + group="exice_streams" valid_values="bilinear,nn,redist,consd,consf,none" > Mapping method from excess ice input stream data to the model resolution bilinear = bilinear interpolation nn = nearest neighbor + redist = Redistributes data from source mesh to destination mesh + consd = First-order conservative interpolation + consf = Same as consd with fraction area normalization none = no interpolation diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index effca5ea5c..eb0c343d38 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3285; +my $ntests = 3393; if ( defined($opts{'compare'}) ) { - $ntests += 2161; + $ntests += 2061; } plan( tests=>$ntests ); @@ -323,6 +323,7 @@ sub cat_and_create_namelistinfile { "-res 0.9x1.25 -namelist '&a use_lai_streams=.true.,use_soil_moisture_streams=.true./'", "-res 0.9x1.25 -namelist '&a use_excess_ice=.true. use_excess_ice_streams=.true./'", "-res 0.9x1.25 --clm_start_type cold -namelist '&a use_excess_ice=.true. use_excess_ice_streams=.true./'", + "-res 0.9x1.25 --bgc bgc --namelist \"&a urbantvmapalgo='redist' ndepmapalgo='consd' popdensmapalgo='consf'\"", "-res 0.9x1.25 -use_case 1850_control", "-res 1x1pt_US-UMB -clm_usr_name 1x1pt_US-UMB -namelist '&a fsurdat=\"/dev/null\"/'", "-res 1x1_brazil", @@ -1313,6 +1314,14 @@ sub cat_and_create_namelistinfile { namelst=>"use_lai_streams=.true.", phys=>"clm5_0", }, + "megan_opts_wo_megan" =>{ options=>"--envxml_dir . --bgc bgc --no-megan", + namelst=>"megan_use_gamma_sm=TRUE, megan_min_gamma_sm=1.0", + phys=>"clm6_0", + }, + "megan_min_wo_megan_use" =>{ options=>"--envxml_dir . --bgc bgc --megan", + namelst=>"megan_use_gamma_sm=FALSE, megan_min_gamma_sm=1.0", + phys=>"clm6_0", + }, "soil_erod_wo_Zender" =>{ options=>"--envxml_dir . --ignore_warnings", namelst=>"dust_emis_method='Leung_2023', stream_meshfile_zendersoilerod = '/dev/null'", phys=>"clm6_0", diff --git a/ccs_config b/ccs_config index fc14c83fd6..4b5e4eb54d 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit fc14c83fd69c1c30612038026d9b3c9af014acfe +Subproject commit 4b5e4eb54d6a0ec7de59065b897d2de2524e0ecf diff --git a/cime b/cime index 1006c39f59..6f184bf93c 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit 1006c39f59577d47994fb3fb897566b2b8fa12ed +Subproject commit 6f184bf93ca6ae4ead11d77dc38639c6cd97149f diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 41f5d2a4ff..478dc59bdd 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -97,6 +97,15 @@ + + + + + + + + + @@ -1673,15 +1682,6 @@ - - - - - - - - - diff --git a/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/README b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/README new file mode 100644 index 0000000000..2037eb7100 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/README @@ -0,0 +1,6 @@ +This test runs different stream mapalgo and tintalgo options for various streams to make sure they work. + +Tests with it need to be at f09 resolution so that the redist option can be tried + + +NOTE: The none option doesn't seem to work, which likely means it only works with data for a single grid point EBK 7/23/2025 diff --git a/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/shell_commands b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/shell_commands new file mode 100644 index 0000000000..d8434d61ea --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/shell_commands @@ -0,0 +1,2 @@ +# -ignore_warnings is needed because we are turning on the Prigent streams even though they aren't needed +./xmlchange --append CLM_BLDNML_OPTS=-ignore_warnings diff --git a/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/user_nl_clm new file mode 100644 index 0000000000..c46d115579 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/f09_ObscureStreamOpts/user_nl_clm @@ -0,0 +1,30 @@ +! Turn Zender on so that the streams file will be used, no matter the compset +dust_emis_method = 'Zender_2003' +zender_soil_erod_source = 'lnd' + +! Make sure excess ice streams are on, no matter the compset +use_excess_ice = .true. +use_excess_ice_streams = .true. + +! Don't turn on prescribed LAI or soil-moisture to reduce complexity here and keep it in the prescribed testmod + +! Turn on any optional streams though + +use_prigent_roughness = .true. + +! Try all the different mapalgo options in the various stream files +! NOTE: The options with redist assume that the data grid is the same resolution as the model +! Which is why the testmod name starts with f09 +ndepmapalgo = 'redist' +ch4finundatedmapalgo = 'redist' +zendersoilerod_mapalgo = 'nn' +lightngmapalgo = 'consf' +popdensmapalgo = 'consd' +urbantvmapalgo = 'redist' +stream_mapalgo_exice = 'nn' +prigentroughnessmapalgo = 'consf' +! Likewise try all the different tintalgo options +ndep_tintalgo = 'lower' +lightng_tintalgo = 'nearest' +popdens_tintalgo = 'linear' ! The default for this is nearest +urbantv_tintalgo = 'upper' diff --git a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN_BNF/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN_BNF/include_user_mods deleted file mode 100644 index 4fbf11b334..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN_BNF/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../flexCN_FUN diff --git a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN_BNF/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN_BNF/user_nl_clm deleted file mode 100644 index 8084f982e1..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN_BNF/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - nfix_method = 'Bytnerowicz' - diff --git a/components/cdeps b/components/cdeps index 472264c96a..b65f283437 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 472264c96a14f9f97cbb087df2c2357c1dcea826 +Subproject commit b65f28343708789f75a0f422a2fb6bc02036474e diff --git a/components/cmeps b/components/cmeps index b7b50a64d6..bd3ff83126 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit b7b50a64d66a76490a9bb39e0050acd179391342 +Subproject commit bd3ff83126516a16263fc7c4c16bbdeb4bd753b3 diff --git a/components/mosart b/components/mosart index c776a802f6..6639daad20 160000 --- a/components/mosart +++ b/components/mosart @@ -1 +1 @@ -Subproject commit c776a802f6f3e5ed853d4adfc7a8db6b8fed28ab +Subproject commit 6639daad2059174c78cf6c1e632964cd3e29a5b7 diff --git a/components/rtm b/components/rtm index dd45b884bc..a8d7b850cb 160000 --- a/components/rtm +++ b/components/rtm @@ -1 +1 @@ -Subproject commit dd45b884bc26bf2ec578f2157a808b138f318fb3 +Subproject commit a8d7b850cb3f46e847a8db45a75e92747cfb704f diff --git a/doc/ChangeLog b/doc/ChangeLog index a54ee50639..6b19a2747b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,147 @@ =============================================================== +Tag name: ctsm5.3.065 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Mon 28 Jul 2025 09:30:35 AM MDT +One-line Summary: Merge b4b-dev to master + +Purpose and description of changes +---------------------------------- + +Implement namelist options for soil moisture activation factor used in MEGAN isoprene emissions. + +Adds a GitHub issue template for things related to documentation. + +Fixes a self-test. + +Adds a broadcast of the namelist value for a few mapalgo items after reading it in so it is consistent across all ranks when not using the default value. Also update the mapalgo options list to be consistent with the NUOPC options, the MCT list was in place before this. + +Update submodules so we are using the latest in cesm development for cesm3_0_alpha07b. + +Harden github actions to improve security (use a hash, rather than a tag, reduce permissions to readonly when possible) + +Update SpinupStability scripts for h0->h0a transition (backwards compatible). +Update run_clm_historical script for nuopc, extension through 2023, produces restart files for 1979 and 2000, and h0->h0a transition (backwards compatible). + +Remove flexCN_FUN_BNF test and testmods as redundant + +Fix string replacements in lreprstruct test: +The previous logic caused problems if "GRAIN" appeared in two (or more) strings, where one was a substring of the other. For example, in LREPRSTRUCT_Ly1_P128x1.f10_f10_mg37.I1850Clm50BgcCrop.derecho_gnu.clm-ciso--clm-cropMonthOutput, before this replacement, one line contained 'GRAINN_TO_FOOD' and a later line contained (among other things) "'GRAINN_TO_FOOD_PERHARV', 'GRAINN_TO_FOOD_ANN'". This was problematic because the first replacement of GRAINN_TO_FOOD incorrectly led to replacements in the later strings as well. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm6_0 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #3316 Fix mpas15a self test + Work on #3016 low MEGAN emissions + Fixes #2533 Fix broadcast of urbantvmapalgo + Fixes #3345 Fix broadcast of other mapalgo namelist items + Fixes #1912 Fix list of valid options for mapalgo namelist items + Fixes #3303 Update submodules to cesm3_0_alpha07b + Fixes #2983 Remove redundant test + Fixes #3316 self test fails for mpasa15 + Fixes #3316 Problem with LREPR* tests + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + Changes to megan_opts namelist only happen if megan is on + You can only set megan_min_gamma_sm if megan_use_gamma_sm is TRUE + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + Two new CTSM megan_opts namelist items: + megan_use_gamma_sm + megan_min_gamma_sm + + Add ch4finundatedmapalgo to namelist XML, was in the code but not in the XML + + Fix the list of options for the mapalgo namelist items: + Remove nnonj, nnoni, spval, copy + Add: consf, consd, none + +Changes made to namelist defaults (e.g., changed parameter values): + Sets defaults for megan_opts namelist to reproduce answers + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + LREPR test was fixed, but didn't have a unit tester for it + +Changes to tests or testing: + Add f09_ObscureStreamOpts testmod and test, and remove a BNF test and testmod + + +Testing summary: regular +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - OK + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - (I still get #3205 when running the testing) + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Other details +------------- + +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): rtm, mostart, ccs_config, cime, cmeps, cdeps, pio + In general update to cesm3_0_alpha07b submodules + RTM to rtm1_0_88 (fixes history metadata) + MOSART to mosart1.1.10 (fixes history metadata) + ccs_config to ccs_config_cesm1.0.48 + CIME to cime6.1.107 + CMEPS to cmeps1.1.2 + CDEPS to cdeps1.0.79 + PIO to pio2_6_6 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + - #3309 + - #3144 + - #3318 + - #2534 + - #3334 + - #3343 + - #3338 + - #3329 + - #3314 + +=============================================================== +=============================================================== Tag name: ctsm5.3.064 Originator(s): slevis (Samuel Levis) Date: Thu 24 Jul 2025 01:13:00 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 5e42dc2189..20b0a8f534 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.065 erik 07/28/2025 Merge b4b-dev to master ctsm5.3.064 slevis 07/24/2025 Add time dimension to 1d_wt fields in transient runs ctsm5.3.063 samrabin 07/10/2025 Merge b4b-dev to master ctsm5.3.062 slevis 07/09/2025 Put inst. and non-inst. fields on separate hist files diff --git a/doc/ctsm-docs_container/Dockerfile b/doc/ctsm-docs_container/Dockerfile index 5c78a0c14f..3a24e1d4a4 100644 --- a/doc/ctsm-docs_container/Dockerfile +++ b/doc/ctsm-docs_container/Dockerfile @@ -29,4 +29,4 @@ CMD ["/bin/bash", "-l"] LABEL org.opencontainers.image.title="Container for building CTSM documentation" LABEL org.opencontainers.image.source=https://github.com/ESCOMP/CTSM -LABEL org.opencontainers.image.version="v1.0.2d" +LABEL org.opencontainers.image.version="v1.0.2e" diff --git a/libraries/parallelio b/libraries/parallelio index a844617662..1d516b8276 160000 --- a/libraries/parallelio +++ b/libraries/parallelio @@ -1 +1 @@ -Subproject commit a844617662cbb2b1a6445bd7560f9095ccefd180 +Subproject commit 1d516b82768ef9d2cade524724c38ab63fbe08e4 diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90 index 7ef81ea281..45866e2632 100644 --- a/src/biogeochem/VOCEmissionMod.F90 +++ b/src/biogeochem/VOCEmissionMod.F90 @@ -75,6 +75,8 @@ module VOCEmissionMod type(megan_out_type), private, pointer :: meg_out(:) ! (n_megan_comps) points to output fluxes ! logical, parameter :: debug = .false. + logical :: megan_use_gamma_sm = .false. + real(r8) :: megan_min_gamma_sm = 0._r8 character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -83,11 +85,65 @@ module VOCEmissionMod contains !------------------------------------------------------------------------ - subroutine Init(this, bounds) + subroutine VOCReadNML(NLFilename) + ! + ! !DESCRIPTION: + ! Read the namelist for CropType + ! + ! !USES: + use fileutils , only : getavu, relavu, opnfil + use shr_nl_mod , only : shr_nl_find_group_name + use spmdMod , only : masterproc, mpicom + use shr_mpi_mod , only : shr_mpi_bcast + use clm_varctl , only : iulog + ! + ! !ARGUMENTS: + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! !LOCAL VARIABLES: + integer :: ierr ! error code + integer :: unitn ! unit for namelist file + + character(len=*), parameter :: subname = 'VOCReadNML' + character(len=*), parameter :: nmlname = 'megan_opts' + + namelist /megan_opts/ megan_use_gamma_sm, megan_min_gamma_sm + + if (masterproc) then + unitn = getavu() + write(iulog,*) 'Read in '//nmlname//' namelist' + call opnfil (NLFilename, unitn, 'F') + call shr_nl_find_group_name(unitn, nmlname, status=ierr) + if (ierr == 0) then + read(unitn, nml=megan_opts, iostat=ierr) + if (ierr /= 0) then + call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) + end if + !else + ! call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) + end if + call relavu( unitn ) + end if + + call shr_mpi_bcast(megan_use_gamma_sm, mpicom) + call shr_mpi_bcast(megan_min_gamma_sm, mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) nmlname//' settings:' + write(iulog,nml=megan_opts) + write(iulog,*) ' ' + end if + + end subroutine VOCReadNML + + !------------------------------------------------------------------------ + subroutine Init(this, bounds, NLFilename) use clm_varctl , only : use_fates, use_fates_sp class(vocemis_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds + character(len=*) , intent(in) :: NLFilename ! Namelist filename if ( shr_megan_mechcomps_n > 0) then if ( use_fates .and. (.not. use_fates_sp) ) then @@ -97,6 +153,10 @@ subroutine Init(this, bounds) call this%InitAllocate(bounds) call this%InitHistory(bounds) call this%InitCold(bounds) + + ! read run-time options + call VOCReadNML(NLFilename) + end if end subroutine Init @@ -112,7 +172,7 @@ subroutine InitAllocate(this, bounds) ! ! !ARGUMENTS: class(vocemis_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: i, imeg @@ -124,7 +184,6 @@ subroutine InitAllocate(this, bounds) type(shr_megan_megcomp_t), pointer :: meg_cmp !----------------------------------------------------------------------- - begg = bounds%begg; endg = bounds%endg begp = bounds%begp; endp = bounds%endp @@ -566,7 +625,11 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, & gamma_l = get_gamma_L(fsun240(p), elai(p)) ! Impact of soil moisture on isoprene emission - gamma_sm = get_gamma_SM(btran(p)) + if (megan_use_gamma_sm) then + gamma_sm = get_gamma_SM(btran(p)) + else + gamma_sm = 1._r8 + end if ! Loop through VOCs for light, temperature and leaf age activity factor & apply ! all final activity factors to baseline emission factors @@ -844,6 +907,8 @@ function get_gamma_SM(btran_in) get_gamma_SM = 1._r8 / (1._r8 + b1 * exp(a1 * (btran_in - btran_threshold))) endif + get_gamma_SM = max(get_gamma_SM, megan_min_gamma_sm) + end function get_gamma_SM !----------------------------------------------------------------------- diff --git a/src/cpl/share_esmf/FireDataBaseType.F90 b/src/cpl/share_esmf/FireDataBaseType.F90 index 13323cd924..fd8b140c95 100644 --- a/src/cpl/share_esmf/FireDataBaseType.F90 +++ b/src/cpl/share_esmf/FireDataBaseType.F90 @@ -246,6 +246,7 @@ subroutine hdm_init( this, bounds, NLFilename ) call shr_mpi_bcast(stream_fldFileName_popdens , mpicom) call shr_mpi_bcast(stream_meshfile_popdens , mpicom) call shr_mpi_bcast(popdens_tintalgo , mpicom) + call shr_mpi_bcast(popdensmapalgo , mpicom) if (masterproc) then write(iulog,'(a)' ) ' ' @@ -413,6 +414,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) call shr_mpi_bcast(stream_fldFileName_lightng , mpicom) call shr_mpi_bcast(stream_meshfile_lightng , mpicom) call shr_mpi_bcast(lightng_tintalgo , mpicom) + call shr_mpi_bcast(lightngmapalgo , mpicom) if (masterproc) then write(iulog,'(a)') ' ' diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index eb537a7031..1e6d004e96 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -174,6 +174,7 @@ subroutine urbantv_init(this, bounds, NLFilename) call shr_mpi_bcast(stream_year_first_urbantv , mpicom) call shr_mpi_bcast(stream_year_last_urbantv , mpicom) call shr_mpi_bcast(model_year_align_urbantv , mpicom) + call shr_mpi_bcast(urbantvmapalgo , mpicom) call shr_mpi_bcast(stream_fldFileName_urbantv , mpicom) call shr_mpi_bcast(stream_meshfile_urbantv , mpicom) call shr_mpi_bcast(urbantv_tintalgo , mpicom) diff --git a/src/cpl/share_esmf/ndepStreamMod.F90 b/src/cpl/share_esmf/ndepStreamMod.F90 index ff91d5a202..f8edd96ffc 100644 --- a/src/cpl/share_esmf/ndepStreamMod.F90 +++ b/src/cpl/share_esmf/ndepStreamMod.F90 @@ -111,6 +111,7 @@ subroutine ndep_init(bounds, NLFilename) call shr_mpi_bcast(model_year_align_ndep , mpicom) call shr_mpi_bcast(ndep_varlist , mpicom) call shr_mpi_bcast(ndep_taxmode , mpicom) + call shr_mpi_bcast(ndepmapalgo , mpicom) call shr_mpi_bcast(ndep_tintalgo , mpicom) call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) call shr_mpi_bcast(stream_meshfile_ndep , mpicom) diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 210cff2c2e..7d9a0f6ad2 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -24,14 +24,14 @@ module clm_instMod ! Constants !----------------------------------------- - use UrbanParamsType , only : urbanparams_type ! Constants + use UrbanParamsType , only : urbanparams_type ! Constants use UrbanParamsType , only : IsSimpleBuildTemp, IsProgBuildTemp use UrbanTimeVarType , only : urbantv_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use CNDVType , only : dgv_ecophyscon ! Constants + use CNDVType , only : dgv_ecophyscon ! Constants !----------------------------------------- - ! Definition of component types + ! Definition of component types !----------------------------------------- use ActiveLayerMod , only : active_layer_type @@ -71,14 +71,14 @@ module clm_instMod use CNFireEmissionsMod , only : fireemis_type use atm2lndType , only : atm2lnd_type use lnd2atmType , only : lnd2atm_type - use lnd2glcMod , only : lnd2glc_type + use lnd2glcMod , only : lnd2glc_type use glc2lndMod , only : glc2lnd_type use glcBehaviorMod , only : glc_behavior_type use TopoMod , only : topo_type use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch + use LandunitType , only : lun + use ColumnType , only : col + use PatchType , only : patch use CLMFatesInterfaceMod , only : hlm_fates_interface_type use SnowCoverFractionBaseMod , only : snow_cover_fraction_base_type use SnowCoverFractionFactoryMod , only : CreateAndInitSnowCoverFraction @@ -87,8 +87,8 @@ module clm_instMod ! use SoilStateInitTimeConstMod , only : SoilStateInitTimeConst use SoilHydrologyInitTimeConstMod , only : SoilHydrologyInitTimeConst - use SurfaceAlbedoMod , only : SurfaceAlbedoInitTimeConst - use LakeCon , only : LakeConInit + use SurfaceAlbedoMod , only : SurfaceAlbedoInitTimeConst + use LakeCon , only : LakeConInit use SoilBiogeochemPrecisionControlMod, only: SoilBiogeochemPrecisionControlInit use SoilWaterMovementMod , only : use_aquifer_layer ! @@ -99,7 +99,7 @@ module clm_instMod ! Instances of component types !----------------------------------------- - ! Physics types + ! Physics types type(active_layer_type), public :: active_layer_inst type(aerosol_type), public :: aerosol_inst type(canopystate_type), public :: canopystate_inst @@ -138,7 +138,7 @@ module clm_instMod class(nutrient_competition_method_type), public, allocatable :: nutrient_competition_method - ! Soil biogeochem types + ! Soil biogeochem types type(soilbiogeochem_state_type) , public :: soilbiogeochem_state_inst type(soilbiogeochem_carbonstate_type) , public :: soilbiogeochem_carbonstate_inst type(soilbiogeochem_carbonstate_type) , public :: c13_soilbiogeochem_carbonstate_inst @@ -171,7 +171,7 @@ module clm_instMod !----------------------------------------------------------------------- subroutine clm_instReadNML( NLFilename ) ! - ! !ARGUMENTS + ! !ARGUMENTS implicit none character(len=*), intent(IN) :: NLFilename ! Namelist filename ! Read in any namelists that must be read for any clm object instances that need it @@ -186,7 +186,7 @@ end subroutine clm_instReadNML !----------------------------------------------------------------------- subroutine clm_instInit(bounds) ! - ! !USES: + ! !USES: use clm_varpar , only : nlevsno use controlMod , only : nlfilename, fsurdat, hillslope_file use domainMod , only : ldomain @@ -196,10 +196,10 @@ subroutine clm_instInit(bounds) use SoilBiogeochemCompetitionMod , only : SoilBiogeochemCompetitionInit use clm_varctl , only : use_excess_ice use ExcessIceStreamType , only : excessicestream_type, UseExcessIceStreams - + use initVerticalMod , only : initVertical use SnowHydrologyMod , only : InitSnowLayers - use accumulMod , only : print_accum_fields + use accumulMod , only : print_accum_fields use SoilWaterRetentionCurveFactoryMod , only : create_soil_water_retention_curve use decompMod , only : get_proc_bounds use BalanceCheckMod , only : GetBalanceCheckSkipSteps @@ -209,7 +209,7 @@ subroutine clm_instInit(bounds) use initVerticalMod , only : setSoilLayerClass use DustEmisFactory , only : create_dust_emissions ! - ! !ARGUMENTS + ! !ARGUMENTS type(bounds_type), intent(in) :: bounds ! processor bounds ! ! !LOCAL VARIABLES: @@ -230,10 +230,10 @@ subroutine clm_instInit(bounds) !---------------------------------------------------------------------- ! Note: h2osno_col and snow_depth_col are initialized as local variables - ! since they are needed to initialize vertical data structures + ! since they are needed to initialize vertical data structures - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc + begp = bounds%begp; endp = bounds%endp + begc = bounds%begc; endc = bounds%endc begl = bounds%begl; endl = bounds%endl call getfil (paramfile, locfn, 0) @@ -255,7 +255,7 @@ subroutine clm_instInit(bounds) ! all of the year. if (lun%itype(l)==istice) then h2osno_col(c) = 100._r8 - else if (lun%itype(l)==istsoil .and. abs(grc%latdeg(g)) >= 60._r8) then + else if (lun%itype(l)==istsoil .and. abs(grc%latdeg(g)) >= 60._r8) then h2osno_col(c) = 100._r8 else h2osno_col(c) = 0._r8 @@ -271,7 +271,7 @@ subroutine clm_instInit(bounds) ! Initialize urban time varying data call urbantv_inst%Init(bounds, NLFilename) - ! Initialize vertical data components + ! Initialize vertical data components call initVertical(bounds, & glc_behavior, & @@ -287,7 +287,7 @@ subroutine clm_instInit(bounds) endif !----------------------------------------------- - ! Set cold-start values for snow levels, snow layers and snow interfaces + ! Set cold-start values for snow levels, snow layers and snow interfaces !----------------------------------------------- call InitSnowLayers(bounds, snow_depth_col(bounds%begc:bounds%endc)) @@ -395,7 +395,7 @@ subroutine clm_instInit(bounds) ! Note - always initialize the memory for ch4_inst call ch4_inst%Init(bounds, soilstate_inst%cellorg_col(begc:endc, 1:), fsurdat, nlfilename) - call vocemis_inst%Init(bounds) + call vocemis_inst%Init(bounds, NLFilename) call fireemis_inst%Init(bounds) @@ -408,7 +408,7 @@ subroutine clm_instInit(bounds) call soilbiogeochem_state_inst%Init(bounds) ! Initialize decompcascade constants - ! Note that init_decompcascade_bgc need + ! Note that init_decompcascade_bgc need ! soilbiogeochem_state_inst to be initialized call init_decomp_cascade_constants( ) @@ -432,7 +432,7 @@ subroutine clm_instInit(bounds) c12_soilbiogeochem_carbonstate_inst=soilbiogeochem_carbonstate_inst) end if - call soilbiogeochem_carbonflux_inst%Init(bounds, carbon_type='c12') + call soilbiogeochem_carbonflux_inst%Init(bounds, carbon_type='c12') if (use_c13) then call c13_soilbiogeochem_carbonflux_inst%Init(bounds, carbon_type='c13') end if @@ -447,7 +447,7 @@ subroutine clm_instInit(bounds) soilbiogeochem_carbonstate_inst%decomp_cpools_col(begc:endc,1:ndecomp_pools), & soilbiogeochem_carbonstate_inst%decomp_cpools_1m_col(begc:endc, 1:ndecomp_pools)) - call soilbiogeochem_nitrogenflux_inst%Init(bounds) + call soilbiogeochem_nitrogenflux_inst%Init(bounds) ! Initialize precision control for soil biogeochemistry call SoilBiogeochemPrecisionControlInit( soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & @@ -463,9 +463,9 @@ subroutine clm_instInit(bounds) call crop_inst%Init(bounds) end if - + ! Initialize the Functionaly Assembled Terrestrial Ecosystem Simulator (FATES) - ! + ! if (use_fates) then call clm_fates%Init(bounds, flandusepftdat) end if @@ -479,14 +479,14 @@ subroutine clm_instInit(bounds) ! ------------------------------------------------------------------------ ! The time manager needs to be initialized before this called is made, since - ! the step size is needed. + ! the step size is needed. call t_startf('init_accflds') call atm2lnd_inst%InitAccBuffer(bounds) call temperature_inst%InitAccBuffer(bounds) - + call water_inst%InitAccBuffer(bounds) call energyflux_inst%InitAccBuffer(bounds) @@ -525,10 +525,10 @@ subroutine clm_instRest(bounds, ncid, flag, writing_finidat_interp_dest_file) ! Define/write/read CLM restart file. ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - + type(bounds_type) , intent(in) :: bounds + type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'define', 'write', 'read' + character(len=*) , intent(in) :: flag ! 'define', 'write', 'read' logical , intent(in) :: writing_finidat_interp_dest_file ! true if we are writing a finidat_interp_dest file (ignored for flag=='read') ! Local variables @@ -566,7 +566,7 @@ subroutine clm_instRest(bounds, ncid, flag, writing_finidat_interp_dest_file) call water_inst%restart(bounds, ncid, flag=flag, & writing_finidat_interp_dest_file = writing_finidat_interp_dest_file, & watsat_col = soilstate_inst%watsat_col(bounds%begc:bounds%endc,:), & - t_soisno_col=temperature_inst%t_soisno_col(bounds%begc:bounds%endc, -nlevsno+1:), & + t_soisno_col=temperature_inst%t_soisno_col(bounds%begc:bounds%endc, -nlevsno+1:), & altmax_lastyear_indx=active_layer_inst%altmax_lastyear_indx_col(bounds%begc:bounds%endc)) call irrigation_inst%restart (bounds, ncid, flag=flag) @@ -623,7 +623,7 @@ subroutine clm_instRest(bounds, ncid, flag, writing_finidat_interp_dest_file) canopystate_inst=canopystate_inst, & soilstate_inst=soilstate_inst, & active_layer_inst=active_layer_inst, & - soilbiogeochem_carbonflux_inst=soilbiogeochem_carbonflux_inst, & + soilbiogeochem_carbonflux_inst=soilbiogeochem_carbonflux_inst, & soilbiogeochem_nitrogenflux_inst=soilbiogeochem_nitrogenflux_inst) end if @@ -631,4 +631,3 @@ subroutine clm_instRest(bounds, ncid, flag, writing_finidat_interp_dest_file) end subroutine clm_instRest end module clm_instMod - diff --git a/src/self_tests/TestNcdioPio.F90 b/src/self_tests/TestNcdioPio.F90 index 3bac472950..379a7432bb 100644 --- a/src/self_tests/TestNcdioPio.F90 +++ b/src/self_tests/TestNcdioPio.F90 @@ -6,7 +6,7 @@ module TestNcdioPio #include "shr_assert.h" use ncdio_pio - use shr_kind_mod, only : r8 => shr_kind_r8 + use shr_kind_mod, only : r4 => shr_kind_r4, r8 => shr_kind_r8 use Assertions, only : assert_equal use clm_varcon, only : nameg use abortutils, only : endrun @@ -443,7 +443,16 @@ subroutine test_read_vars_change_type() local_int_1d_grc(:) = 0._r8 call ncd_io(varname='data_double_1d_grc_float', data=local_int_1d_grc, & dim1name=nameg, ncid=ncid, flag='read') - call assert_equal(expected=int(data_double_1d_grc), actual=local_int_1d_grc, & + ! Note that, in the following assertion, for the expected value, we need to do a + ! two-step conversion: first convert to float (i.e., r4 real), then convert to int. + ! This is because this two-step conversion is done in the process of + ! writing-then-reading (double converted to float upon write, then float converted to + ! int upon read). If we instead convert directly to int, this is prone to rounding + ! errors that can sometimes lead to mismatches (if the actual value is very close to + ! an integer, the double representation can be slightly greater than the integer while + ! the float representation can be slightly smaller, or vice versa). (See also + ! https://github.com/ESCOMP/CTSM/issues/3316.) + call assert_equal(expected=int(real(data_double_1d_grc, r4)), actual=local_int_1d_grc, & msg='data_double_1d_grc_float to int') call write_to_log(subname//': Reading int into logical') diff --git a/tools/contrib/README b/tools/contrib/README index 40a208c96b..d56b185b73 100644 --- a/tools/contrib/README +++ b/tools/contrib/README @@ -6,7 +6,7 @@ available before adding it. These scripts may not be as well tested or supported tools. They are also ONLY assumed to work on the NCAR supercomputer. So paths will be hardwired to assume NCAR directory structures. -The python scripts require the following settings before running on cheyenne: +The python scripts require the following settings before running on Derecho: module load conda ../../py_env_create @@ -16,28 +16,28 @@ Brief description of scripts: create_scrip_file.ncl Create a SCRIP grid file needed for running with WRF -run_clm_historical - does all the setup and submission required to do a 1850-2010 CLM - historical simulation in three separate submissions - v1 - Andrew Slater+Dave Lawrence, 8/2015 +run_clm_historical.v11.csh + does all the setup and submission required to do a 1850-2023 CLM + historical simulation in five separate submissions + v11 - Oleson, 07/2025 modify_singlept_site Modify some data on a surface dataset created by site_and_regional/subset_data -SpinupStability_SP_v9.ncl +SpinupStability_SP_v10.ncl This script assesses the equilibrium state of a Satellite Phenology (SP) spinup run, works on either monthly or annual mean history files - Keith - Oleson 12/2021 + Oleson 07/2025 -SpinupStability_BGC_v10.ncl +SpinupStability_BGC_v11.ncl This script assesses the equilibrium state of a Biogeochemistry (BGC) spinup run, works on either monthly or annual mean history files - Keith - Oleson 12/2021 + Oleson 07/2025 -SpinupStability_BGC_v11_SE.ncl +SpinupStability_BGC_v12_SE.ncl This script assesses the equilibrium state of a ne30pg3 (spectral element) Biogeochemistry (BGC) spinup run, works on either monthly or annual mean - history files - Keith Oleson 03/2025 + history files - Oleson 07/2025 run_clmtowers This script will run any number of flux tower sites. diff --git a/tools/contrib/SpinupStability_BGC_v10.ncl b/tools/contrib/SpinupStability_BGC_v11.ncl similarity index 98% rename from tools/contrib/SpinupStability_BGC_v10.ncl rename to tools/contrib/SpinupStability_BGC_v11.ncl index f0ebcbd7be..d81b38ad9c 100644 --- a/tools/contrib/SpinupStability_BGC_v10.ncl +++ b/tools/contrib/SpinupStability_BGC_v11.ncl @@ -1,14 +1,9 @@ ; NCL script -; SpinupStability_BGC_v10.ncl +; SpinupStability_BGC_v11.ncl ; Script to examine stability of BGC spinup simulation. ; This version operates on either monthly mean or multi-annual mean multi-variable history files ; NOTE: THIS SCRIPT IS ONLY INTENDED FOR USE WITH 2-D LAT/LON GRIDS -; Keith Oleson, Mar 2020 - -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" -load "~oleson/lnd_diag/run/contributed.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" +; Keith Oleson, July 2025 begin @@ -30,17 +25,18 @@ begin ; annual_hist flag to False if your case has monthly mean history files. ; AND set the region (supported options: Global, Arctic, SPT). ; AND set the subper (subsampling period in years, number of years that atm forcing repeats). -; The script assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist +; The script assumes that your history files are in /glade/derecho/scratch/$username/archive/$caseid/lnd/hist ; You need a run consisting of at least three cycles of atmospheric data ;=======================================================================; ; GLOBAL EXAMPLE - caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850AD" - username = "oleson" + caseid = "ctsm53026_BNF_AD" + username = "slevis" annual_hist = True region = "Global" ; Global, Arctic, or SPT (single point) subper = 20 ; Subsampling period in years paleo = False ; Use paleo map + hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) ; SPT (single point) EXAMPLE ; caseid = "clm50_release-clm5.0.15_SPT_GSWP3V1_1850spin" @@ -49,12 +45,13 @@ begin ; region = "SPT" ; Global, Arctic, or SPT (single point) ; subper = 20 ; Subsampling period in years ; paleo = False ; Use paleo map +; hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) do_plot = True ; do_plot = False ;=======================================================================; - data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" + data_dir = "/glade/derecho/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" if ( systemfunc("test -d "+data_dir+"; echo $?" ) .ne. 0 )then print( "Input directory does not exist or not found: "+data_dir ); print( "Make sure username and caseid and base directory is set correctly" ) @@ -85,9 +82,9 @@ begin end if if (annual_hist) then - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*-*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*-*-*"+".nc") else - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*"+".nc") end if flsdims = dimsizes(fls) diff --git a/tools/contrib/SpinupStability_BGC_v11_SE.ncl b/tools/contrib/SpinupStability_BGC_v12_SE.ncl similarity index 99% rename from tools/contrib/SpinupStability_BGC_v11_SE.ncl rename to tools/contrib/SpinupStability_BGC_v12_SE.ncl index 5666016a87..aa044b9c17 100644 --- a/tools/contrib/SpinupStability_BGC_v11_SE.ncl +++ b/tools/contrib/SpinupStability_BGC_v12_SE.ncl @@ -1,9 +1,9 @@ ; NCL script -; SpinupStability_BGC_v11_SE.ncl +; SpinupStability_BGC_v12_SE.ncl ; Script to examine stability of spinup simulation. ; This version operates on either monthly mean or multi-annual mean multi-variable history files ; and supports ne30 grids only -; Keith Oleson, March 2025 +; Keith Oleson, July 2025 ; ; ARH mods, April 2020 - modified to work for unstructured grids via remapping to FV 1 deg. grid. ; KO mods, March 2025 - regrid history file using ncremap to get area and landfrac instead of @@ -41,6 +41,7 @@ begin region = "Global" ; Global subper = 20 ; Subsampling period in years paleo = False ; Use paleo map ; UNTESTED IN THIS VERSION + hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) ;--- ARH mods --- map_method = "conserve" ;bilinear,conserve or patch @@ -81,9 +82,9 @@ begin totecosysc_thresh = 1.0 ; disequilibrium threshold for individual gridcells (gC/m2/yr) if (annual_hist) then - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*-*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*-*-*"+".nc") else - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*"+".nc") end if flsdims = dimsizes(fls) diff --git a/tools/contrib/SpinupStability_SP_v9.ncl b/tools/contrib/SpinupStability_SP_v10.ncl similarity index 97% rename from tools/contrib/SpinupStability_SP_v9.ncl rename to tools/contrib/SpinupStability_SP_v10.ncl index b0bc7ff839..6b3d310234 100644 --- a/tools/contrib/SpinupStability_SP_v9.ncl +++ b/tools/contrib/SpinupStability_SP_v10.ncl @@ -1,13 +1,8 @@ ; NCL script -; SpinupStability_SP_v9.ncl +; SpinupStability_SP_v10.ncl ; Script to examine stability of SP spinup simulation. ; This version operates on either monthly mean or multi-annual mean multi-variable history files -; Keith Oleson, Sep 2018 - -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" -load "~oleson/lnd_diag/run/contributed.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" +; Keith Oleson, July 2025 begin @@ -27,21 +22,24 @@ begin ; To run this script, just enter in your case name and username below. ; AND set the annual_hist flag to "True" if your case has annual mean history files or set ; annual_hist flag to "False" if your case has monthly mean history files. -; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist +; The script assumes that your history files are in /glade/derecho/scratch/$username/archive/$caseid/lnd/hist ;=======================================================================; - caseid = "cesm20exp10j_1deg_CPLHST_nndep_1850pAD" + caseid = "clm50sp_cesm23a02cPPEn08ctsm51d030_1deg_GSWP3V1_1850spin" username = "oleson" annual_hist = "False" cplot = "Global" subper = 20 h2osoi_layer = 8 ; Desired soil layer (layer 8 is about 1m) tsoi_layer = 10 ; Desired soil layer (layer 10 is about 3m) + hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) do_plot = "True" ;=======================================================================; - data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" + data_dir = "/glade/derecho/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" +; FOR TESTING +; data_dir = "/glade/campaign/cgd/tss/common/Land_Only_Simulations/CTSM51_DEV/CLM50_CTSM51_LAND_ONLY_RELEASE/"+caseid+"/lnd/hist/" ; Thresholds glob_thresh_fsh = 0.02 ; global threshold for FSH equilibrium (delta W m-2 / yr) @@ -54,9 +52,9 @@ begin tws_thresh = 0.001 ; disequilibrium threshold for individual gridcells (m) if (annual_hist .eq. "True") then - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*-*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*-*-*"+".nc") else - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*"+".nc") end if flsdims = dimsizes(fls) diff --git a/tools/contrib/run_clm_historical b/tools/contrib/run_clm_historical.v11.csh similarity index 70% rename from tools/contrib/run_clm_historical rename to tools/contrib/run_clm_historical.v11.csh index 775d1aab1d..04e22aa31a 100755 --- a/tools/contrib/run_clm_historical +++ b/tools/contrib/run_clm_historical.v11.csh @@ -2,19 +2,32 @@ ######################################################################################### # -# - Execute this script to do a CLM historical simulation from 1850 - 2014. This +# - Execute this script to do a CLM historical simulation from 1850 - 2023. This # script will complete all the changes required at year 1901 to deal with the # fact that met forcing data does not go back to 1850. # +# - The CASENAME should be the only thing the user needs to change. +# +# - Run this script in the background on a Derecho login node like this: +# ./run_clm_historical.v11.csh >&! run_clm_historical.out & +# CAUTION: Note the hostname (echo $HOST) and the PID for the script and the "sleep" job (identify them using ps -u $USER) +# E.g., +# PID TTY TIME CMD +# 581 ? 00:00:00 sleep +# 30684 ? 00:00:00 run_clm_histori +# If the simulation crashes at any point, you'll need to kill the script and the "sleep" job (kill -9 $PID) +# before restarting the simulation. You will have to run the remainder of the simulation manually. +# # - Unmodified script will do the following. # Part 1: Simulation 1: 1850 - 1870 (21 years) using repeated 1901-1920 forcing # Part 2: Simulation 2: 1871 - 1900 (30 years) using repeated 1901-1920 forcing -# Part 3: Simulation 3+4+5+6: 1901-1988 (four 22 year) simulations using 1901-1988 forcing -# Part 4: Simulation 7: 1989-2004 (one 16 year) branch simulation w/daily output using 1989-2004 forcing -# Part 5: Simulation 8: 2005-2014 (one 10 year) branch simulation w/daily & subdaily output using 2005-2014 forcing +# Part 3: Simulation 3+4+5: 1901-1978 (three 26 year) simulations using 1901-1978 forcing +# Part 4: Simulation 7: 1979-1999 (one 21 year) branch simulation w/daily output using 1979-1999 forcing +# Part 5: Simulation 8: 2000-2023 (one 24 year) branch simulation w/daily & subdaily output using 2000-2023 forcing +# Note that this approach generates year 1979 and 2000 restart files needed for other specific compsets. # # - Script assumes that simulation can run at least 30 years within a 12 hour block on -# Cheyenne. To find the timing in an equivalent sample run, look in the timing +# Derecho. To find the timing in an equivalent sample run, look in the timing # directory and grep as follows > grep 'simulated_years/day' cesm_timing* # # - In the env_batch.xml file for the case.run group ensure the following: @@ -22,22 +35,23 @@ # # - This script assumes that env_mach_pes.xml has been setup and case.setup has already been run # -# - This script makes use of user_nl_datm1901-1920 and user_nl_datm1901-2014 -# # - Before submitting script, make a copy of your modified or unmodified user_nl_clm file # into "original_user_nl_clm". This should only contain namelist items that will not change throughout -# the run. +# the run. You can start with this example: +# /glade/u/home/oleson/run_hist_1850_files/BGC/original_user_nl_clm_ctsm5.3.0 # Create a file called user_nl_clm_histdaily that contains the desired history output namelist items -# for the 1989-2004 simulation +# for the 1979-2023 simulation. You can start with this example: +# /glade/u/home/oleson/run_hist_1850_files/BGC/user_nl_clm_histdaily_ctsm # Create a file called user_nl_clm_histsubdaily that contains the desired history output namelist items -# for the 2005-2014 simulation +# for the 2001-2023 simulation. You can start with this example: +# /glade/u/home/oleson/run_hist_1850_files/BGC/user_nl_clm_histsubdaily_ctsm # # - The atm data files start in 1901, so with : # ALIGN year of 1901, (this is in units of RUN or simulation years) # START year of 1901, (this is in units of FORCE'ing data years) # -# RUN Year : 1850 ... 1860 1861 ... 1870 ... 1880 1881 ... 1890 ... 1900 1901 ... 2014 -# FORCE Year : 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 2014 +# RUN Year : 1850 ... 1860 1861 ... 1870 ... 1880 1881 ... 1890 ... 1900 1901 ... 2023 +# FORCE Year : 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 2023 # # - The script could be broken up into several parts if you want to check the initial set of # simulations. @@ -52,6 +66,12 @@ # ./run_clm_historical.v6.csh ! > & run_historical.out & # - Modify history output for CMIP6 - Keith Oleson January, 2019 # ./run_clm_historical.v7.csh ! > & run_historical.out & +# - Modify to run with nuopc - Keith Oleson September, 2022 +# ./run_clm_historical.v9.csh ! > & run_historical.out & +# - Modify to produce restart files for 1979 and 2000 and run with CRUv7 extension to 2023 - Keith Oleson September, 2024 +# ./run_clm_historical.v10.csh ! > & run_clm_historical.out & +# - Modify to look for either h0 or h0a files - Keith Oleson July, 2025 +# ./run_clm_historical.v11.csh ! > & run_clm_historical.out & ######################################################################################### ######################################################################################### @@ -63,7 +83,10 @@ ######################################################################################### # --- CASENAME is your case name -set CASENAME = 'clm50_release-clm5.0.15_2deg_GSWP3V1_hist' +set CASENAME = 'ctsm530_f19_PPE_TESTv11_hist' + +# --- Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) +set HIST_EXT = 'h0' # --- Set the user namelist file. cp original_user_nl_clm user_nl_clm @@ -79,9 +102,7 @@ cp original_user_nl_clm user_nl_clm ./xmlchange DATM_YR_ALIGN=1901 ./xmlchange DATM_YR_START=1901 ./xmlchange DATM_YR_END=1920 - -# need to use user_nl_datm files to get years right -cp user_nl_datm1901-1920 user_nl_datm +./xmlchange DATM_SKIP_RESTART_READ=FALSE # --- Check that you end up using the correct env_run.xml file set nenvr = `ls -1 env_run*.xml | wc -l` @@ -92,7 +113,7 @@ if ($nenvr > 1) then endif # --- If you have not already built the code, then do so now -#./case.clean_build +#./case.build --clean-all qcmd -- ./case.build # --- Now submit the job and let it run @@ -114,7 +135,7 @@ qcmd -- ./case.build ######################################################################################### -set WDIR = '/glade/scratch/'$USER'/'$CASENAME'/run/' +set WDIR = '/glade/derecho/scratch/'$USER'/'$CASENAME'/run/' set DONE_RUNA = 0 set DONE_ARCHIVE = 0 set RESTART_FILE = $WDIR$CASENAME'.clm2.r.1871-01-01-00000.nc' @@ -125,7 +146,7 @@ while ($DONE_RUNA == 0) set DONE_RUNA = 1 echo '1850-1870 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm?.h0a.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm2.{$HIST_EXT}.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -152,12 +173,12 @@ end ######################################################################################### # # This portion checks to see if the 1871-1900 portion of the run is done (or it waits -# 10 minutes before checking again). It then removes (or rather moves and renames) the -# datm files so that the model will use the full array of data from 1901-2014. -# This part runs with forcing data files that actually exist for 1901-2014 +# 10 minutes before checking again). It then sets DATM_SKIP_RESTART_READ to TRUE +# so that the model will use the full array of forcing data from 1901-2023. # -# This will start the run from 1901 (hence the CONTINUE_RUN=TRUE) and do four 22 year -# simulations: 1901 + 4*22 - 1 = 1988 (minus 1 because we do 1901) +# This will start the run from 1901 (hence the CONTINUE_RUN=TRUE) and do three 26 year +# simulations: 1901 + 3*26 - 1 = 1978 (minus 1 because we do 1901) +# This will give us a restart file at the beginning of 1979. # # The new values for env_run.xml are put in place # Then submit the job @@ -165,8 +186,7 @@ end ######################################################################################### -set WDIR = '/glade/scratch/'$USER'/'$CASENAME'/run/' -set DDIR = $WDIR'restart_dump/' +set WDIR = '/glade/derecho/scratch/'$USER'/'$CASENAME'/run/' set DONE_RUNA = 0 set DONE_ARCHIVE = 0 set RESTART_FILE = $WDIR$CASENAME'.clm2.r.1901-01-01-00000.nc' @@ -177,7 +197,7 @@ while ($DONE_RUNA == 0) set DONE_RUNA = 1 echo '1850-1900 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm?.h0a.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm2.{$HIST_EXT}.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -192,25 +212,16 @@ while ($DONE_RUNA == 0) endif end -# --- If the first two sets of simulations are done, move the datm files and compress them -if (! -d $DDIR) then - mkdir $DDIR -endif -mv -i $WDIR$CASENAME.datm.rs1*.bin $DDIR -gzip $DDIR$CASENAME*.bin - -# Since this particular run won't go for 55 years in 12 hours, do this in four 22 year chunks, thus -# we have to resubmit the job 3 times. +# Since this particular run won't go for 78 years in 12 hours, do this in three 26 year chunks, thus +# we have to resubmit the job 2 times. +./xmlchange DATM_SKIP_RESTART_READ=TRUE ./xmlchange STOP_OPTION=nyears -./xmlchange STOP_N=22 +./xmlchange STOP_N=26 ./xmlchange DATM_YR_ALIGN=1901 ./xmlchange DATM_YR_START=1901 -./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_END=2023 ./xmlchange CONTINUE_RUN=TRUE -./xmlchange RESUBMIT=3 - -# need to use user_nl_datm files to get years right -cp user_nl_datm1901-2014 user_nl_datm +./xmlchange RESUBMIT=2 # --- Check that you end up using the correct env_run.xml file set nenvr = `ls -1 env_run*.xml | wc -l` @@ -227,22 +238,23 @@ endif # PART 4 ######################################################################################### # -# This portion checks to see if the 1901-1988 part of the run is complete -# and then runs the model for 1989-2004 as a branch run to get daily output +# This portion checks to see if the 1901-1978 part of the run is complete +# and then runs the model for 1979-1999 as a branch run to get daily output +# and to get a restart file at the beginning of 2000 # ######################################################################################### set DONE_RUNA = 0 set DONE_ARCHIVE = 0 -set RESTART_FILE = $WDIR$CASENAME'.clm2.r.1989-01-01-00000.nc' +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.1979-01-01-00000.nc' # --- Check if the second set of simulations have completed and the data archived (every ten minutes) while ($DONE_RUNA == 0) if (-e $RESTART_FILE) then set DONE_RUNA = 1 - echo '1901-1989 run is complete' + echo '1901-1978 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm?.h0a.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm2.{$HIST_EXT}.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -260,9 +272,9 @@ end # --- Ensure that the env_run.xml file has the correct content ./xmlchange RUN_TYPE=branch ./xmlchange RUN_REFCASE={$CASENAME} -./xmlchange RUN_REFDATE=1989-01-01 +./xmlchange RUN_REFDATE=1979-01-01 ./xmlchange STOP_OPTION=nyears -./xmlchange STOP_N=16 +./xmlchange STOP_N=21 ./xmlchange CONTINUE_RUN=FALSE ./xmlchange RESUBMIT=0 @@ -280,22 +292,22 @@ cat user_nl_clm_histdaily >> user_nl_clm # PART 5 ######################################################################################### # -# This portion checks to see if the 1989-2004 part of the run is complete -# and then runs the model for 2005-2014 as a branch run to get daily and subdaily output +# This portion checks to see if the 1979-1999 part of the run is complete +# and then runs the model for 2000-2023 as a branch run to get daily and subdaily output # ######################################################################################### set DONE_RUNA = 0 set DONE_ARCHIVE = 0 -set RESTART_FILE = $WDIR$CASENAME'.clm2.r.2005-01-01-00000.nc' +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.2000-01-01-00000.nc' # --- Check if the second set of simulations have completed and the data archived (every ten minutes) while ($DONE_RUNA == 0) if (-e $RESTART_FILE) then set DONE_RUNA = 1 - echo '1989-2004 run is complete' + echo '1979-1999 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm?.h0a.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm2.{$HIST_EXT}.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -313,9 +325,9 @@ end # --- Ensure that the env_run.xml file has the correct content ./xmlchange RUN_TYPE=branch ./xmlchange RUN_REFCASE={$CASENAME} -./xmlchange RUN_REFDATE=2005-01-01 +./xmlchange RUN_REFDATE=2000-01-01 ./xmlchange STOP_OPTION=nyears -./xmlchange STOP_N=10 +./xmlchange STOP_N=24 ./xmlchange CONTINUE_RUN=FALSE ./xmlchange RESUBMIT=0 @@ -334,22 +346,22 @@ cat user_nl_clm_histsubdaily >> user_nl_clm ######################################################################################### # -# This portion checks to see if the 2005-2014 part of the run is complete +# This portion checks to see if the 2005-2023 part of the run is complete # and ends the script # ######################################################################################### set DONE_RUNA = 0 set DONE_ARCHIVE = 0 -set RESTART_FILE = $WDIR$CASENAME'.clm2.r.2015-01-01-00000.nc' +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.2024-01-01-00000.nc' # --- Check if the second set of simulations have completed and the data archived (every ten minutes) while ($DONE_RUNA == 0) if (-e $RESTART_FILE) then set DONE_RUNA = 1 - echo '2005-2014 run is complete' + echo '2005-2023 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm?.h0a.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm2.{$HIST_EXT}.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1