├── .lib
└── git-fleximod
│ ├── git_fleximod
│ ├── __init__.py
│ ├── lstripreader.py
│ ├── gitmodules.py
│ ├── cli.py
│ ├── gitinterface.py
│ ├── metoflexi.py
│ └── utils.py
│ ├── tests
│ ├── __init__.py
│ ├── test_a_import.py
│ ├── utils_for_tests.py
│ ├── test_c_required.py
│ ├── test_d_complex.py
│ ├── test_e_complex_update.py
│ ├── test_b_update.py
│ └── conftest.py
│ ├── .github
│ └── workflows
│ │ ├── pre-commit
│ │ └── pytest.yaml
│ ├── doc
│ ├── index.rst
│ ├── Makefile
│ ├── make.bat
│ └── conf.py
│ ├── .pre-commit-config.yaml
│ ├── escomp_install
│ ├── tbump.toml
│ ├── License
│ ├── pyproject.toml
│ ├── README.md
│ └── CODE_OF_CONDUCT.md
├── cime_config
├── README.md
├── testmods_dirs
│ └── allactive
│ │ ├── aoflux_agrid
│ │ ├── include_user_mods
│ │ └── user_nl_cpl
│ │ ├── aoflux_ogrid
│ │ ├── include_user_mods
│ │ └── user_nl_cpl
│ │ ├── crossleap
│ │ ├── include_user_mods
│ │ └── shell_commands
│ │ ├── decstart
│ │ ├── include_user_mods
│ │ └── shell_commands
│ │ ├── defaultiomi
│ │ ├── include_user_mods
│ │ └── shell_commands
│ │ ├── cism
│ │ └── test_coupling
│ │ │ ├── include_user_mods
│ │ │ ├── README
│ │ │ ├── shell_commands
│ │ │ ├── user_nl_cism
│ │ │ └── user_nl_clm
│ │ ├── crossleap_gregorian
│ │ ├── include_user_mods
│ │ └── shell_commands
│ │ ├── defaultio
│ │ ├── user_nl_cam
│ │ ├── user_nl_clm
│ │ ├── user_nl_cism
│ │ ├── user_nl_mosart
│ │ ├── user_nl_rtm
│ │ └── user_nl_cice
│ │ ├── maxthroughputb
│ │ ├── user_nl_cam
│ │ └── shell_commands
│ │ └── maxthroughputfw
│ │ └── shell_commands
├── usermods_dirs
│ └── README
├── config_tests.xml
├── SystemTests
│ └── funitshare.py
├── testfiles
│ └── ExpectedTestFails.xml
├── config_compsets.xml
└── testlist_allactive.xml
├── doc
├── source
│ ├── _templates
│ │ ├── layout.html
│ │ └── footer.html
│ ├── index.rst
│ ├── _static
│ │ └── pop_ver.js
│ ├── introduction.rst
│ ├── conf.py
│ ├── downloading_cesm.rst
│ └── quickstart.rst
├── Makefile
└── README.md
├── .github
├── ISSUE_TEMPLATE
│ ├── 02_enhancement.md
│ ├── 01_bug_report.md
│ └── config.yml
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── derecho.yaml
│ ├── fleximod_test.yaml
│ ├── build.yaml
│ └── preview_namelist.yaml
├── .gitignore
├── bin
└── git-fleximod
├── tools
└── statistical_ensemble_test
│ ├── user_nl_cam_LENS
│ ├── addmetadata.sh
│ ├── README
│ └── ensemble.py
├── describe_version
├── ChangeLog_template
├── LICENSE.txt
├── .gitmodules
└── README.rst
/.lib/git-fleximod/git_fleximod/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cime_config/README.md:
--------------------------------------------------------------------------------
1 | # cime_config
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/aoflux_agrid/include_user_mods:
--------------------------------------------------------------------------------
1 | ../defaultio
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/aoflux_ogrid/include_user_mods:
--------------------------------------------------------------------------------
1 | ../defaultio
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/crossleap/include_user_mods:
--------------------------------------------------------------------------------
1 | ../defaultio
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/decstart/include_user_mods:
--------------------------------------------------------------------------------
1 | ../defaultio
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/defaultiomi/include_user_mods:
--------------------------------------------------------------------------------
1 | ../defaultio
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/aoflux_agrid/user_nl_cpl:
--------------------------------------------------------------------------------
1 | aoflux_grid = "agrid"
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/aoflux_ogrid/user_nl_cpl:
--------------------------------------------------------------------------------
1 | aoflux_grid = "ogrid"
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/cism/test_coupling/include_user_mods:
--------------------------------------------------------------------------------
1 | ../../defaultio
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/crossleap_gregorian/include_user_mods:
--------------------------------------------------------------------------------
1 | ../crossleap
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/defaultiomi/shell_commands:
--------------------------------------------------------------------------------
1 | ./xmlchange NTASKS_OCN=-2
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/crossleap_gregorian/shell_commands:
--------------------------------------------------------------------------------
1 | ./xmlchange CALENDAR=GREGORIAN
2 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/defaultio/user_nl_cam:
--------------------------------------------------------------------------------
1 | nhtfrq = -24
2 | mfilt = 1
3 | ndens = 1
4 |
--------------------------------------------------------------------------------
/doc/source/_templates/layout.html:
--------------------------------------------------------------------------------
1 | {% extends "!layout.html" %}
2 |
3 | {% set script_files = script_files + ["_static/pop_ver.js"] %}
--------------------------------------------------------------------------------
/.lib/git-fleximod/tests/__init__.py:
--------------------------------------------------------------------------------
1 | import sys, os
2 |
3 | sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir, "src"))
4 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/decstart/shell_commands:
--------------------------------------------------------------------------------
1 | ./xmlchange RUN_STARTDATE=2001-12-30
2 | ./xmlchange CLM_BLDNML_OPTS=-ignore_warnings --append
3 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/crossleap/shell_commands:
--------------------------------------------------------------------------------
1 | ./xmlchange RUN_STARTDATE=2004-02-28
2 | ./xmlchange CLM_BLDNML_OPTS=-ignore_warnings --append
3 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/defaultio/user_nl_clm:
--------------------------------------------------------------------------------
1 | hist_dov2xy = .true.
2 | hist_ndens = 1
3 | hist_nhtfrq =-24
4 | hist_mfilt = 1
5 |
--------------------------------------------------------------------------------
/cime_config/usermods_dirs/README:
--------------------------------------------------------------------------------
1 | Directories here can be included in a case via the --user-mods-dir
2 | argument to create_newcase, or via the CPL_USER_MODS XML variable.
3 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/cism/test_coupling/README:
--------------------------------------------------------------------------------
1 | The purpose of this testmod directory is to enable CISM's dynamics on
2 | the short (multi-day) time scales typical of fully-active tests.
3 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/maxthroughputb/user_nl_cam:
--------------------------------------------------------------------------------
1 | ! Users should add all user specific namelist changes below in the form of
2 | ! namelist_var = new_namelist_value
3 | npr_yz= 64,18,18,64
4 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/defaultio/user_nl_cism:
--------------------------------------------------------------------------------
1 |
2 | ! This is needed to give CISM history output in the (typically short)
3 | ! tests that are done with this testmod directory
4 | history_option = 'coupler'
5 |
--------------------------------------------------------------------------------
/doc/source/_templates/footer.html:
--------------------------------------------------------------------------------
1 | {% extends "!footer.html" %}
2 | {% block extrafooter %}
3 | {{ super() }}
4 |
5 | {% endblock %}
6 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/02_enhancement.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Enhancement request, CESM-wide or unknown component
3 | about: Suggest a CESM-wide enhancement; in many cases, one of the links below is more appropriate
4 |
5 | ---
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/cism/test_coupling/shell_commands:
--------------------------------------------------------------------------------
1 | # Since we're doing a daily mass balance time step in CISM, we can't use the default GLC_AVG_PERIOD of yearly
2 | ./xmlchange GLC_AVG_PERIOD=glc_coupling_period
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # generated local files
2 | *.log
3 |
4 | # editor files
5 | *~
6 | *.bak
7 |
8 | # generated python files
9 | *.pyc
10 | __pycache__
11 |
12 | # ignore for the merge to master and orphaning of the gh-pages branch
13 | doc/build
14 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/cism/test_coupling/user_nl_cism:
--------------------------------------------------------------------------------
1 |
2 | ! This option changes the ice sheet dynamics time step to 1 day rather than 1 year
3 | ! Thus, the ice sheet dynamics can be exercised in a few-day run
4 | test_coupling = .true.
5 |
--------------------------------------------------------------------------------
/bin/git-fleximod:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import sys
3 | import os
4 | sys.path.insert(0,os.path.abspath(os.path.join(os.path.dirname(__file__),"..",".lib","git-fleximod")))
5 | from git_fleximod.git_fleximod import main
6 |
7 | if __name__ == '__main__':
8 | sys.exit(main())
9 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/tests/test_a_import.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=unused-import
2 | from git_fleximod import cli
3 | from git_fleximod import utils
4 | from git_fleximod.gitinterface import GitInterface
5 | from git_fleximod.gitmodules import GitModules
6 |
7 |
8 | def test_import():
9 | print("here")
10 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/.github/workflows/pre-commit:
--------------------------------------------------------------------------------
1 | name: pre-commit
2 | on:
3 | pull_request:
4 | push:
5 | branches: [main]
6 |
7 | jobs:
8 | pre-commit:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@v3
12 | - uses: actions/setup-python@v3
13 | - uses: pre-commit/action@v3.0.0
14 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/maxthroughputfw/shell_commands:
--------------------------------------------------------------------------------
1 | # copy the spmd_mod.F90
2 | # This performance test is only expected to work on yellowstone
3 | cp /glade/u/home/jedwards/b1850/SourceMods/src.cam/* SourceMods/src.cam
4 | ./xmlchange NTASKS=2048
5 | ./xmlchange NTHRDS=4
6 | ./xmlchange --append CAM_CONFIG_OPTS="-pcols 8"
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/tests/utils_for_tests.py:
--------------------------------------------------------------------------------
1 | """
2 | Helper functions that can be used in tests
3 | """
4 |
5 |
6 | def normalize_whitespace(text):
7 | """
8 | Normalize whitespace for flexible string comparisons in tests.
9 |
10 | This removes leading and trailing whitespace and collapses other whitespace down to a
11 | single space.
12 | """
13 | return " ".join(text.split())
14 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Description of changes
2 |
3 | ### Specific notes
4 |
5 | Contributors other than yourself, if any:
6 |
7 | Fixes: [Github issue #s] And brief description of each issue.
8 |
9 | User interface changes?: [ No/Yes ]
10 | [ If yes, describe what changed, and steps taken to ensure backward compatibility ]
11 |
12 | Testing performed (automated tests and/or manual tests):
13 |
14 |
--------------------------------------------------------------------------------
/cime_config/config_tests.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 | Run the share code's Fortran unit tests. Grid and compset (and most case settings) are ignored.
11 | 1
12 | ndays
13 | 11
14 | FALSE
15 | FALSE
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/doc/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | SPHINXPROJ = cesm2_quickstart
8 | SOURCEDIR = source
9 | BUILDDIR = build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/defaultio/user_nl_mosart:
--------------------------------------------------------------------------------
1 | !----------------------------------------------------------------------------------
2 | ! Users should add all user specific namelist changes below in the form of
3 | ! namelist_var = new_namelist_value
4 | ! NOTE: namelist variable tstep CAN ONLY be changed by modifying the value
5 | ! of the xml variable ROF_NCPL in env_run.xml
6 | ! NOTE: if the xml variable RTM_MODE in env_run.xml is set to 'NULL', then
7 | ! then rtm will set rtm_present to .false. - and will ignore everything else
8 | !----------------------------------------------------------------------------------
9 | ndens = 1
10 | nhtfrq =-24
11 | mfilt = 1
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/doc/index.rst:
--------------------------------------------------------------------------------
1 | .. git-fleximod documentation master file, created by
2 | sphinx-quickstart on Sat Feb 3 12:02:22 2024.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Welcome to git-fleximod's documentation!
7 | ========================================
8 |
9 | .. toctree::
10 | :maxdepth: 2
11 | :caption: Contents:
12 | .. module:: sphinxcontrib.autoprogram
13 | .. sphinx_argparse_cli::
14 | :module: git_fleximod.cli
15 | :func: get_parser
16 | :prog: git-fleximod
17 |
18 |
19 | Indices and tables
20 | ==================
21 |
22 | * :ref:`genindex`
23 | * :ref:`modindex`
24 | * :ref:`search`
25 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/defaultio/user_nl_rtm:
--------------------------------------------------------------------------------
1 | !----------------------------------------------------------------------------------
2 | ! Users should add all user specific namelist changes below in the form of
3 | ! namelist_var = new_namelist_value
4 | ! NOTE: namelist variable rtm_tstep CAN ONLY be changed by modifying the value
5 | ! of the xml variable ROF_NCPL in env_run.xml
6 | ! NOTE: if the xml variable RTM_MODE in env_run.xml is set to 'NULL', then
7 | ! then rtm will set rtm_present to .false. - and will ignore everything else
8 | !----------------------------------------------------------------------------------
9 | rtmhist_ndens = 1
10 | rtmhist_nhtfrq =-24
11 | rtmhist_mfilt = 1
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/doc/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line, and also
5 | # from the environment for the first two.
6 | SPHINXOPTS ?=
7 | SPHINXBUILD ?= sphinx-build
8 | SOURCEDIR = .
9 | BUILDDIR = _build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | exclude: ^utils/.*$
2 |
3 | repos:
4 | - repo: https://github.com/pre-commit/pre-commit-hooks
5 | rev: v6.0.0
6 | hooks:
7 | - id: end-of-file-fixer
8 | - id: trailing-whitespace
9 | - repo: https://github.com/psf/black
10 | rev: 22.3.0
11 | hooks:
12 | - id: black
13 | - repo: https://github.com/PyCQA/pylint
14 | rev: v2.11.1
15 | hooks:
16 | - id: pylint
17 | args:
18 | - --disable=I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement,logging-format-interpolation,no-name-in-module,arguments-renamed,unspecified-encoding,protected-access,import-error,no-member
19 |
--------------------------------------------------------------------------------
/doc/source/index.rst:
--------------------------------------------------------------------------------
1 | .. CESM2 Quickstart Guide master file, created by
2 | sphinx-quickstart on Wed Mar 29 12:57:57 2017.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | CESM Quickstart Guide (|version|)
7 | =================================
8 |
9 | .. important::
10 | **There are separate versions of this documentation for each maintained CESM
11 | release. Use the menu at the top left to select the version of CESM you are using.**
12 |
13 | Table of contents
14 | -----------------
15 |
16 | .. toctree::
17 | :maxdepth: 2
18 |
19 | introduction.rst
20 | downloading_cesm.rst
21 | cesm_configurations.rst
22 | quickstart.rst
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/cism/test_coupling/user_nl_clm:
--------------------------------------------------------------------------------
1 |
2 | ! This is needed to tell CLM to allow the non-annual-boundary glacier changes that arise
3 | ! with this testmod.
4 | for_testing_allow_non_annual_changes = .true.
5 |
6 | ! When we have daily rather than annual glacier dynamics (as we do in this testmod, due
7 | ! to having test_coupling in user_nl_cism), CLM applies the dynbal adjustments in a
8 | ! single time step rather than spreading them throughout the year. This can cause
9 | ! sensible heat fluxes of thousands of W m-2, which causes CAM's PBL scheme to blow up.
10 | ! So force these fluxes to zero for this testmod; this breaks water and energy
11 | ! conservation in CLM, but should allow the test to pass.
12 | for_testing_zero_dynbal_fluxes = .true.
13 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/doc/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | pushd %~dp0
4 |
5 | REM Command file for Sphinx documentation
6 |
7 | if "%SPHINXBUILD%" == "" (
8 | set SPHINXBUILD=sphinx-build
9 | )
10 | set SOURCEDIR=.
11 | set BUILDDIR=_build
12 |
13 | %SPHINXBUILD% >NUL 2>NUL
14 | if errorlevel 9009 (
15 | echo.
16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17 | echo.installed, then set the SPHINXBUILD environment variable to point
18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
19 | echo.may add the Sphinx directory to PATH.
20 | echo.
21 | echo.If you don't have Sphinx installed, grab it from
22 | echo.https://www.sphinx-doc.org/
23 | exit /b 1
24 | )
25 |
26 | if "%1" == "" goto help
27 |
28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29 | goto end
30 |
31 | :help
32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33 |
34 | :end
35 | popd
36 |
--------------------------------------------------------------------------------
/.github/workflows/derecho.yaml:
--------------------------------------------------------------------------------
1 | name: cesm-derecho-hosted
2 | run-name: ${{ github.actor }} is testing the project
3 |
4 | on:
5 | pull_request:
6 | branches: [ cesm3.0-alphabranch ]
7 | types: [ labeled ]
8 |
9 | jobs:
10 |
11 | setup:
12 | # only run this workflow if the label run-pr-tests is applied
13 | if: ${{ github.event.label.name == 'run-pr-tests' }}
14 | # currently hpc-runner is derecho.hpc.ucar.edu
15 | runs-on: hpc-runner
16 |
17 | steps:
18 | - name: Checkout code
19 | uses: actions/checkout@v4
20 | - name: Run git-fleximod
21 | run: |
22 | pwd
23 | module list
24 | ./bin/git-fleximod update
25 |
26 | build:
27 | strategy:
28 | # run all matrix members even if one fails
29 | fail-fast: false
30 | matrix:
31 | compiler: [gnu, intel, intel-oneapi, nvhpc]
32 | uses: ./.github/workflows/build.yaml
33 | with:
34 | compiler: ${{ matrix.compiler }}
35 |
--------------------------------------------------------------------------------
/.github/workflows/fleximod_test.yaml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | branches: [ cesm3.0-alphabranch ]
4 | pull_request:
5 | branches: [ cesm3.0-alphabranch ]
6 | jobs:
7 | fleximod-test:
8 | runs-on: ubuntu-latest
9 | strategy:
10 | fail-fast: false
11 | matrix:
12 | # oldest supported and latest supported
13 | python-version: ["3.7", "3.x"]
14 | steps:
15 | - id: checkout-CESM
16 | uses: actions/checkout@v4
17 | - id: run-fleximod
18 | run: |
19 | $GITHUB_WORKSPACE/bin/git-fleximod update -o
20 | echo
21 | echo "Update complete, checking status"
22 | echo
23 | $GITHUB_WORKSPACE/bin/git-fleximod test
24 | - id: check-cleanliness
25 | run: |
26 | echo
27 | echo "Checking if git fleximod matches expected externals"
28 | echo
29 | git add . && git diff --exit-code && git diff --cached --exit-code
30 | # - name: Setup tmate session
31 | # if: ${{ failure() }}
32 | # uses: mxschmitt/action-tmate@v3
33 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/doc/conf.py:
--------------------------------------------------------------------------------
1 | # Configuration file for the Sphinx documentation builder.
2 | #
3 | # For the full list of built-in configuration values, see the documentation:
4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
5 |
6 | # -- Project information -----------------------------------------------------
7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8 |
9 | project = "git-fleximod"
10 | author = "Jim Edwards "
11 | release = "0.4.0"
12 |
13 | # -- General configuration ---------------------------------------------------
14 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15 |
16 | extensions = ["sphinx_argparse_cli"]
17 |
18 | templates_path = ["_templates"]
19 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
20 |
21 |
22 | # -- Options for HTML output -------------------------------------------------
23 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
24 |
25 | html_theme = "alabaster"
26 | html_static_path = ["_static"]
27 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/escomp_install:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # updates git-fleximod in an ESCOMP model
3 | # this script should be run from the model root directory, it expects
4 | # git-fleximod to already be installed with the script in bin
5 | # and the classes in lib/python/site-packages
6 | import sys
7 | import shutil
8 | import os
9 |
10 | from glob import iglob
11 |
12 | fleximod_root = sys.argv[1]
13 | fleximod_path = os.path.join(fleximod_root,"src","git-fleximod")
14 | if os.path.isfile(fleximod_path):
15 | with open(fleximod_path,"r") as f:
16 | fleximod = f.readlines()
17 | with open(os.path.join(".","bin","git-fleximod"),"w") as f:
18 | for line in fleximod:
19 | f.write(line)
20 | if "import argparse" in line:
21 | f.write('\nsys.path.append(os.path.join(os.path.dirname(__file__),"..","lib","python","site-packages"))\n\n')
22 |
23 | for file in iglob(os.path.join(fleximod_root, "src", "fleximod", "*.py")):
24 | shutil.copy(file,
25 | os.path.join("lib","python","site-packages","fleximod",os.path.basename(file)))
26 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/01_bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report, CESM-wide or unknown component
3 | about: Report a problem with CESM for an unknown component; in many cases, one of the links below is more appropriate
4 |
5 | ---
6 |
7 | ### Brief summary of bug
8 |
9 | [Give a one or two sentence summary. This could be the same as the issue title if you feel that is a sufficient summary.]
10 |
11 | ### General bug information
12 |
13 | **CESM version you are using:** [Output of `git describe`]
14 |
15 | **Machine you are using:** [Fill this in]
16 |
17 | **Have you modified the code? (If so, please point us to you changes.):** [Yes / No]
18 |
19 | ### Details of bug
20 |
21 | [Fill in details here.]
22 |
23 | ### Steps to reproduce the problem. Include externals description file(s) and link to public repository
24 |
25 | [Fill this in with anything relevant that you haven't already noted; if there is nothing to add, delete this section.]
26 |
27 | ### Screen output or log file showing the error message and context
28 |
29 | [Fill this in with anything relevant that you haven't already noted; if there is nothing to add, delete this section.]
30 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/tbump.toml:
--------------------------------------------------------------------------------
1 | # Uncomment this if your project is hosted on GitHub:
2 | github_url = "https://github.com/jedwards4b/git-fleximod/"
3 |
4 | [version]
5 | current = "1.1.1"
6 |
7 | # Example of a semver regexp.
8 | # Make sure this matches current_version before
9 | # using tbump
10 | regex = '''
11 | (?P\d+)
12 | \.
13 | (?P\d+)
14 | \.
15 | (?P\d+)
16 | '''
17 |
18 | [git]
19 | message_template = "Bump to {new_version}"
20 | tag_template = "v{new_version}"
21 |
22 | # For each file to patch, add a [[file]] config
23 | # section containing the path of the file, relative to the
24 | # tbump.toml location.
25 | [[file]]
26 | src = "git_fleximod/cli.py"
27 |
28 | [[file]]
29 | src = "pyproject.toml"
30 |
31 | # You can specify a list of commands to
32 | # run after the files have been patched
33 | # and before the git commit is made
34 |
35 | # [[before_commit]]
36 | # name = "check changelog"
37 | # cmd = "grep -q {new_version} Changelog.rst"
38 |
39 | # Or run some commands after the git tag and the branch
40 | # have been pushed:
41 | # [[after_push]]
42 | # name = "publish"
43 | # cmd = "./publish.sh"
44 |
--------------------------------------------------------------------------------
/cime_config/testmods_dirs/allactive/maxthroughputb/shell_commands:
--------------------------------------------------------------------------------
1 | # copy the spmd_mod.F90
2 | # This performance test is only expected to work on yellowstone
3 | cp /glade/u/home/jedwards/b1850/SourceMods/src.cam/* SourceMods/src.cam
4 | NTASKS_ATM=1920
5 | NTASKS_CPL=608
6 | NTASKS_LND=1184
7 | NTASKS_ICE=608
8 | NTASKS_WAV=128
9 | NTASKS_OCN=192
10 | NTHRDS=2
11 |
12 | ROOTPE_WAV=$(($NTASKS_LND + $NTASKS_ICE))
13 | #ROOTPE_CPL=$(($ROOTPE_WAV + $NTASKS_WAV))
14 | ROOTPE_CPL=$NTASKS_LND
15 | COST_PES=$(($NTHRDS*($NTASKS_ATM + $NTASKS_OCN)))
16 | ROOTPE_OCN=$(($NTASKS_ATM))
17 |
18 | ./xmlchange MAX_MPITASKS_PER_NODE=16
19 | ./xmlchange MAX_TASKS_PER_NODE=16
20 | ./xmlchange NTASKS_ATM=$NTASKS_ATM
21 | ./xmlchange NTASKS_CPL=$NTASKS_CPL
22 | ./xmlchange NTASKS_GLC=$NTASKS_ATM
23 | ./xmlchange NTASKS_LND=$NTASKS_LND
24 | ./xmlchange NTASKS_ROF=$NTASKS_LND
25 | ./xmlchange NTASKS_ICE=$NTASKS_ICE
26 | ./xmlchange NTASKS_WAV=$NTASKS_WAV
27 | ./xmlchange NTASKS_OCN=$NTASKS_OCN
28 | ./xmlchange ROOTPE_OCN=$ROOTPE_OCN
29 | ./xmlchange ROOTPE_ICE=$NTASKS_LND
30 | ./xmlchange ROOTPE_WAV=$ROOTPE_WAV
31 | ./xmlchange ROOTPE_CPL=$ROOTPE_CPL
32 | ./xmlchange NTHRDS=$NTHRDS
33 |
34 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/License:
--------------------------------------------------------------------------------
1 | Copyright 2024 NSF National Center for Atmospheric Sciences (NCAR)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | “Software”), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool.poetry]
2 | name = "git-fleximod"
3 | version = "1.1.1"
4 | description = "Extended support for git-submodule and git-sparse-checkout"
5 | authors = ["Jim Edwards "]
6 | maintainers = ["Jim Edwards "]
7 | license = "MIT"
8 | readme = "README.md"
9 | homepage = "https://github.com/jedwards4b/git-fleximod"
10 | keywords = ["git", "submodule", "sparse-checkout"]
11 | packages = [
12 | { include = "git_fleximod"},
13 | { include = "doc"},
14 | { include = "README.md"},
15 | ]
16 |
17 | [tool.poetry.scripts]
18 | git-fleximod = "git_fleximod.git_fleximod:main"
19 | me2flexi = "git_fleximod.metoflexi:_main"
20 | fsspec = "fsspec.fuse:main"
21 |
22 | [tool.poetry.dependencies]
23 | python = ">=3.9"
24 | GitPython = "^3.1.0"
25 | sphinx = "^5.0.0"
26 | fsspec = "^2023.12.2"
27 | wheel = "^0.42.0"
28 | pytest = "^8.0.0"
29 | pyfakefs = "^5.3.5"
30 | pre-commit = "4.3.0"
31 | wrapt = ">=2.0.0"
32 |
33 | [tool.poetry.urls]
34 | "Bug Tracker" = "https://github.com/jedwards4b/git-fleximod/issues"
35 |
36 | [tool.pytest.ini_options]
37 | markers = [
38 | "skip_after_first: only run on first iteration"
39 | ]
40 |
41 | [build-system]
42 | requires = ["poetry-core"]
43 | build-backend = "poetry.core.masonry.api"
44 |
--------------------------------------------------------------------------------
/cime_config/SystemTests/funitshare.py:
--------------------------------------------------------------------------------
1 | """
2 | Implementation of the share code FUNIT test.
3 |
4 | This "system" test runs the share code's Fortran unit tests. We're abusing the system test
5 | infrastructure to run these, so that a run of the test suite can result in the unit tests
6 | being run as well.
7 |
8 | Grid and compset are irrelevant for this test type.
9 | """
10 |
11 | import os
12 | from CIME.SystemTests.funit import FUNIT
13 | from CIME.XML.standard_module_setup import *
14 |
15 | logger = logging.getLogger(__name__)
16 |
17 |
18 | class FUNITSHARE(FUNIT):
19 | def __init__(self, case):
20 | FUNIT.__init__(self, case)
21 |
22 | # The CMake build for the share unit tests uses the MPISERIAL env var to find the
23 | # mpi-serial library. On derecho, MPISERIAL is not set even if the mpi-serial
24 | # module is loaded; instead, there is an NCAR_ROOT_MPI_SERIAL variable. Set the
25 | # needed MPISERIAL env var for this test.
26 | if "NCAR_ROOT_MPI_SERIAL" in os.environ:
27 | os.environ["MPISERIAL"] = os.environ["NCAR_ROOT_MPI_SERIAL"]
28 |
29 | def get_test_spec_dir(self):
30 | return os.path.join(self._case.get_value("SRCROOT"), "share")
31 |
32 | def get_extra_run_tests_args(self):
33 | return '--cmake-args " -DUNITTESTS=ON -DUSE_CIME_MACROS=ON"'
34 |
--------------------------------------------------------------------------------
/.lib/git-fleximod/git_fleximod/lstripreader.py:
--------------------------------------------------------------------------------
1 | class LstripReader(object):
2 | "LstripReader formats .gitmodules files to be acceptable for configparser"
3 |
4 | def __init__(self, filename):
5 | with open(filename, "r") as infile:
6 | lines = infile.readlines()
7 | self._lines = list()
8 | self._num_lines = len(lines)
9 | self._index = 0
10 | for line in lines:
11 | self._lines.append(line.lstrip())
12 |
13 | def readlines(self):
14 | """Return all the lines from this object's file"""
15 | return self._lines
16 |
17 | def readline(self, size=-1):
18 | """Format and return the next line or raise StopIteration"""
19 | try:
20 | line = self.next()
21 | except StopIteration:
22 | line = ""
23 |
24 | if (size > 0) and (len(line) < size):
25 | return line[0:size]
26 |
27 | return line
28 |
29 | def __iter__(self):
30 | """Begin an iteration"""
31 | self._index = 0
32 | return self
33 |
34 | def next(self):
35 | """Return the next line or raise StopIteration"""
36 | if self._index >= self._num_lines:
37 | raise StopIteration
38 |
39 | self._index = self._index + 1
40 | return self._lines[self._index - 1]
41 |
42 | def __next__(self):
43 | return self.next()
44 |
--------------------------------------------------------------------------------
/tools/statistical_ensemble_test/user_nl_cam_LENS:
--------------------------------------------------------------------------------
1 | ! Users should add all user specific namelist changes below in the form of
2 | ! namelist_var = new_namelist_value
3 | ! These are specific changes to CAM for the LENS experiment
4 | cldfrc_rhminl = 0.8925D0
5 | empty_htapes=.true.
6 | fincl1='ABSORB:A','ANRAIN:A','ANSNOW:A','AODDUST1:A','AODDUST2:A','AODDUST3:A',
7 | 'AODVIS:A','AQRAIN:A','AQSNOW:A','AREI:A','AREL:A','AWNC:A','AWNI:A','CDNUMC:A',
8 | 'CLDHGH:A','CLDICE:A','CLDLIQ:A','CLDLOW:A','CLDMED:A','CLDTOT:A','CLOUD:A',
9 | 'DCQ:A','DTCOND:A','DTV:A','FICE:A','FLDS:A','FLNS:A','FLNSC:A','FLNT:A',
10 | 'FLNTC:A','FLUT:A','FLUTC:A','FREQI:A','FREQL:A','FREQR:A','FREQS:A','FSDS:A',
11 | 'FSDSC:A','FSNS:A','FSNSC:A','FSNT:A','FSNTC:A','FSNTOA:A','FSNTOAC:A',
12 | 'ICEFRAC:A','ICIMR:A','ICWMR:A','IWC:A','LANDFRAC:A','LHFLX:A','LWCF:A',
13 | 'NUMICE:A','NUMLIQ:A','OCNFRAC:A','OMEGA:A','OMEGAT:A','PBLH:A','PRECC:A',
14 | 'PRECL:A','PRECSC:A','PRECSL:A','PS:A','PSL:A','Q:A','QFLX:A','QRL:A','QRS:A',
15 | 'RELHUM:A','SHFLX:A','SNOWHICE:A','SNOWHLND:A','SOLIN:A','SRFRAD:A','SWCF:A',
16 | 'T:A','TAUX:A','TAUY:A','TGCLDIWP:A','TGCLDLWP:A','TMQ:A','TREFHT:A','TS:A',
17 | 'U:A','U10:A','UU:A','V:A','VD01:A','VQ:A','VT:A','VU:A','VV:A','WSUB:A','Z3:A',
18 | 'CCN3:A','UQ:A','WGUSTD:X','WSPDSRFMX:A','TSMX:X','TSMN:M','TREFHTMX:X','TREFHTMN:M',
19 | 'bc_a1_SRF:A','dst_a1_SRF:A','dst_a3_SRF:A','pom_a1_SRF:A','so4_a1_SRF:A',
20 | 'so4_a2_SRF:A','so4_a3_SRF:A','soa_a1_SRF:A','soa_a2_SRF:A','BURDENSO4:A',
21 | 'BURDENBC:A','BURDENPOM:A','BURDENSOA:A','BURDENDUST:A','BURDENSEASALT:A',
22 | 'AODABS:A','EXTINCT:A','PHIS:A','TROP_P:A','TROP_T:A','TOT_CLD_VISTAU:A',
23 | 'ICLDIWP:A','ICLDTWP:A','CO2:A','CO2_LND:A','CO2_OCN:A','SFCO2:A','SFCO2_LND:A',
24 | 'SFCO2_OCN:A','TMCO2:A','TMCO2_LND:A','TMCO2_OCN:A''CO2_FFF:A', 'SFCO2_FFF:A', 'TMCO2_FFF:A'
25 |
--------------------------------------------------------------------------------
/.github/workflows/build.yaml:
--------------------------------------------------------------------------------
1 | on:
2 | workflow_call:
3 | inputs:
4 | compiler:
5 | type: string
6 | required: true
7 |
8 | jobs:
9 | test:
10 | # This statement avoids failures in another instance (another compiler) to cancel this run
11 | # it also prevents canceling the run using the cancel button on the github website
12 | # another form (if: success() || failure()) should allow the cancel button to work but tests with that form didnt act as expected
13 | if: ${{ ! cancelled() }}
14 | env:
15 | CC: mpicc
16 | FC: mpifort
17 | CXX: mpicxx
18 | CIME_MODEL: cesm
19 | CIME_DRIVER: nuopc
20 | runs-on: hpc-runner
21 | defaults:
22 | run:
23 | shell: bash {0}
24 | steps:
25 | - name: Run ${{ inputs.compiler }} tests
26 | # Allows the check status step to run even if this one fails
27 | continue-on-error: true
28 | run: |
29 | pwd
30 | cd cime/scripts
31 | module load cmake
32 | # Need to use main queue to avoid memory overflow errors
33 | qcmd -q main -v PROJECT=P93300606 -A P93300606 -l walltime=02:00:00 -- ./create_test --xml-machine derecho\
34 | --xml-category github --no-run --compiler ${{ inputs.compiler }} --test-id ${GITHUB_RUN_ID}${{ inputs.compiler }}
35 | - name: check status
36 | run: |
37 | cd $SCRATCH
38 | # if no fails and no passes in expected fails then cleanup and exit 0 otherwise exit 1
39 | ./cs.status.${GITHUB_RUN_ID}${{ inputs.compiler }} --fails-only --expected-fails-file $GITHUB_WORKSPACE/cime_config/testfiles/ExpectedTestFails.xml | grep FAIL | grep -v FAILURE
40 | retcode=$?
41 | if [ $retcode -eq 0 ]; then
42 | exit 1
43 | fi
44 | # tests pass, clean up
45 | rm -fr *.${GITHUB_RUN_ID}${{ inputs.compiler }}
46 | exit 0
47 |
--------------------------------------------------------------------------------
/doc/source/_static/pop_ver.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function() {
2 | /* For a URL that looks like
3 | https://blah.github.io/versions/VERSIONFOO/html/bar/index.html, set cur_version_dir to
4 | 'VERSIONFOO' (i.e., the portion of the path following 'versions').
5 | */
6 | var proj_end = document.baseURI.indexOf("versions") + 9;
7 | var end = document.baseURI.indexOf("/", proj_end);
8 | var cur_version_dir = document.baseURI.substring(proj_end, end);
9 | var mylist = $("#version-list");
10 | mylist.empty();
11 | $.getJSON(version_json_loc, function(data) {
12 | if (data.hasOwnProperty(cur_version_dir)) {
13 | /* First add the current version so that it appears first in the drop-down
14 | menu and starts as the selected element of the menu. If you click on the
15 | current version, you should stay at the current page.
16 |
17 | The conditional around this block should generally be true, but we check it
18 | just in case the current version is missing from the versions.json file for
19 | some reason.
20 | */
21 | cur_version_name = data[cur_version_dir];
22 | mylist.append($("