diff --git a/.github/workflows/check-compset-aliases.yml b/.github/workflows/check-compset-aliases.yml
index bdafb7aa9b..ccad0dba3d 100644
--- a/.github/workflows/check-compset-aliases.yml
+++ b/.github/workflows/check-compset-aliases.yml
@@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Checkout submodules
run: |
diff --git a/.github/workflows/check-testlists.yml b/.github/workflows/check-testlists.yml
index 172fa6d2f5..3a04a5efb2 100644
--- a/.github/workflows/check-testlists.yml
+++ b/.github/workflows/check-testlists.yml
@@ -17,20 +17,28 @@ on:
- 'cime_config/testdefs/testlist_clm.xml'
- '.github/workflows/check-testlists.yml'
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
jobs:
testlist-supertestlists:
runs-on: ubuntu-latest
steps:
# Checkout the code
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+
+ # Check out doc-builder to get requirements.txt
+ - name: Checkout doc-builder submodule
+ run: |
+ bin/git-fleximod update doc-builder
# Set up the conda environment
- - uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3
+ - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
activate-environment: ctsm_pylib
environment-file: python/conda_env_ctsm_py.yml
channels: conda-forge
- auto-activate-base: false
+ auto-activate: false
- name: Print installed Python packages
run: conda list
diff --git a/.github/workflows/docker-image-build-publish.yml b/.github/workflows/docker-image-build-publish.yml
deleted file mode 100644
index d22ab701e6..0000000000
--- a/.github/workflows/docker-image-build-publish.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-# Based on https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action (last accessed 2025-05-09)
-name: Build and publish ctsm-docs Docker image
-
-on:
- # Run this whenever a change to certain files gets pushed to master
- push:
- branches: ['master']
- paths:
- - 'doc/ctsm-docs_container/**'
- - '!doc/ctsm-docs_container/README.md'
-
- # Run this whenever it's manually called
- workflow_dispatch:
-
-jobs:
- # This first job checks that the container can be built, and that we can use it to build the docs without error.
- build-image-and-test-docs:
- name: Build image and test docs
- uses: ./.github/workflows/docker-image-common.yml
- secrets: inherit
-
- # This second job actually builds and publishes the container.
- push-and-attest:
- name: Publish and attest
- runs-on: ubuntu-latest
-
- # Wait to run this job until after build-image-and-test-docs. If that job fails, something might be wrong with the container, so don't try this one. (It might also have failed because of something wrong with doc-builder or the documentation.)
- needs: build-image-and-test-docs
-
- # Variables output by the build-image-and-test-docs job.
- env:
- REGISTRY: ${{ needs.build-image-and-test-docs.outputs.REGISTRY }}
- IMAGE_NAME: ${{ needs.build-image-and-test-docs.outputs.IMAGE_NAME }}
- VERSION_TAG: ${{ needs.build-image-and-test-docs.outputs.version_tag }}
-
- # 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@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
- uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- # This step sets up Docker Buildx, which is needed for the multi-platform build in the next step
- # https://docs.docker.com/build/ci/github-actions/multi-platform/
- # v3.1.0
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
-
- # This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
- # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
- # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- # Note that we should avoid relying on the "latest" tag for anything, but it's good practice to have one.
- # v6.15.0
- - name: Push Docker image
- id: push
- uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
- with:
- context: doc/ctsm-docs_container
- platforms: linux/amd64,linux/arm64
- push: true
- load: false
- tags: |
- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- ${{ env.VERSION_TAG }}
- labels: ""
-
- # 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@e8998f949152b193b063cb0ec769d69d929409be # v2
- with:
- subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- subject-digest: ${{ steps.push.outputs.digest }}
- push-to-registry: true
-
diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml
deleted file mode 100644
index 6d38e12c8b..0000000000
--- a/.github/workflows/docker-image-build.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-# Modified from https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action (last accessed 2025-05-09)
-name: Build and test ctsm-docs container
-
-# Configures this workflow to run every time a change in the Docker container setup is pushed or included in a PR
-on:
- push:
- # Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
- branches: ['*']
- paths:
- - 'doc/ctsm-docs_container/**'
- - '!doc/ctsm-docs_container/README.md'
- - '.github/workflows/docker-image-common.yml'
-
- pull_request:
- # Run on pull requests that change the listed files
- paths:
- - 'doc/ctsm-docs_container/**'
- - '!doc/ctsm-docs_container/README.md'
- - '.github/workflows/docker-image-common.yml'
-
- workflow_dispatch:
-
-# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
-jobs:
- build-image-and-test-docs:
- name: Build image and test docs
- uses: ./.github/workflows/docker-image-common.yml
- secrets: inherit
diff --git a/.github/workflows/docker-image-common.yml b/.github/workflows/docker-image-common.yml
deleted file mode 100644
index 86de4fc2f2..0000000000
--- a/.github/workflows/docker-image-common.yml
+++ /dev/null
@@ -1,97 +0,0 @@
-name: Workflow used by docker-image workflows
-
-on:
- workflow_call:
- outputs:
- REGISTRY:
- description: "Container registry"
- value: ${{ jobs.build-image-and-test-docs.outputs.REGISTRY }}
- IMAGE_NAME:
- description: "Docker image name"
- value: ${{ jobs.build-image-and-test-docs.outputs.IMAGE_NAME }}
- version_tag:
- description: "Version tag from Dockerfile"
- value: ${{ jobs.check-version.outputs.VERSION_TAG }}
-
-# Defines custom environment variables for the workflow.
-env:
- REGISTRY: ghcr.io
- IMAGE_BASENAME: ctsm-docs
- REPO: ${{ github.repository }}
-
-# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
-jobs:
- build-image-and-test-docs:
- runs-on: ubuntu-latest
- # Variables that might be needed by the calling workflow
- outputs:
- REGISTRY: ${{ env.REGISTRY }}
- IMAGE_NAME: ${{ steps.set-image-name.outputs.IMAGE_NAME }}
- # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
- permissions:
- contents: read
-
- steps:
-
- - name: Checkout repository
- 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
- id: set-image-name
- run: |
- lowercase_repo=$(echo $REPO | tr '[:upper:]' '[:lower:]')
- echo "IMAGE_NAME=${lowercase_repo}/${IMAGE_BASENAME}" >> $GITHUB_ENV
- echo "IMAGE_NAME=${lowercase_repo}/${IMAGE_BASENAME}" >> $GITHUB_OUTPUT
-
- # 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
- uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- - name: Extract metadata (tags, labels) for Docker
- id: meta
- uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
- with:
- images: ${{ env.REGISTRY }}/${{ steps.set-image-name.outputs.IMAGE_NAME }}
-
- # This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
- # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
- # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- # v6.15.0
- - name: Build Docker image
- id: build-image
- uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
- with:
- context: doc/ctsm-docs_container
- push: false
- load: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
-
- # Check out all submodules because we might :literalinclude: something from one
- - name: Checkout all submodules
- run: |
- bin/git-fleximod update -o
-
- - name: Set image tag for docs build
- id: set-image-tag
- run: |
- echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | head -n 1 | cut -d',' -f1)" >> $GITHUB_ENV
-
- - name: Build docs using Docker (Podman has trouble on GitHub runners)
- id: build-docs
- run: |
- cd doc && ./build_docs -b ${PWD}/_build -c -d -i $IMAGE_TAG
-
-
- check-version:
- needs: build-image-and-test-docs
- uses: ./.github/workflows/docker-image-get-version.yml
- with:
- registry: ${{ needs.build-image-and-test-docs.outputs.REGISTRY }}
- image_name: ${{ needs.build-image-and-test-docs.outputs.IMAGE_NAME }}
diff --git a/.github/workflows/docker-image-get-version.yml b/.github/workflows/docker-image-get-version.yml
deleted file mode 100644
index c405b861b5..0000000000
--- a/.github/workflows/docker-image-get-version.yml
+++ /dev/null
@@ -1,72 +0,0 @@
-name: Get and check version specified in a Dockerfile
-
-on:
- workflow_call:
- inputs:
- registry:
- required: true # Require any workflows calling this one to provide input
- type: string
- default: 'ghcr.io' # Provide default so this workflow works standalone too
- image_name:
- required: true # Require any workflows calling this one to provide input
- type: string
- default: 'escomp/ctsm/ctsm-docs' # Provide default so this workflow works standalone too
- outputs:
- VERSION_TAG:
- description: "Tag to be pushed to container registry"
- value: ${{ jobs.get-check-version.outputs.VERSION_TAG }}
- workflow_dispatch:
- inputs:
- registry:
- description: 'Container registry'
- required: false
- type: string
- default: 'ghcr.io'
- image_name:
- description: 'Image name'
- required: false
- type: string
- default: 'escomp/ctsm/ctsm-docs'
-
-# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
-jobs:
- get-check-version:
- name: Get version number from Dockerfile and check it
- runs-on: ubuntu-latest
- outputs:
- VERSION_TAG: ${{ steps.get-check-version.outputs.version_tag }}
- # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
- permissions:
- contents: read
- packages: read
-
- steps:
- - name: Check out repository
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-
- - name: Get version number from Dockerfile and check it
- id: get-check-version
- run: |
- set -e
- set -o pipefail
- set -u
- VERSION="$(doc/ctsm-docs_container/get_version.sh)"
- VERSION_TAG="${{ inputs.registry }}/${{ inputs.image_name }}:${VERSION}"
-
- # Store the manifest inspect result and output
- set +e
- INSPECT_RESULT="$(docker manifest inspect "$VERSION_TAG" 2>&1)"
- INSPECT_STATUS=$?
- set -e
-
- if [[ "${INSPECT_RESULT}" == *"schemaVersion"* ]]; then
- echo "Tag $VERSION_TAG already exists!" >&2
- exit 123
- elif [[ "${INSPECT_RESULT}" != "manifest unknown" ]]; then
- # "manifest unknown" means the tag doesn't exist, which is what we want
- echo -e "Error checking manifest for $VERSION_TAG:\n${INSPECT_RESULT}" >&2
- exit $INSPECT_STATUS
- fi
-
- echo "Setting version_tag to $VERSION_TAG"
- echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
diff --git a/.github/workflows/docs-build-and-deploy.yml b/.github/workflows/docs-build-and-deploy.yml
index f004f688b1..ad8700c822 100644
--- a/.github/workflows/docs-build-and-deploy.yml
+++ b/.github/workflows/docs-build-and-deploy.yml
@@ -46,13 +46,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Get all history, ensuring all branches are available for checkout
fetch-depth: 0
- name: Setup Pages
- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
+ uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
@@ -66,11 +66,11 @@ jobs:
./build_docs_to_publish -d --site-root https://escomp.github.io/CTSM
- name: Upload artifact
- uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3
+ uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
# Upload publish dir
path: 'doc/_publish'
- name: Deploy to GitHub Pages
id: deployment
- uses: actions/deploy-pages@f33f41b675f0ab2dc5a6863c9a170fe83af3571e # v4
+ uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
diff --git a/.github/workflows/docs-common.yml b/.github/workflows/docs-common.yml
index 974cb489e2..be3b76a950 100644
--- a/.github/workflows/docs-common.yml
+++ b/.github/workflows/docs-common.yml
@@ -17,16 +17,20 @@ on:
default: ""
secrets: {}
+env:
+ DOCS_REQUIREMENTS_FILE: doc/doc-builder/doc-build-container/requirements.txt
+
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
lfs: true
# Check out all submodules because we might :literalinclude: something from one
+ # Also, we need doc-builder for its requirements.txt
- name: Checkout all submodules
run: |
bin/git-fleximod update -o
@@ -35,34 +39,34 @@ 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@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
- python-version: '3.13.2' # needs to be coordinated with version in python/conda_env_ctsm_py.yml
+ python-version: '3.13.13' # needs to be coordinated with version in python/conda_env_ctsm_py.yml
- name: Cache pip
if: ${{ ! inputs.use_conda }}
- uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/pip
- key: ${{ runner.os }}-pip-${{ hashFiles('doc/ctsm-docs_container/requirements.txt') }}
+ key: ${{ runner.os }}-pip-${{ hashFiles(env.DOCS_REQUIREMENTS_FILE) }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python requirements
if: ${{ ! inputs.use_conda }}
run: |
- pip install -r doc/ctsm-docs_container/requirements.txt
+ pip install -r "$DOCS_REQUIREMENTS_FILE"
# Do this if using conda
- name: Set up conda environment
if: ${{ inputs.use_conda }}
- uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3
+ uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
activate-environment: ${{ inputs.conda_env_name }}
environment-file: ${{ inputs.conda_env_file }}
channels: conda-forge
- auto-activate-base: false
+ auto-activate: false
- name: Print installed Python packages
- run: conda list
+ run: ${{ inputs.use_conda && 'conda list' || 'pip list' }}
- name: Build Sphinx docs with makefile
run: |
diff --git a/.github/workflows/docs-omnibus.yml b/.github/workflows/docs-omnibus.yml
index f698478ef3..f3e6d1f1e7 100644
--- a/.github/workflows/docs-omnibus.yml
+++ b/.github/workflows/docs-omnibus.yml
@@ -24,24 +24,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
lfs: true
# Check out all submodules because we might :literalinclude: something from one
+ # Also, we need doc-builder for its requirements.txt
- name: Checkout all submodules
run: |
bin/git-fleximod update -o
# Set up conda
- name: Set up conda environment
- uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3
+ uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
activate-environment: ctsm_pylib
environment-file: python/conda_env_ctsm_py.yml
channels: conda-forge
- auto-activate-base: false
+ auto-activate: false
- name: Print installed Python packages
run: conda list
diff --git a/.github/workflows/docs-pr-failure-post-comment.yml b/.github/workflows/docs-pr-failure-post-comment.yml
index 2a8928b28c..83c9e5d9c6 100644
--- a/.github/workflows/docs-pr-failure-post-comment.yml
+++ b/.github/workflows/docs-pr-failure-post-comment.yml
@@ -35,7 +35,7 @@ jobs:
- name: Download logs
if: steps.check.outputs.found == 'true'
- uses: actions/download-artifact@v4
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ env.DOCS_FAILURE_ARTIFACT }}
path: ${{ env.DOCS_FAILURE_ARTIFACT }}
diff --git a/.github/workflows/docs-update-ctsm_pylib.yml b/.github/workflows/docs-update-ctsm_pylib.yml
index 18d703a4f7..fa769d94d1 100644
--- a/.github/workflows/docs-update-ctsm_pylib.yml
+++ b/.github/workflows/docs-update-ctsm_pylib.yml
@@ -1,4 +1,4 @@
-name: Docs tests to run when ctsm_pylib is updated
+name: Docs tests to run when ctsm_pylib is (or might be) updated
on:
push:
@@ -6,7 +6,8 @@ on:
branches: ['*']
paths:
- 'python/conda_env_ctsm_py.yml'
- - 'doc/ctsm-docs_container/requirements.txt'
+ # Include all of doc-builder due to dependence of ctsm_pylib on doc-builder's requirements.txt. Since doc-builder is a submodule, we can't point to that file specifically.
+ - 'doc/doc-builder'
- '.github/workflows/docs-common.yml'
- '.github/workflows/docs-update-dependency-common.yml'
@@ -14,7 +15,8 @@ on:
# Run on pull requests that change the listed files
paths:
- 'python/conda_env_ctsm_py.yml'
- - 'doc/ctsm-docs_container/requirements.txt'
+ # Include all of doc-builder due to dependence of ctsm_pylib on doc-builder's requirements.txt. Since doc-builder is a submodule, we can't point to that file specifically.
+ - 'doc/doc-builder'
- '.github/workflows/docs-common.yml'
- '.github/workflows/docs-update-dependency-common.yml'
@@ -55,10 +57,10 @@ jobs:
contents: read
issues: write
steps:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Create issue
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5
+ uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
diff --git a/.github/workflows/docs-update-dependency-common.yml b/.github/workflows/docs-update-dependency-common.yml
index 37adc0ff98..5609e64d60 100644
--- a/.github/workflows/docs-update-dependency-common.yml
+++ b/.github/workflows/docs-update-dependency-common.yml
@@ -27,23 +27,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
lfs: true
# Check out all submodules because we might :literalinclude: something from one
+ # Also, we need doc-builder for its requirements.txt
- name: Checkout all submodules
run: |
bin/git-fleximod update -o
- name: Set up conda environment
- uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3
+ uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
activate-environment: ${{ inputs.conda_env_name }}
environment-file: ${{ inputs.conda_env_file }}
channels: conda-forge
- auto-activate-base: false
+ auto-activate: false
- name: Print installed Python packages
run: conda list
@@ -56,23 +57,24 @@ jobs:
makefile-method:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
lfs: true
# Check out all submodules because we might :literalinclude: something from one
+ # Also, we need doc-builder for its requirements.txt
- name: Checkout all submodules
run: |
bin/git-fleximod update -o
- name: Set up conda environment
- uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3
+ uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
activate-environment: ${{ inputs.conda_env_name }}
environment-file: ${{ inputs.conda_env_file }}
channels: conda-forge
- auto-activate-base: false
+ auto-activate: false
- name: Check that Makefile method works
run: |
diff --git a/.github/workflows/docs-update-doc-builder.yml b/.github/workflows/docs-update-doc-builder.yml
deleted file mode 100644
index 1194e1c153..0000000000
--- a/.github/workflows/docs-update-doc-builder.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: Docs tests to run when doc-builder is updated
-
-on:
- push:
- # Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
- branches: ['*']
- paths:
- - 'doc/doc-builder'
- - '.github/workflows/docs-update-dependency-common.yml'
-
- pull_request:
- # Run on pull requests that change the listed files
- paths:
- - 'doc/doc-builder'
- - '.github/workflows/docs-update-dependency-common.yml'
-
- workflow_dispatch:
-
-permissions:
- contents: read
-jobs:
- test-update-dependency:
-
- name: Tests to run when either docs dependency is updated
- uses: ./.github/workflows/docs-update-dependency-common.yml
-
- test-rv-setup:
-
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- with:
- fetch-depth: 0
- lfs: true
-
- # Check out all submodules because we might :literalinclude: something from one
- - name: Checkout all submodules
- run: |
- bin/git-fleximod update -o
-
- - name: build_docs rv method
- run: |
- cd doc/test/ && ./test_build_docs_-r-v.sh docker
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index b1a5ce9250..1c6c36076e 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -55,7 +55,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
@@ -82,7 +82,7 @@ jobs:
- name: Upload logs on failure
if: failure() && steps.build-docs.outcome == 'failure'
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-build-docs-container_failed
path: build-logs/
@@ -94,7 +94,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Disallow fake degree signs
if: always()
diff --git a/.github/workflows/fleximod_test.yaml b/.github/workflows/fleximod_test.yaml
index d85958f972..808b9d6de4 100644
--- a/.github/workflows/fleximod_test.yaml
+++ b/.github/workflows/fleximod_test.yaml
@@ -9,17 +9,29 @@ on:
branches: ['*']
pull_request:
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
jobs:
fleximod-test:
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# oldest supported and latest supported
- python-version: ["3.7", "3.x"]
+ include:
+ # setup-python has no 3.7 builds for Ubuntu newer than 22.04
+ - python-version: "3.7"
+ os: ubuntu-22.04
+ - python-version: "3.x"
+ os: ubuntu-latest
steps:
- id: checkout-CTSM
- uses: actions/checkout@v4
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - id: setup-python
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
+ with:
+ python-version: ${{matrix.python-version}}
- id: run-fleximod
run: |
$GITHUB_WORKSPACE/bin/git-fleximod update -o
diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml
index a6b0af2b2a..61ab2b267f 100644
--- a/.github/workflows/python-tests.yml
+++ b/.github/workflows/python-tests.yml
@@ -17,12 +17,15 @@ on:
- 'cime_config/buildlib/**'
- 'cime_config/buildnml/**'
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
jobs:
python-unit-tests:
runs-on: ubuntu-latest
steps:
# Checkout the code
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
lfs: true
@@ -31,13 +34,18 @@ jobs:
run: |
bin/git-fleximod update cime
+ # Check out doc-builder to get requirements.txt
+ - name: Checkout doc-builder submodule
+ run: |
+ bin/git-fleximod update doc-builder
+
# Set up the conda environment
- - uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3
+ - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
activate-environment: ctsm_pylib
environment-file: python/conda_env_ctsm_py.yml
channels: conda-forge
- auto-activate-base: false
+ auto-activate: false
- name: Print installed Python packages
run: conda list
@@ -52,15 +60,20 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout the code
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+
+ # Check out doc-builder to get requirements.txt
+ - name: Checkout doc-builder submodule
+ run: |
+ bin/git-fleximod update doc-builder
# Set up the conda environment
- - uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3
+ - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
activate-environment: ctsm_pylib
environment-file: python/conda_env_ctsm_py.yml
channels: conda-forge
- auto-activate-base: false
+ auto-activate: false
- name: Print installed Python packages
run: conda list
diff --git a/.github/workflows/xml-check.yml b/.github/workflows/xml-check.yml
index d944222dfc..aa87714306 100644
--- a/.github/workflows/xml-check.yml
+++ b/.github/workflows/xml-check.yml
@@ -2,17 +2,17 @@ name: Check that XML files are well-formed
# Only check files in our repo that AREN'T in submodules
# Use a Python command to check each file because xmllint isn't available on GH runners
-on: [push, pull_request] # Trigger on push or pull request
+on: [push, pull_request, workflow_dispatch] # Trigger on push or pull request, or manually
jobs:
check-xml:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.x'
diff --git a/.gitmodules b/.gitmodules
index ebf688c296..7b890c0895 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -124,7 +124,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial
[submodule "doc-builder"]
path = doc/doc-builder
url = https://github.com/ESMCI/doc-builder
-fxtag = v3.2.1
+fxtag = v3.5.14
fxrequired = ToplevelOptional
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESMCI/doc-builder
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 194adbab1c..440a564e6e 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,4 +1,63 @@
===============================================================
+Tag name: ctsm5.4.069
+Originator(s): samrabin (Sam Rabin)
+Date: Thu Nov 12 12:03:59 MST 2026
+One-line Summary: Merge b4b-dev to master 2026-11-12
+
+Purpose and description of changes
+----------------------------------
+
+Merge b4b-dev to master. Includes:
+- [ESCOMP/CTSM Pull Request #4297: Get workflows to work with ubuntu 26.04 by samsrabin](https://github.com/ESCOMP/CTSM/pull/4297)
+- [ESCOMP/CTSM Pull Request #4301: fleximod-test workflow job now actually tests Python 3.7 and latest by samsrabin](https://github.com/ESCOMP/CTSM/pull/4301)
+- [ESCOMP/CTSM Pull Request #4246: Update doc-builder to latest version by samsrabin](https://github.com/ESCOMP/CTSM/pull/4246)
+- [ESCOMP/CTSM Pull Request #4304: sum mortaility terms by wwieder](https://github.com/ESCOMP/CTSM/pull/4304)
+
+
+Bugs fixed
+----------
+
+List of CTSM issues fixed (include CTSM Issue # and description):
+- Resolves [ESCOMP/CTSM Issue #3367: Doc build tests: Always check ESCOMP's containers, not fork's](https://github.com/ESCOMP/CTSM/issues/3367)
+- Resolves [ESCOMP/CTSM Issue #3941: Fix doc builder image version checks on forks](https://github.com/ESCOMP/CTSM/issues/3941)
+- Resolves [ESCOMP/CTSM Issue #4267: ctsm_pylib docs build test failed](https://github.com/ESCOMP/CTSM/issues/4267)
+
+
+Notes of particular relevance for developers:
+---------------------------------------------
+
+Initially failed due to https://github.com/ESCOMP/CTSM/issues/3360; worked on resubmit:
+- `ERP_D_P64x2_Ld3.f10_f10_mt201.I2000Clm50BgcCru.derecho_intel.clm-noFUN_flexCN--clm-matrixcnOn_ignore_warnings`
+
+Failed due to walltime; worked after bumping and resubmitting:
+- `ERP_P64x2_D_Ld5.f10_f10_mt201.I1850Clm50Bgc.derecho_intel.clm-ciso--clm-matrixcnOn_ignore_warnings`
+- `ERI_D_Ld9_P48x1.f10_f10_mt201.I2000Clm50Bgc.izumi_nag.clm-reduceOutput`
+- `ERS_D_Ld5_Mmpi-serial.1x1_vancouverCAN.I1PtClm50SpRsGs.izumi_nag.clm-CLM1PTStartDate`
+- `SMS_Ly1_D_Mmpi-serial.CLM_USRDAT.IHist1PtClm60BgcRsGs.izumi_nag.clm-default--clm-PLUMBER2-ARSLu`
+
+
+Testing summary:
+----------------
+
+ [PASS means all tests PASS; OK means tests PASS other than expected fails.]
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ derecho ----- OK
+ izumi ------- OK
+
+
+Other details
+-------------
+
+List any git submodules updated (cime, rtm, mosart, cism, fates, etc.):
+- doc-builder: Updated from v3.2.1 to v3.5.14
+
+Pull Requests that document the changes (include PR ids):
+- [ESCOMP/CTSM Pull Request #4315: ctsm5.4.069: b4b-dev merge 2026-11-12 by samsrabin](https://github.com/ESCOMP/CTSM/pull/4315)
+
+===============================================================
+===============================================================
Tag name: ctsm5.4.068
Originator(s): slevis (Samuel Levis,UCAR/TSS, slevis@ucar.edu)
Date: Tue Nov 3 03:03:43 AM MST 2026
diff --git a/doc/ChangeSum b/doc/ChangeSum
index e4dae66cc4..3057305abc 100644
--- a/doc/ChangeSum
+++ b/doc/ChangeSum
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
+ ctsm5.4.069 samrabin 11/12/2026 Merge b4b-dev to master 2026-11-12
ctsm5.4.068 slevis 11/03/2026 Move CTSM tests from gx (POP) grids to tx (MOM) grids
ctsm5.4.067 slevis 10/30/2026 Merge b4b-dev to master
ctsm5.4.066 rgknox 10/24/2026 Add bc_out to FATES restart and remove litter flux recalculations
diff --git a/doc/Makefile b/doc/Makefile
index d24e5e31aa..5a74413ecc 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -4,9 +4,8 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
-SPHINXPROJ = clmdoc
SOURCEDIR = source
-DIRWITHCONFPY = doc-builder
+DIRWITHCONFPY = $(if $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))doc-builder),doc-builder,.)
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
diff --git a/doc/build_docs b/doc/build_docs
index 99415e15c4..c980366c79 100755
--- a/doc/build_docs
+++ b/doc/build_docs
@@ -1,9 +1,36 @@
#!/usr/bin/env bash
set -e
-if [ ! -f doc-builder/build_docs ]; then
- script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
- ${script_dir}/../bin/git-fleximod update doc-builder
+# Ensure we're running from the correct directory.
+# Custom addition for CTSM to avoid needing to deal with https://github.com/ESMCI/doc-builder/issues/71 right now. Doesn't fix the "relative paths resolve incorrectly" issue.
+SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
+cd "${SCRIPT_DIR}"
+
+# $scriptname will already be set if build_docs is getting called from build_docs_to_publish.
+# Otherwise, we need to set it to the basename of this script.
+if [[ -z "${scriptname}" ]]; then
+ scriptname="${0##*/}"
+fi
+
+if [ ! -e doc-builder ]; then
+ # We're in the doc-builder directory itself
+ script="./tools/${scriptname}.py"
+ files_to_copy_to_source="conf.py substitutions.py _templates _static"
+ cp -a ${files_to_copy_to_source} source/
+else
+ # We're in a repo that *includes* doc-builder
+ script="./doc-builder/tools/${scriptname}.py"
+
+ # Make sure the doc-builder submodule is checked out. If doc-builder isn't a submodule but is
+ # instead manually included, we will perform the `else`, which is safe because it's a no-op in
+ # that situation.
+ # (Assume that if the repo uses git-fleximod, doc-builder is handled with it.)
+ git_fleximod_path="$(git rev-parse --show-toplevel)/bin/git-fleximod"
+ if [[ -e "${git_fleximod_path}" ]]; then
+ "${git_fleximod_path}" update doc-builder
+ else
+ git submodule update --init -- doc-builder
+ fi
fi
# Check if --verbose or -V was passed
@@ -22,8 +49,18 @@ else
fi
if $verbose; then
- echo "Running: ./doc-builder/build_docs $@"
+ echo "Running: ${script} $@"
+fi
+set +e
+${script} "$@"
+exit_code=$?
+set -e
+
+if [ ! -e doc-builder ]; then
+ # Clean up these things we copied
+ for f in ${files_to_copy_to_source}; do
+ rm -r "source/$f"
+ done
fi
-./doc-builder/build_docs "$@"
-exit 0
+exit $exit_code
diff --git a/doc/build_docs_to_publish b/doc/build_docs_to_publish
index bc4075c964..768bc9682b 100755
--- a/doc/build_docs_to_publish
+++ b/doc/build_docs_to_publish
@@ -1,32 +1,11 @@
#!/usr/bin/env bash
set -e
-script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
-if [ ! -f doc-builder/build_docs_to_publish ]; then
- "${script_dir}"/../bin/git-fleximod update doc-builder
-fi
+scriptname=build_docs_to_publish
-# Check if --verbose or -V was passed
-verbose=false
-for arg in "$@"; do
- case "$arg" in
- --verbose|-V) verbose=true; break ;;
- esac
-done
+# Ensure we're running from the correct directory.
+# Custom addition for CTSM to avoid needing to deal with https://github.com/ESMCI/doc-builder/issues/71 right now. Doesn't fix the "relative paths resolve incorrectly" issue.
+SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
+cd "${SCRIPT_DIR}"
-cd "${script_dir}"
-
-if $verbose; then
- echo "Running: make fetch-images"
- make fetch-images
-else
- make fetch-images > /dev/null 2>&1
-fi
-
-if $verbose; then
- echo "Running: ./doc-builder/build_docs_to_publish $@"
- pwd
-fi
-./doc-builder/build_docs_to_publish "$@"
-
-exit 0
+. ./build_docs
diff --git a/doc/ctsm-docs_container/Dockerfile b/doc/ctsm-docs_container/Dockerfile
deleted file mode 100644
index c38a384f80..0000000000
--- a/doc/ctsm-docs_container/Dockerfile
+++ /dev/null
@@ -1,32 +0,0 @@
-###################################################################
-# A base linux install + packages for building CTSM documentation #
-###################################################################
-
-FROM python:3.13.2-alpine
-
-# Update the default packages and install some other necessary ones
-RUN apk update
-RUN apk add --no-cache git sudo
-RUN apk add --no-cache git-lfs
-RUN apk add --no-cache make
-ADD requirements.txt requirements.txt
-RUN pip3 install --break-system-packages -r requirements.txt
-
-# Add user etc.
-RUN addgroup escomp
-RUN adduser -h /home/user -G escomp -s /bin/bash -D user
-RUN echo 'export USER=$(whoami)' >> /etc/profile.d/escomp.sh
-RUN echo 'export PS1="[\u@escomp \W]\$ "' >> /etc/profile.d/escomp.sh
-RUN echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/escomp
-
-ENV SHELL=/bin/bash \
- LANG=C.UTF-8 \
- LC_ALL=C.UTF-8
-
-USER user
-WORKDIR /home/user
-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="v2.0.1a"
diff --git a/doc/ctsm-docs_container/README.md b/doc/ctsm-docs_container/README.md
deleted file mode 100644
index 2c8110275d..0000000000
--- a/doc/ctsm-docs_container/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-# The ctsm-docs container
-This directory and its Dockerfile are used to build a container for building the CTSM documentation. Unless you're a developer working on the container, you probably don't need to care about anything in here.
-
-## Introduction
-
-This Readme tells you how to update the ctsm-docs container if a need to do so arises—for example, adding a Python module that brings new functionality in the build. After you've followed all these instructions, you will probably want to push an update to [doc-builder](https://github.com/ESMCI/doc-builder) that updates `DEFAULT_IMAGE` in [build_commands.py](https://github.com/ESMCI/doc-builder/blob/master/doc_builder/build_commands.py) to point to the new tag.
-
-## Building
-
-If you actually want to build the container, you will need to have Podman installed. We previously used Docker for this, but had to move away from it due to licensing issues. Note that these issues have to do specifically with Docker Desktop, which is required to get the Docker Engine on some platforms. The Docker Engine itself is open-source, so our ctsm-docs container testing and publishing workflows are fine to continue using it. We are also fine to use the Docker Engine via Podman for local builds, which is what's described here.
-
-Once you have Podman installed, you can do:
-```shell
-podman build --no-cache -t ctsm-docs .
-```
-
-To use your new version for local testing, you'll need to tell doc-builder to use that image. Call `podman images`, which should return something like this:
-```shell
-REPOSITORY TAG IMAGE ID CREATED SIZE
-localhost/ctsm-docs latest 6464f26339bc 22 seconds ago 241 MB
-...
-```
-
-To test, you can tell `build_docs` to use your new version by adding `--container-image IMAGE_ID` to your call, where in the example above `IMAGE_ID` is `6464f26339bc`.
-
-## Publishing automatically
-
-The `docker-image-build-publish.yml` workflow makes it so that new versions of the workflow will be published to the GitHub Container Registry whenever changes to the container setup are merged to CTSM's `master` branch. This will fail (as will a similar, no-publish workflow that happens on PRs) unless you specify exactly one new version number in the Dockerfile. This version number will be used as a tag that can be referenced by, e.g., doc-builder.
-
-Lots of container instructions tell you to use the `latest` tag, and indeed the workflow will add that tag automatically. However, actually _using_ `latest` can lead to support headaches as users think they have the right version but actually don't. Instead, you'll make a new version number incremented from the [previous one](https://github.com/ESCOMP/CTSM/pkgs/container/ctsm%2Fctsm-docs/versions), in the `vX.Y.Z` format.
-
-Here's where you need to specify the version number in the Dockerfile:
-```docker
-LABEL org.opencontainers.image.version="vX.Y.Z"
-```
-The string there can technically be anything as long as (a) it starts with a lowercase `v` and (b) it hasn't yet been used on a published version of the container. You may need to "bump" the version string in order for various tests to pass; if so, just add a lowercase letter at the end.
-
-You can check the results of the automatic publication on the [container's GitHub page](https://github.com/ESCOMP/CTSM/pkgs/container/ctsm%2Fctsm-docs).
-
-### Updating doc-builder
-After the new version of the container is published, you will probably want to tell [doc-builder](https://github.com/ESMCI/doc-builder) to use the new one. Open a PR where you change the tag (the part after the colon) in the definition of `DEFAULT_IMAGE` in `doc_builder/build_commands.py`. Remember, **use the version number**, not "latest".
-
-## Publishing manually
-
-It's vastly preferable to let GitHub build and publish the new repo using the `docker-image-build-publish.yml` workflow as described above. However, you may need to publish manually if, for instance, you introduce a change that breaks `doc-builder`. You could work around that by first merging a CTSM `master` PR that updates the container, then updating `doc-builder` to use it, then updating CTSM to use the new `doc-builder`. That's not always practical, though, so here's how to publish the container manually.
-
-### Building the multi-architecture version
-
-When publishing our container, we need to make sure it can run on either arm64 or amd64 processor architecture. This requires a special build process:
-```shell
-podman manifest rm ctsm-docs-manifest 2>/dev/null
-podman manifest create ctsm-docs-manifest
-podman build --platform linux/amd64,linux/arm64 --manifest ctsm-docs-manifest .
-```
-
-### Pushing to GitHub Container Registry
-If you want to publish the container, you first need a [GitHub Personal Access Token (Classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic) with the `write:packages` permissions. You can see your existing PAT(C)s [here](https://github.com/settings/tokens). If you don't have one with the right permissions, [this link](https://github.com/settings/tokens/new?scopes=write:packages) should start the setup process for you.
-
-Once you have a PAT(C), you can authenticate in your shell session like so:
-
-```bash
-# bash: Make it so that, in this session, commands with a leading space are not saved to terminal history
-export HISTCONTROL=ignoreboth
-
-# Include leading spaces so that your secret PAT(C) isn't included in terminal history
- echo YOUR_PERSONAL_ACCESS_TOKEN_CLASSIC | podman login ghcr.io -u YOUR_USERNAME --password-stdin
-```
-
-### Tagging
-You'll next need to tag the image. Lots of container instructions tell you to use the `latest` tag, and Podman may actually add that for you. However, using `latest` in `doc-builder` can lead to support headaches as users think they have the right version but actually don't. So in addition to `latest`, you'll make a new version number incremented from the [previous one](https://github.com/ESCOMP/CTSM/pkgs/container/ctsm%2Fctsm-docs/versions), in the `vX.Y.Z` format.
-
-Tag the manifest with your version number like so:
-```shell
-podman tag ctsm-docs-manifest ghcr.io/escomp/ctsm/ctsm-docs:v2.0.1
-```
-
-Push to the repo:
-```shell
-podman manifest push --all ctsm-docs-manifest ghcr.io/escomp/ctsm/ctsm-docs:vX.Y.Z
-podman manifest push --all ctsm-docs-manifest ghcr.io/escomp/ctsm/ctsm-docs:latest
-```
-
-Then browse to the [container's GitHub page](https://github.com/ESCOMP/CTSM/pkgs/container/ctsm%2Fctsm-docs) to make sure this all worked and the image is public.
-
-### Updating doc-builder
-See "Updating doc-builder" in the "Publishing automatically" section above.
-
-## See also
-
-- [GitHub: Working with the container registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry)
-- [GitHub: Connecting a repository to a package](https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package)
\ No newline at end of file
diff --git a/doc/ctsm-docs_container/get_version.sh b/doc/ctsm-docs_container/get_version.sh
deleted file mode 100755
index 485e720eff..0000000000
--- a/doc/ctsm-docs_container/get_version.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-set -e
-cd doc/ctsm-docs_container
-
-# Extract version from Dockerfile
-version="$(grep "org.opencontainers.image.version" Dockerfile | cut -d'"' -f2 | sort |uniq)"
-n_found=$(echo $version | wc -w)
-
-# Error if anything other than exactly one version tag was found
-if [[ ${n_found} -gt 1 ]]; then
- echo -e "Multiple version tags found:\n${version}" >&2
- exit 2
-elif [[ ${n_found} -lt 1 ]]; then
- echo "Expected 1 but found 0 version tags" >&2
- exit -1
-fi
-
-# Error if version doesn't start with v
-if [[ "${version}" != "v"* ]]; then
- echo "Version '${version}' doesn't start with v" >&2
- exit 22
-fi
-
-echo ${version}
-
-exit 0
diff --git a/doc/ctsm-docs_container/requirements.txt b/doc/ctsm-docs_container/requirements.txt
deleted file mode 100644
index 19872cb9c0..0000000000
--- a/doc/ctsm-docs_container/requirements.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# Python packages used for building docs
-rst2pdf == 0.103.1
-sphinx == 8.2.3
-sphinxcontrib_programoutput == 0.18
-myst-parser == 5.0.0
-sphinx_rtd_theme == 3.0.2
diff --git a/doc/doc-builder b/doc/doc-builder
index 15e171dfcf..03f8ea9c00 160000
--- a/doc/doc-builder
+++ b/doc/doc-builder
@@ -1 +1 @@
-Subproject commit 15e171dfcf77ca2bd85415a99a50ad3994c608c4
+Subproject commit 03f8ea9c00b9c7a2bee3501e743ab188626e1e40
diff --git a/doc/source/_templates/versions.html b/doc/source/_templates/versions.html
deleted file mode 100644
index d219003644..0000000000
--- a/doc/source/_templates/versions.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- Version: {{ current_version }}
-
-
-
- {% if languages|length >= 1 %}
-
- - {{ _('Languages') }}
- {% for the_language, url in languages %}
- - {{ the_language }}
- {% endfor %}
-
- {% endif %}
- {% if versions|length >= 1 %}
-
- - {{ _('Versions') }}
- {% for the_version, url in versions %}
- - {{ the_version }}
- {% endfor %}
-
- {% endif %}
-
-
-
-
diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst
index 5b22f8a706..1e8f34449a 100644
--- a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst
+++ b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _adding-resolutions:
========================
diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst
index ea10a3c409..4794ff1028 100644
--- a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst
+++ b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _adding-resolution-names:
=========================
diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst
index 47cbad9dc6..05741ff466 100644
--- a/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst
+++ b/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _changing-default-filenames:
============================
diff --git a/doc/source/users_guide/adding-new-resolutions/index.rst b/doc/source/users_guide/adding-new-resolutions/index.rst
index f524461395..2a26bb339a 100644
--- a/doc/source/users_guide/adding-new-resolutions/index.rst
+++ b/doc/source/users_guide/adding-new-resolutions/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _adding-new-resolutions-section:
#####################################
diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst
index 7824ed4dfc..fb9888016e 100644
--- a/doc/source/users_guide/index.rst
+++ b/doc/source/users_guide/index.rst
@@ -5,7 +5,6 @@
.. _users-guide:
-.. include:: substitutions.rst
######################
|version| User's Guide
diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst
index 12aec3c7be..cdcc057a0c 100644
--- a/doc/source/users_guide/overview/getting-help.rst
+++ b/doc/source/users_guide/overview/getting-help.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _getting-help:
==============
diff --git a/doc/source/users_guide/overview/index.rst b/doc/source/users_guide/overview/index.rst
index b0dcfcdd96..1f31037460 100644
--- a/doc/source/users_guide/overview/index.rst
+++ b/doc/source/users_guide/overview/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _overview_section:
#####################################
diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst
index ff3ed5f619..f0c5701cf8 100644
--- a/doc/source/users_guide/overview/introduction.rst
+++ b/doc/source/users_guide/overview/introduction.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _introduction:
**User's Guide to version |version| of the Community Land Model (CLM)**
diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst
index 3fb68183cd..c5d1f7f6ef 100644
--- a/doc/source/users_guide/overview/quickstart.rst
+++ b/doc/source/users_guide/overview/quickstart.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _quickstart:
============
diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst
index 1040b25ba0..031a6637a4 100644
--- a/doc/source/users_guide/overview/scientific_validation.rst
+++ b/doc/source/users_guide/overview/scientific_validation.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _scientific-validiation:
========================
diff --git a/doc/source/users_guide/running-single-points/generic-single-point-regional.rst b/doc/source/users_guide/running-single-points/generic-single-point-regional.rst
index e4473c3f74..258601afed 100644
--- a/doc/source/users_guide/running-single-points/generic-single-point-regional.rst
+++ b/doc/source/users_guide/running-single-points/generic-single-point-regional.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _generic_single_point_runs:
****************************************
diff --git a/doc/source/users_guide/running-single-points/index.rst b/doc/source/users_guide/running-single-points/index.rst
index 1b503acc87..390dbb433b 100644
--- a/doc/source/users_guide/running-single-points/index.rst
+++ b/doc/source/users_guide/running-single-points/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _running-single-points:
#######################################
diff --git a/doc/source/users_guide/running-single-points/intro-to-single-pt-regional.rst b/doc/source/users_guide/running-single-points/intro-to-single-pt-regional.rst
index 23279aac23..2baf0ffb5a 100644
--- a/doc/source/users_guide/running-single-points/intro-to-single-pt-regional.rst
+++ b/doc/source/users_guide/running-single-points/intro-to-single-pt-regional.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _single-point-regional-configurations:
*****************************************************
diff --git a/doc/source/users_guide/running-single-points/predefined-single-point-regional-resolutions.rst b/doc/source/users_guide/running-single-points/predefined-single-point-regional-resolutions.rst
index 0774319cd1..d57e9bef69 100644
--- a/doc/source/users_guide/running-single-points/predefined-single-point-regional-resolutions.rst
+++ b/doc/source/users_guide/running-single-points/predefined-single-point-regional-resolutions.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _pre-defined-single-pt-regional-resolutions:
****************************************************
diff --git a/doc/source/users_guide/running-single-points/supported-tower-sites.rst b/doc/source/users_guide/running-single-points/supported-tower-sites.rst
index ba7a9fde35..03f52e055b 100644
--- a/doc/source/users_guide/running-single-points/supported-tower-sites.rst
+++ b/doc/source/users_guide/running-single-points/supported-tower-sites.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _supported-tower-sites:
********************************************
diff --git a/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst
index 90e95b7d74..120ae227aa 100644
--- a/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst
+++ b/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _running-prognostic-crop-model:
===================================
diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst
index c0c801b36c..5badb22cba 100644
--- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst
+++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _running-with-moar-data:
========================
diff --git a/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst b/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst
index a8197d836c..bd090a5338 100644
--- a/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst
+++ b/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _running-with-anomaly-forcing:
==============================
diff --git a/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst b/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst
index e6af2b232f..4cea55548d 100644
--- a/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst
+++ b/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst
@@ -1,7 +1,5 @@
.. running-with-custom-crop-calendars:
-.. include:: ../substitutions.rst
-
=======================================
Running with custom crop calendars
=======================================
diff --git a/doc/source/users_guide/running-special-cases/Running-with-excess-ground-ice.rst b/doc/source/users_guide/running-special-cases/Running-with-excess-ground-ice.rst
index 3ad949724f..58ff66c3a2 100644
--- a/doc/source/users_guide/running-special-cases/Running-with-excess-ground-ice.rst
+++ b/doc/source/users_guide/running-special-cases/Running-with-excess-ground-ice.rst
@@ -1,7 +1,5 @@
.. _running-with-excess-ground-ice:
-.. include:: ../substitutions.rst
-
===================================
Running with excess ground ice
===================================
diff --git a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst
index cb5139f23a..f2b6eb5551 100644
--- a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst
+++ b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _running-with-irrigation:
===================================
diff --git a/doc/source/users_guide/running-special-cases/Running-with-tillage.rst b/doc/source/users_guide/running-special-cases/Running-with-tillage.rst
index e3ad1c7e74..d23122f3a2 100644
--- a/doc/source/users_guide/running-special-cases/Running-with-tillage.rst
+++ b/doc/source/users_guide/running-special-cases/Running-with-tillage.rst
@@ -1,7 +1,5 @@
.. _running-with-tillage:
-.. include:: ../substitutions.rst
-
=====================
Running with tillage
=====================
diff --git a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst
index a59e82b159..dbacdba81b 100644
--- a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst
+++ b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _running-with-previous-simulation-forcing:
=============================================================
diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-ClmSp-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-ClmSp-spinup.rst
index a1ec71fb23..3bd78fbd88 100644
--- a/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-ClmSp-spinup.rst
+++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-ClmSp-spinup.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _spinning-up-sp:
===========================================
diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-Bgc-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-Bgc-spinup.rst
index 6aa05730a2..8e90c470dc 100644
--- a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-Bgc-spinup.rst
+++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-Bgc-spinup.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _spinning-up-clm-bgc:
=====================
diff --git a/doc/source/users_guide/running-special-cases/What-is-a-special-case.rst b/doc/source/users_guide/running-special-cases/What-is-a-special-case.rst
index eece6aab51..b4d077003f 100644
--- a/doc/source/users_guide/running-special-cases/What-is-a-special-case.rst
+++ b/doc/source/users_guide/running-special-cases/What-is-a-special-case.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _what is a special case:
=========================
diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst
index e8384ebd49..2ac9c7fccf 100644
--- a/doc/source/users_guide/running-special-cases/index.rst
+++ b/doc/source/users_guide/running-special-cases/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _running-special-cases-section:
#####################################
diff --git a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst
index b052a6ea3d..d3da76c175 100644
--- a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst
+++ b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _choosing-a-compset:
====================
diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst
index 5baf7f5723..d60c179499 100644
--- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst
+++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _configuring-clm:
********************************
diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst
index 33689563b0..339892408b 100644
--- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst
+++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _customizing-a-case:
============================
diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst
index 0aba609298..14f8f8581f 100644
--- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst
+++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _customizing-the-datm-namelist:
===============================
diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-mizuRoute-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-mizuRoute-namelist.rst
index d97147355c..30774526af 100644
--- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-mizuRoute-namelist.rst
+++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-mizuRoute-namelist.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _customizing-the-mizuRoute-namelist:
===================================
diff --git a/doc/source/users_guide/setting-up-and-running-a-case/index.rst b/doc/source/users_guide/setting-up-and-running-a-case/index.rst
index 0b07e30a89..4782d50e07 100644
--- a/doc/source/users_guide/setting-up-and-running-a-case/index.rst
+++ b/doc/source/users_guide/setting-up-and-running-a-case/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _customizing_section:
#####################################
diff --git a/doc/source/users_guide/substitutions.rst b/doc/source/users_guide/substitutions.rst
deleted file mode 100644
index dca7e440fe..0000000000
--- a/doc/source/users_guide/substitutions.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-.. |cesmrelease| replace:: CESM2.2 beta
-
-.. |ctsm_gh| replace:: https://github.com/ESCOMP/ctsm
-
-.. |cesm_gh| replace:: https://github.com/ESCOMP/cesm
diff --git a/doc/source/users_guide/testing/index.rst b/doc/source/users_guide/testing/index.rst
index b7baedc04f..63d0cc834c 100644
--- a/doc/source/users_guide/testing/index.rst
+++ b/doc/source/users_guide/testing/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _testing_section:
#####################################
diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst
index 0534226f84..ce1e25c54b 100644
--- a/doc/source/users_guide/testing/testing.rst
+++ b/doc/source/users_guide/testing/testing.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _testing:
*******
diff --git a/doc/source/users_guide/trouble-shooting/index.rst b/doc/source/users_guide/trouble-shooting/index.rst
index c92a7e3ba8..eb6983ace5 100644
--- a/doc/source/users_guide/trouble-shooting/index.rst
+++ b/doc/source/users_guide/trouble-shooting/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _troubleshooting-index:
#####################################
diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst
index 0e1a5e241f..7d51dfce32 100644
--- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst
+++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _trouble-shooting:
*********************************************
diff --git a/doc/source/users_guide/using-clm-tools/cprnc.rst b/doc/source/users_guide/using-clm-tools/cprnc.rst
index bae6982fd6..9e005a0341 100644
--- a/doc/source/users_guide/using-clm-tools/cprnc.rst
+++ b/doc/source/users_guide/using-clm-tools/cprnc.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _comparing-history-files:
=========================
diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst
index 0949236164..6bd577323b 100644
--- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst
+++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _creating-maps-for-mksurfdata:
*********************************************
diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst
index 6a2709e0be..7da958c6ec 100644
--- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst
+++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _creating-surface-datasets:
Creating Surface Datasets
diff --git a/doc/source/users_guide/using-clm-tools/index.rst b/doc/source/users_guide/using-clm-tools/index.rst
index 5023157d65..66dba57e33 100644
--- a/doc/source/users_guide/using-clm-tools/index.rst
+++ b/doc/source/users_guide/using-clm-tools/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _using-clm-tools-section:
#####################################
diff --git a/doc/source/users_guide/using-clm-tools/modifying-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/modifying-surface-datasets.rst
index 8b5357d1a9..ca56db2a5f 100644
--- a/doc/source/users_guide/using-clm-tools/modifying-surface-datasets.rst
+++ b/doc/source/users_guide/using-clm-tools/modifying-surface-datasets.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _modifying-surface-datasets:
===========================
diff --git a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst
index 54c48e5e03..ebdceef25e 100644
--- a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst
+++ b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _observational-sites-datasets:
*******************************
diff --git a/doc/source/users_guide/using-clm-tools/using-ctsm-pylib.rst b/doc/source/users_guide/using-clm-tools/using-ctsm-pylib.rst
index 8975556596..3fba01d5e5 100644
--- a/doc/source/users_guide/using-clm-tools/using-ctsm-pylib.rst
+++ b/doc/source/users_guide/using-clm-tools/using-ctsm-pylib.rst
@@ -1,5 +1,3 @@
-
-.. include:: ../substitutions.rst
.. _using-ctsm-pylib:
Installing the CTSM Python environment
diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst
index 6c947f42b1..915f1ecada 100644
--- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst
+++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _what-are-the-clm-tools:
========================
diff --git a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst
index b21b9760ab..f65f53317d 100644
--- a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst
+++ b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _how-to-make-mesh:
===============================================
diff --git a/doc/source/users_guide/using-mesh-maker/index.rst b/doc/source/users_guide/using-mesh-maker/index.rst
index c716156193..e9b8ecfa31 100644
--- a/doc/source/users_guide/using-mesh-maker/index.rst
+++ b/doc/source/users_guide/using-mesh-maker/index.rst
@@ -3,8 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-.. include:: ../substitutions.rst
-
.. _using-mesh-maker-index:
#######################################
diff --git a/doc/source/users_guide/using-mesh-maker/run-mesh-mask-modifier.rst b/doc/source/users_guide/using-mesh-maker/run-mesh-mask-modifier.rst
index 5e1d6bd2b1..557a9f35d3 100644
--- a/doc/source/users_guide/using-mesh-maker/run-mesh-mask-modifier.rst
+++ b/doc/source/users_guide/using-mesh-maker/run-mesh-mask-modifier.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _run-mesh-mask-modifier:
========================================
diff --git a/doc/source/users_guide/working-with-documentation/building-docs-multiple-versions.rst b/doc/source/users_guide/working-with-documentation/building-docs-multiple-versions.rst
index e8a3e2f4df..94f99c3f91 100644
--- a/doc/source/users_guide/working-with-documentation/building-docs-multiple-versions.rst
+++ b/doc/source/users_guide/working-with-documentation/building-docs-multiple-versions.rst
@@ -3,7 +3,7 @@
Building multiple versions of the documentation
===============================================
-There is a menu in the lower left of the webpage that lets readers switch between different versions of the documentation. To build a website with this menu properly set up—so that all our versions appear and all the links work—you need to use ``docs/build_docs_to_publish`` instead of ``docs/build_docs``.
+There is a menu in the lower left of the webpage that lets readers switch between different versions of the documentation. To build a website with this menu properly set up—so that all our versions appear and all the links work—you need to use ``doc/build_docs_to_publish`` instead of ``doc/build_docs``.
**Note that this is not necessary in order for you to contribute an update to the documentation.** GitHub will test this automatically when you open a PR. But if you'd like to try, this will generate a local site for you in ``_publish/`` and then open it:
diff --git a/doc/source/users_guide/working-with-documentation/index.rst b/doc/source/users_guide/working-with-documentation/index.rst
index 7bb4755bee..217368f42f 100644
--- a/doc/source/users_guide/working-with-documentation/index.rst
+++ b/doc/source/users_guide/working-with-documentation/index.rst
@@ -1,5 +1,3 @@
-.. include:: ../substitutions.rst
-
.. _working-with-docs:
#######################################
diff --git a/doc/source/users_guide/working-with-documentation/tips-for-working-with-markdown.md b/doc/source/users_guide/working-with-documentation/tips-for-working-with-markdown.md
index f22a6b68d4..c646d5340e 100644
--- a/doc/source/users_guide/working-with-documentation/tips-for-working-with-markdown.md
+++ b/doc/source/users_guide/working-with-documentation/tips-for-working-with-markdown.md
@@ -1,3 +1,9 @@
+---
+myst:
+ substitutions:
+ key1: "I'm a **substitution**"
+---
+
(tips-for-working-with-markdown)=
# Tips for working with Markdown
@@ -168,4 +174,26 @@ Becomes:
:lineno-match:
```
-See [the MyST Markdown documentation for the `include` directive](https://mystmd.org/guide/directives#directive-include) for more information (all options apply to `literalinclude` as well).
\ No newline at end of file
+See [the MyST Markdown documentation for the `include` directive](https://mystmd.org/guide/directives#directive-include) for more information (all options apply to `literalinclude` as well).
+
+## Markdown: Using substitutions
+Substitutions allow us to associate a text string with a variable name, then to use that variable name throughout our documentation. This has the advantage of only needing to update the text string in one place but getting that propagated everywhere.
+
+Our global substitutions are defined in `doc/substitutions.py`. For example, including `{{ version }}` in a Markdown documentation file will render as "{{ version }}" (no quotes) because of this in `doc/substitutions.py`:
+```{literalinclude} ../../../substitutions.py
+:language: python
+:linenos:
+:start-at: version =
+:end-at: version =
+:lineno-match:
+```
+
+You can also, using "front matter," define substitutions that will apply in just one file. For example, the beginning of this file contains
+
+```{literalinclude} tips-for-working-with-markdown.md
+:language: yaml
+:linenos:
+:lines: 1-5
+```
+
+Thus, `{{ key1 }}` gets rendered as "{{ key1 }}" (no quotes), but this wouldn't work on any other page.
diff --git a/doc/source/users_guide/working-with-documentation/tips-for-working-with-rst.rst b/doc/source/users_guide/working-with-documentation/tips-for-working-with-rst.rst
index 12dda6d1f8..66aae6af5c 100644
--- a/doc/source/users_guide/working-with-documentation/tips-for-working-with-rst.rst
+++ b/doc/source/users_guide/working-with-documentation/tips-for-working-with-rst.rst
@@ -3,6 +3,8 @@
Tips for working with reStructuredText
========================================
+.. |key1| replace:: I'm a **substitution**
+
If you've never used reStructuredText before, you should be aware that its syntax is pretty different from anything you've ever used before. We recommend the following resources as references for the syntax:
- `Sphinx's reStructuredText Primer `_
@@ -217,3 +219,29 @@ reStructuredText: Common error messages and how to handle them
--------------------------------------------------------------
See :ref:`common-rst-errors`.
+
+
+reStructuredText: Using substitutions
+-------------------------------------
+
+Substitutions allow us to associate a text string with a variable name, then to use that variable name throughout our documentation. This has the advantage of only needing to update the text string in one place but getting that propagated everywhere.
+
+Our global substitutions are defined in ``doc/substitutions.py``. For example, including ``|version|`` in a reStructuredText documentation file will render as "|version|" (no quotes) because of this in ``doc/substitutions.py``:
+
+.. literalinclude:: ../../../substitutions.py
+ :language: python
+ :linenos:
+ :start-at: version =
+ :end-at: version =
+ :lineno-match:
+
+You can also define substitutions that will apply in just one file. For example, this file contains this line:
+
+.. literalinclude:: tips-for-working-with-rst.rst
+ :language: reStructuredText
+ :linenos:
+ :start-at: key1
+ :end-at: key1
+ :lineno-match:
+
+Thus, ``|key1|`` gets rendered as "|key1|" (no quotes), but this wouldn't work on any other page.
diff --git a/doc/source/users_guide/working-with-documentation/vscode-doc-editing-setup.md b/doc/source/users_guide/working-with-documentation/vscode-doc-editing-setup.md
index 4a531b7647..a8e7a7c4d4 100644
--- a/doc/source/users_guide/working-with-documentation/vscode-doc-editing-setup.md
+++ b/doc/source/users_guide/working-with-documentation/vscode-doc-editing-setup.md
@@ -3,7 +3,7 @@
# Recommended setup for editing docs in VS Code
## Set up Python
-The Python packages needed for this setup are listed at `doc/ctsm-docs_container/requirements.txt`. If you recently installed [the `ctsm_pylib` conda environment](https://escomp.github.io/CTSM/users_guide/using-clm-tools/using-ctsm-pylib.html), they will already be included there. Check like so:
+The Python packages needed for this setup are listed at `doc/doc-builder/doc-build-container/requirements.txt`. If you recently installed [the `ctsm_pylib` conda environment](https://escomp.github.io/CTSM/users_guide/using-clm-tools/using-ctsm-pylib.html), they will already be included there. Check like so:
```shell
conda activate ctsm_pylib
pip show myst-parser
@@ -11,7 +11,8 @@ pip show myst-parser
If you see `WARNING: Package(s) not found: myst-parser`, you'll need to install the doc-building Python modules. With your conda environment activated (or in whatever other environment you want to use), from the top level of a CTSM checkout, do:
```shell
-pip install -r doc/ctsm-docs_container/requirements.txt
+bin/git-fleximod update doc-builder
+pip install -r doc/doc-builder/doc-build-container/requirements.txt
```
You will need to provide the path to your Python binary in various VS Code settings detailed below. You can get that with `which python` (after loading the relevant conda environment, if needed).
diff --git a/doc/substitutions.py b/doc/substitutions.py
index 29b6fb54de..b4a721e61b 100644
--- a/doc/substitutions.py
+++ b/doc/substitutions.py
@@ -60,4 +60,14 @@
"dirmenu_entry": "clmdoc",
"description": "One line description of project.",
"category": tex_category,
-}
\ No newline at end of file
+}
+
+###############################
+### Purely custom variables ###
+###############################
+
+cesmrelease = "CESM2.2 beta"
+
+ctsm_gh = "https://github.com/ESCOMP/ctsm"
+
+cesm_gh = "https://github.com/ESCOMP/cesm"
diff --git a/doc/test/compose_test_cmd.sh b/doc/test/compose_test_cmd.sh
deleted file mode 100755
index 2b2fd3cf67..0000000000
--- a/doc/test/compose_test_cmd.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# This should only be run locally within another shell
-
-if [[ "${cli_tool}" == "" ]]; then
- echo "${msg} (no container)"
-else
- cmd="${cmd} -d"
- if [[ "${cli_tool}" != "default" ]]; then
- cmd="${cmd} --container-cli-tool ${cli_tool}"
- fi
- echo "${msg} (container: ${cli_tool})"
-fi
-
-echo cmd
diff --git a/doc/test/test_build_docs_-b.sh b/doc/test/test_build_docs_-b.sh
deleted file mode 100755
index 8b49e2f7aa..0000000000
--- a/doc/test/test_build_docs_-b.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-
-# Fail on any non-zero exit code
-set -e
-
-cli_tool="$1"
-
-SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
-cd "${SCRIPT_DIR}/.."
-
-msg="~~~~~ Check that -b works"
-cmd="./build_docs -b _build -c"
-
-. test/compose_test_cmd.sh
-set -x
-$cmd
-
-exit 0
diff --git a/doc/test/test_build_docs_-r-v.sh b/doc/test/test_build_docs_-r-v.sh
deleted file mode 100755
index 6f9415b563..0000000000
--- a/doc/test/test_build_docs_-r-v.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-
-# Fail on any non-zero exit code
-set -e
-
-cli_tool="$1"
-
-SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
-cd "${SCRIPT_DIR}/.."
-
-msg="~~~~~ Check that -r -v works"
-cmd="./build_docs -r _build -v latest -c --conf-py-path doc-builder/test/conf.py --static-path ../_static --templates-path ../_templates"
-
-. test/compose_test_cmd.sh
-set -x
-$cmd
-
-exit 0
diff --git a/doc/test/test_container_eq_ctsm_pylib.sh b/doc/test/test_container_eq_ctsm_pylib.sh
index 729f1b723e..3463237b7d 100755
--- a/doc/test/test_container_eq_ctsm_pylib.sh
+++ b/doc/test/test_container_eq_ctsm_pylib.sh
@@ -14,7 +14,6 @@ rm -rf _publish*
# Build all docs using container
echo "~~~~~ Build all docs using container"
-# Also do a custom --conf-py-path
rm -rf _build _publish
d1="$PWD/_publish_container"
./build_docs_to_publish -r _build -d --site-root "$PWD/_publish"
@@ -25,7 +24,7 @@ cp -a _publish "${d1}"
echo "~~~~~ Build all docs using ctsm_pylib"
rm -rf _build _publish
d2="$PWD/_publish_nocontainer"
-conda run -n ctsm_pylib --no-capture-output ./build_docs_to_publish -r _build --site-root "$PWD/_publish" --conf-py-path doc-builder/test/conf.py --static-path ../_static --templates-path ../_templates
+conda run -n ctsm_pylib --no-capture-output ./build_docs_to_publish -r _build --site-root "$PWD/_publish"
# VERSION LINKS WILL NOT RESOLVE IN _publish_nocontainer
cp -a _publish "${d2}"
diff --git a/doc/test/test_doc-builder_tests.sh b/doc/test/test_doc-builder_tests.sh
deleted file mode 100755
index 07cfa73ea1..0000000000
--- a/doc/test/test_doc-builder_tests.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-# Fail on any non-zero exit code
-set -e
-
-SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
-cd "${SCRIPT_DIR}"
-
-echo "~~~~~ Check that doc-builder tests pass"
-cd ../doc-builder/test
-set -x
-conda run --no-capture-output -n ctsm_pylib make test
-
-exit 0
diff --git a/doc/test/testing.sh b/doc/test/testing.sh
index 2e91025e6c..dfe29fd2b3 100755
--- a/doc/test/testing.sh
+++ b/doc/test/testing.sh
@@ -9,27 +9,9 @@ cd "${SCRIPT_DIR}/"
# Compare docs built with container vs. ctsm_pylib
./test_container_eq_ctsm_pylib.sh
-# Check that -r -v works (Docker)
-# Also do a custom --conf-py-path and other stuff
-cd "${SCRIPT_DIR}/"
-rm -rf _build
-./test_build_docs_-r-v.sh docker
-
# Check that Makefile method works
cd "${SCRIPT_DIR}/"
rm -rf _build
conda run --no-capture-output -n ctsm_pylib ./test_makefile_method.sh
-# Check that -b works
-cd "${SCRIPT_DIR}/"
-rm -rf _build
-./test_build_docs_-b.sh docker
-
-# Check that doc-builder tests pass
-# Don't run if on a GitHub runner; failing 🤷. Trust that doc-builder does this test.
-if [[ "${GITHUB_ACTIONS}" == "" ]]; then
- cd "${SCRIPT_DIR}/"
- ./test_doc-builder_tests.sh
-fi
-
exit 0
diff --git a/py_env_create b/py_env_create
index cf34131e41..b4ab42e3b2 100755
--- a/py_env_create
+++ b/py_env_create
@@ -17,9 +17,9 @@ cd "${SCRIPT_DIR}"
condadir="${SCRIPT_DIR}/python"
default_new_env_name=ctsm_pylib
-default_old_env_name=ctsm_pylib_3_7_9
+default_old_env_name=ctsm_pylib_3_13_2
default_condafile="${condadir}/conda_env_ctsm_py.yml"
-default_condafile_old="${condadir}/conda_env_ctsm_py_old_3.7.9.yml"
+default_condafile_old="${condadir}/conda_env_ctsm_py_old_3.13.2.yml"
condafile="${default_condafile}"
quiet=""
@@ -109,7 +109,7 @@ usage() {
echo "[-o|--overwrite] "
echo " Overwrite existing env with same name, if any. Incompatible with -r/--rename-existing."
echo "[--old] "
- echo " Install the previous version of ctsm_pylib (Python 3.7.9). Changes these to old-version defaults:"
+ echo " Install the previous version of ctsm_pylib. Changes these to old-version defaults:"
echo " env name: ${default_old_env_name}"
echo " file: ${default_condafile_old}"
echo "[-q|--quiet] "
@@ -237,6 +237,12 @@ if [[ ${dry_run} -ne 0 ]]; then
exit 0
fi
+# Check out doc-builder to ensure we have the latest version of its requirements.txt.
+# Don't use git-fleximod, because it won't work in CESM checkouts. Regular git submodule command
+# should be safe to use here, at least on sanctioned CTSM branches, because we have a GitHub
+# Workflow ensuring the git submodule version matches the .gitmodules entry.
+git submodule update --init -- doc/doc-builder
+
# Rename or overwrite existing
if [[ ${conda_env_does_exist} -gt 0 ]]; then
if [[ "${new_name_for_existing}" != "" ]]; then
diff --git a/python/conda_env_ctsm_py.yml b/python/conda_env_ctsm_py.yml
index 13dec57601..dd2e524f02 100644
--- a/python/conda_env_ctsm_py.yml
+++ b/python/conda_env_ctsm_py.yml
@@ -4,7 +4,7 @@ channels:
- conda-forge
- defaults
dependencies:
- - python=3.13.2
+ - python=3.13.13
- dask=2025.7.0
- xarray=2025.1.2
- tqdm=4.67.1
@@ -24,9 +24,11 @@ dependencies:
# fortls used in FORTRAN-IntelliSense extension, add path to fortls below to the VS setting fort-ls.executablePath
- fortls=3.2.2
- # For building docs
+ # For building docs.
+ # NOTE: When this YML file is deprecated, the versions from this file should be copied in here instead of relying on the requirements.txt file staying the same forever!
+ # NOTE: This YML file should be deprecated whenever the requirements.txt file changes!
- pip:
- - -r ../doc/ctsm-docs_container/requirements.txt
+ - -r ../doc/doc-builder/doc-build-container/requirements.txt
# Used in ctsm_postprocessing repo
- pytest=8.3.5
diff --git a/python/conda_env_ctsm_py_old_3.13.2.yml b/python/conda_env_ctsm_py_old_3.13.2.yml
new file mode 100644
index 0000000000..93b95cca9b
--- /dev/null
+++ b/python/conda_env_ctsm_py_old_3.13.2.yml
@@ -0,0 +1,40 @@
+# This file is used by py_env_create to install a previous version of the ctsm_pylib environment,
+# which used Python 3.13.2. Doing so is only useful for running CTSM python tools in repos from
+# before the subsequent ctsm_pylib version (with Python 3.13.13) was introduced.
+#
+name: ctsm_pylib_3_13_2
+channels:
+ - conda-forge
+ - defaults
+dependencies:
+ - python=3.13.2
+ - dask=2025.7.0
+ - xarray=2025.1.2
+ - tqdm=4.67.1
+ - scipy=1.15.2
+ - netcdf4=1.7.2
+ - requests=2.32.3
+ - xesmf=0.8.8
+ - numba=0.61.0
+ - pylint=3.3.4
+ - black=25.1.0
+ - cartopy=0.24.0
+ - matplotlib=3.10.1
+ - compliance-checker=6.1.0
+ - pip=25.0.1
+
+ # For VS code
+ # fortls used in FORTRAN-IntelliSense extension, add path to fortls below to the VS setting fort-ls.executablePath
+ - fortls=3.2.2
+
+ # For building docs
+ - pip:
+ - rst2pdf == 0.103.1
+ - sphinx == 8.2.3
+ - sphinxcontrib_programoutput == 0.18
+ - myst-parser == 5.0.0
+ - sphinx_rtd_theme == 3.0.2
+
+ # Used in ctsm_postprocessing repo
+ - pytest=8.3.5
+ - coverage=7.8.0
diff --git a/python/conda_env_ctsm_py_old_3.7.9.yml b/python/conda_env_ctsm_py_old_3.7.9.yml
index e77bab7634..0e329b84d4 100644
--- a/python/conda_env_ctsm_py_old_3.7.9.yml
+++ b/python/conda_env_ctsm_py_old_3.7.9.yml
@@ -1,6 +1,6 @@
-# This file is used by py_env_create to install the previous version of the ctsm_pylib environment,
+# This file is used by py_env_create to install a previous version of the ctsm_pylib environment,
# which used Python 3.7.9. Doing so is only useful for running CTSM python tools in repos from
-# before the new ctsm_pylib version (with Python 3.13.2) was introduced.
+# before the subsequent ctsm_pylib version (with Python 3.13.2) was introduced.
#
name: ctsm_pylib_3_7_9
channels:
diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90
index 03d14b2922..26b5ba941a 100644
--- a/src/biogeochem/CNVegCarbonFluxType.F90
+++ b/src/biogeochem/CNVegCarbonFluxType.F90
@@ -358,6 +358,8 @@ module CNVegCarbonFluxType
real(r8), pointer :: agnpp_patch (:) ! (gC/m2/s) aboveground NPP
real(r8), pointer :: bgnpp_patch (:) ! (gC/m2/s) belowground NPP
real(r8), pointer :: litfall_patch (:) ! (gC/m2/s) patch litterfall (leaves and fine roots)
+ real(r8), pointer :: veg_litter_mort_c_patch (:) ! (gC/m2/s) patch vegetation C to litter from non-fire mortality
+ real(r8), pointer :: veg_litter_fire_c_patch (:) ! (gC/m2/s) patch vegetation C to litter from fire mortality
real(r8), pointer :: wood_harvestc_patch (:) ! (gC/m2/s) patch-level wood harvest (to product pools)
real(r8), pointer :: wood_harvestc_col (:) ! (gC/m2/s) column-level wood harvest (to product pools) (p2c)
real(r8), pointer :: slash_harvestc_patch (:) ! (gC/m2/s) patch-level slash from harvest (to litter)
@@ -1122,6 +1124,8 @@ subroutine InitAllocate(this, bounds, carbon_type, alloc_full_veg)
allocate(this%agnpp_patch (begp:endp)) ; this%agnpp_patch (:) = nan
allocate(this%bgnpp_patch (begp:endp)) ; this%bgnpp_patch (:) = nan
allocate(this%litfall_patch (begp:endp)) ; this%litfall_patch (:) = nan
+ allocate(this%veg_litter_mort_c_patch (begp:endp)) ; this%veg_litter_mort_c_patch (:) = nan
+ allocate(this%veg_litter_fire_c_patch (begp:endp)) ; this%veg_litter_fire_c_patch (:) = nan
allocate(this%wood_harvestc_patch (begp:endp)) ; this%wood_harvestc_patch (:) = nan
allocate(this%slash_harvestc_patch (begp:endp)) ; this%slash_harvestc_patch (:) = nan
allocate(this%cinputs_patch (begp:endp)) ; this%cinputs_patch (:) = nan
@@ -2145,10 +2149,20 @@ subroutine InitHistory(this, bounds, carbon_type)
ptr_patch=this%bgnpp_patch)
this%litfall_patch(begp:endp) = spval
- call hist_addfld1d (fname='LITFALL', units='gC/m^2/s', &
- avgflag='A', long_name='litterfall (leaves and fine roots)', &
+ call hist_addfld1d (fname='LITFALLC', units='gC/m^2/s', &
+ avgflag='A', long_name='total C litterfall (all vegetation C fluxes to litter)', &
ptr_patch=this%litfall_patch)
+ this%veg_litter_mort_c_patch(begp:endp) = spval
+ call hist_addfld1d (fname='VEG_LITTER_MORT_C', units='gC/m^2/s', &
+ avgflag='A', long_name='vegetation carbon to litter from non-fire mortality', &
+ ptr_patch=this%veg_litter_mort_c_patch)
+
+ this%veg_litter_fire_c_patch(begp:endp) = spval
+ call hist_addfld1d (fname='VEG_LITTER_FIRE_C', units='gC/m^2/s', &
+ avgflag='A', long_name='vegetation carbon to litter from fire mortality', &
+ ptr_patch=this%veg_litter_fire_c_patch)
+
this%wood_harvestc_patch(begp:endp) = spval
call hist_addfld1d (fname='WOOD_HARVESTC', units='gC/m^2/s', &
avgflag='A', long_name='wood harvest carbon (to product pools)', &
@@ -2315,10 +2329,20 @@ subroutine InitHistory(this, bounds, carbon_type)
ptr_patch=this%bgnpp_patch, default='inactive')
this%litfall_patch(begp:endp) = spval
- call hist_addfld1d (fname='C13_LITFALL', units='gC13/m^2/s', &
- avgflag='A', long_name='C13 litterfall (leaves and fine roots)', &
+ call hist_addfld1d (fname='C13_LITFALLC', units='gC13/m^2/s', &
+ avgflag='A', long_name='C13 total litterfall (all vegetation C13 fluxes to litter)', &
ptr_patch=this%litfall_patch, default='inactive')
+ this%veg_litter_mort_c_patch(begp:endp) = spval
+ call hist_addfld1d (fname='C13_VEG_LITTER_MORT_C', units='gC13/m^2/s', &
+ avgflag='A', long_name='C13 vegetation carbon to litter from non-fire mortality', &
+ ptr_patch=this%veg_litter_mort_c_patch, default='inactive')
+
+ this%veg_litter_fire_c_patch(begp:endp) = spval
+ call hist_addfld1d (fname='C13_VEG_LITTER_FIRE_C', units='gC13/m^2/s', &
+ avgflag='A', long_name='C13 vegetation carbon to litter from fire mortality', &
+ ptr_patch=this%veg_litter_fire_c_patch, default='inactive')
+
this%fire_closs_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_PFT_FIRE_CLOSS', units='gC13/m^2/s', &
avgflag='A', long_name='C13 total patch-level fire C loss', &
@@ -3368,10 +3392,20 @@ subroutine InitHistory(this, bounds, carbon_type)
ptr_patch=this%bgnpp_patch, default='inactive')
this%litfall_patch(begp:endp) = spval
- call hist_addfld1d (fname='C14_LITFALL', units='gC14/m^2/s', &
- avgflag='A', long_name='C14 litterfall (leaves and fine roots)', &
+ call hist_addfld1d (fname='C14_LITFALLC', units='gC14/m^2/s', &
+ avgflag='A', long_name='C14 total litterfall (all vegetation C14 fluxes to litter)', &
ptr_patch=this%litfall_patch, default='inactive')
+ this%veg_litter_mort_c_patch(begp:endp) = spval
+ call hist_addfld1d (fname='C14_VEG_LITTER_MORT_C', units='gC14/m^2/s', &
+ avgflag='A', long_name='C14 vegetation carbon to litter from non-fire mortality', &
+ ptr_patch=this%veg_litter_mort_c_patch, default='inactive')
+
+ this%veg_litter_fire_c_patch(begp:endp) = spval
+ call hist_addfld1d (fname='C14_VEG_LITTER_FIRE_C', units='gC14/m^2/s', &
+ avgflag='A', long_name='C14 vegetation carbon to litter from fire mortality', &
+ ptr_patch=this%veg_litter_fire_c_patch, default='inactive')
+
this%fire_closs_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_PFT_FIRE_CLOSS', units='gC14/m^2/s', &
avgflag='A', long_name='C14 total patch-level fire C loss', &
@@ -4732,6 +4766,8 @@ subroutine SetValues ( this, nvegcpool, &
this%agnpp_patch(i) = value_patch
this%bgnpp_patch(i) = value_patch
this%litfall_patch(i) = value_patch
+ this%veg_litter_mort_c_patch(i) = value_patch
+ this%veg_litter_fire_c_patch(i) = value_patch
this%wood_harvestc_patch(i) = value_patch
this%slash_harvestc_patch(i) = value_patch
this%cinputs_patch(i) = value_patch
@@ -5067,11 +5103,9 @@ subroutine Summary_carbonflux(this, &
this%cpool_to_deadcrootc_patch(p) + &
this%deadcrootc_xfer_to_deadcrootc_patch(p)
- ! litterfall (LITFALL)
+ ! vegetation carbon to litter from non-fire mortality (VEG_LITTER_MORT_C)
- this%litfall_patch(p) = &
- this%leafc_to_litter_patch(p) + &
- this%frootc_to_litter_patch(p) + &
+ this%veg_litter_mort_c_patch(p) = &
this%m_leafc_to_litter_patch(p) + &
this%m_leafc_storage_to_litter_patch(p) + &
this%m_leafc_xfer_to_litter_patch(p) + &
@@ -5091,8 +5125,11 @@ subroutine Summary_carbonflux(this, &
this%m_deadcrootc_storage_to_litter_patch(p) + &
this%m_deadcrootc_xfer_to_litter_patch(p) + &
this%m_gresp_storage_to_litter_patch(p) + &
- this%m_gresp_xfer_to_litter_patch(p) + &
-
+ this%m_gresp_xfer_to_litter_patch(p)
+
+ ! vegetation carbon to litter from fire mortality (VEG_LITTER_FIRE_C)
+
+ this%veg_litter_fire_c_patch(p) = &
this%m_leafc_to_litter_fire_patch(p) + &
this%m_leafc_storage_to_litter_fire_patch(p) + &
this%m_leafc_xfer_to_litter_fire_patch(p) + &
@@ -5112,7 +5149,16 @@ subroutine Summary_carbonflux(this, &
this%m_deadcrootc_storage_to_litter_fire_patch(p) + &
this%m_deadcrootc_xfer_to_litter_fire_patch(p) + &
this%m_gresp_storage_to_litter_fire_patch(p) + &
- this%m_gresp_xfer_to_litter_fire_patch(p) + &
+ this%m_gresp_xfer_to_litter_fire_patch(p)
+
+ ! litterfall (LITFALLC)
+
+ this%litfall_patch(p) = &
+ this%leafc_to_litter_patch(p) + &
+ this%frootc_to_litter_patch(p) + &
+
+ this%veg_litter_mort_c_patch(p) + &
+ this%veg_litter_fire_c_patch(p) + &
this%hrv_leafc_to_litter_patch(p) + &
this%hrv_leafc_storage_to_litter_patch(p) + &
diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90
index 788be23137..fbbfee8182 100644
--- a/src/biogeochem/CNVegNitrogenFluxType.F90
+++ b/src/biogeochem/CNVegNitrogenFluxType.F90
@@ -15,7 +15,8 @@ module CNVegNitrogenFluxType
igrain,igrain_st,igrain_xf,iretransn,ioutn
use clm_varpar , only : mxharvests
use clm_varcon , only : spval, ispval, dzsoi_decomp
- use clm_varctl , only : use_nitrif_denitrif, use_crop
+ use clm_varctl , only : use_nitrif_denitrif, use_crop, use_grainproduct
+ use pftconMod , only : is_prognostic_crop
use CNSharedParamsMod , only : use_fun, use_matrixcn
use decompMod , only : bounds_type
use abortutils , only : endrun
@@ -124,6 +125,7 @@ module CNVegNitrogenFluxType
real(r8), pointer :: m_deadcrootn_xfer_to_litter_fire_patch (:) ! patch (gN/m2/s) from deadcrootn_xfer to deadcrootn due to fire
real(r8), pointer :: m_retransn_to_litter_fire_patch (:) ! patch (gN/m2/s) from retransn to deadcrootn due to fire
real(r8), pointer :: fire_nloss_patch (:) ! patch total patch-level fire N loss (gN/m2/s)
+ real(r8), pointer :: litfalln_patch (:) ! patch total N litterfall, all veg N fluxes to litter (gN/m2/s)
real(r8), pointer :: fire_nloss_col (:) ! col total column-level fire N loss (gN/m2/s)
real(r8), pointer :: fire_nloss_p2c_col (:) ! col patch2col column-level fire N loss (gN/m2/s) (p2c)
real(r8), pointer :: fire_mortality_n_to_cwdn_col (:,:) ! col N fluxes associated with fire mortality to CWD pool (gN/m3/s)
@@ -921,6 +923,7 @@ subroutine InitAllocate(this, bounds, alloc_full_veg)
allocate(this%ndeploy_patch (begp:endp)) ; this%ndeploy_patch (:) = nan
allocate(this%wood_harvestn_patch (begp:endp)) ; this%wood_harvestn_patch (:) = nan
allocate(this%fire_nloss_patch (begp:endp)) ; this%fire_nloss_patch (:) = nan
+ allocate(this%litfalln_patch (begp:endp)) ; this%litfalln_patch (:) = nan
allocate(this%npool_to_reproductiven_patch (begp:endp, nrepr)) ; this%npool_to_reproductiven_patch (:,:) = nan
allocate(this%npool_to_reproductiven_storage_patch(begp:endp, nrepr)); this%npool_to_reproductiven_storage_patch (:,:) = nan
allocate(this%livestemn_to_litter_patch (begp:endp)) ; this%livestemn_to_litter_patch (:) = nan
@@ -1532,6 +1535,11 @@ subroutine InitHistory(this, bounds)
avgflag='A', long_name='total patch-level fire N loss', &
ptr_patch=this%fire_nloss_patch)
+ this%litfalln_patch(begp:endp) = spval
+ call hist_addfld1d (fname='LITFALLN', units='gN/m^2/s', &
+ avgflag='A', long_name='total N litterfall (all vegetation N fluxes to litter)', &
+ ptr_patch=this%litfalln_patch)
+
if (use_crop) then
this%fert_patch(begp:endp) = spval
call hist_addfld1d (fname='NFERTILIZATION', units='gN/m^2/s', &
@@ -2448,6 +2456,7 @@ subroutine SetValues ( this,nvegnpool, &
this%ndeploy_patch(i) = value_patch
this%wood_harvestn_patch(i) = value_patch
this%fire_nloss_patch(i) = value_patch
+ this%litfalln_patch(i) = value_patch
this%crop_seedn_to_leaf_patch(i) = value_patch
this%crop_harvestn_to_cropprodn_patch(i) = value_patch
@@ -2701,6 +2710,98 @@ subroutine Summary_nitrogenflux(this, bounds, num_soilc, filter_soilc, num_soilp
this%gru_livecrootn_xfer_to_atm_patch(p) + &
this%gru_deadcrootn_xfer_to_atm_patch(p)
+ ! total N litterfall (LITFALLN); analogous to LITFALLC for carbon, plus
+ ! the retranslocated N pool terms that have no carbon equivalent
+ this%litfalln_patch(p) = &
+ ! phenology
+ this%leafn_to_litter_patch(p) + &
+ this%frootn_to_litter_patch(p) + &
+ ! gap mortality
+ this%m_leafn_to_litter_patch(p) + &
+ this%m_leafn_storage_to_litter_patch(p) + &
+ this%m_leafn_xfer_to_litter_patch(p) + &
+ this%m_frootn_to_litter_patch(p) + &
+ this%m_frootn_storage_to_litter_patch(p) + &
+ this%m_frootn_xfer_to_litter_patch(p) + &
+ this%m_livestemn_to_litter_patch(p) + &
+ this%m_livestemn_storage_to_litter_patch(p) + &
+ this%m_livestemn_xfer_to_litter_patch(p) + &
+ this%m_deadstemn_to_litter_patch(p) + &
+ this%m_deadstemn_storage_to_litter_patch(p) + &
+ this%m_deadstemn_xfer_to_litter_patch(p) + &
+ this%m_livecrootn_to_litter_patch(p) + &
+ this%m_livecrootn_storage_to_litter_patch(p) + &
+ this%m_livecrootn_xfer_to_litter_patch(p) + &
+ this%m_deadcrootn_to_litter_patch(p) + &
+ this%m_deadcrootn_storage_to_litter_patch(p) + &
+ this%m_deadcrootn_xfer_to_litter_patch(p) + &
+ this%m_retransn_to_litter_patch(p) + &
+ ! fire mortality
+ this%m_leafn_to_litter_fire_patch(p) + &
+ this%m_leafn_storage_to_litter_fire_patch(p) + &
+ this%m_leafn_xfer_to_litter_fire_patch(p) + &
+ this%m_livestemn_to_litter_fire_patch(p) + &
+ this%m_livestemn_storage_to_litter_fire_patch(p) + &
+ this%m_livestemn_xfer_to_litter_fire_patch(p) + &
+ this%m_deadstemn_to_litter_fire_patch(p) + &
+ this%m_deadstemn_storage_to_litter_fire_patch(p) + &
+ this%m_deadstemn_xfer_to_litter_fire_patch(p) + &
+ this%m_frootn_to_litter_fire_patch(p) + &
+ this%m_frootn_storage_to_litter_fire_patch(p) + &
+ this%m_frootn_xfer_to_litter_fire_patch(p) + &
+ this%m_livecrootn_to_litter_fire_patch(p) + &
+ this%m_livecrootn_storage_to_litter_fire_patch(p) + &
+ this%m_livecrootn_xfer_to_litter_fire_patch(p) + &
+ this%m_deadcrootn_to_litter_fire_patch(p) + &
+ this%m_deadcrootn_storage_to_litter_fire_patch(p) + &
+ this%m_deadcrootn_xfer_to_litter_fire_patch(p) + &
+ this%m_retransn_to_litter_fire_patch(p) + &
+ ! harvest
+ this%hrv_leafn_to_litter_patch(p) + &
+ this%hrv_leafn_storage_to_litter_patch(p) + &
+ this%hrv_leafn_xfer_to_litter_patch(p) + &
+ this%hrv_frootn_to_litter_patch(p) + &
+ this%hrv_frootn_storage_to_litter_patch(p) + &
+ this%hrv_frootn_xfer_to_litter_patch(p) + &
+ this%hrv_livestemn_to_litter_patch(p) + &
+ this%hrv_livestemn_storage_to_litter_patch(p) + &
+ this%hrv_livestemn_xfer_to_litter_patch(p) + &
+ this%hrv_deadstemn_storage_to_litter_patch(p) + &
+ this%hrv_deadstemn_xfer_to_litter_patch(p) + &
+ this%hrv_livecrootn_to_litter_patch(p) + &
+ this%hrv_livecrootn_storage_to_litter_patch(p) + &
+ this%hrv_livecrootn_xfer_to_litter_patch(p) + &
+ this%hrv_deadcrootn_to_litter_patch(p) + &
+ this%hrv_deadcrootn_storage_to_litter_patch(p) + &
+ this%hrv_deadcrootn_xfer_to_litter_patch(p) + &
+ this%hrv_retransn_to_litter_patch(p) + &
+ ! gross unrepresented landcover change
+ this%gru_leafn_to_litter_patch(p) + &
+ this%gru_frootn_to_litter_patch(p) + &
+ this%gru_livecrootn_to_litter_patch(p) + &
+ this%gru_deadcrootn_to_litter_patch(p) + &
+ this%gru_retransn_to_litter_patch(p)
+
+ if ( use_crop .and. is_prognostic_crop(patch%itype(p)) ) then
+ this%litfalln_patch(p) = &
+ this%litfalln_patch(p) + &
+ this%livestemn_to_litter_patch(p)
+
+ if (.not. use_grainproduct) then
+ do k = repr_grain_min, repr_grain_max
+ this%litfalln_patch(p) = &
+ this%litfalln_patch(p) + &
+ this%repr_grainn_to_food_patch(p,k)
+ end do
+ end if
+
+ do k = repr_structure_min, repr_structure_max
+ this%litfalln_patch(p) = &
+ this%litfalln_patch(p) + &
+ this%repr_structuren_to_litter_patch(p,k)
+ end do
+ end if
+
end do
call p2c(bounds, num_soilc, filter_soilc, &