├── python
├── slim
│ ├── __init__.py
│ ├── test
│ │ ├── __init__.py
│ │ └── README
│ ├── mksurdat
│ │ └── __init__.py
│ ├── modify_input_files
│ │ └── __init__.py
│ ├── import_hook.py
│ ├── unit_testing.py
│ ├── add_slim_cime_py_to_path.py
│ ├── add_cime_to_path.py
│ ├── git_utils.py
│ ├── run_slim_py_tests.py
│ ├── utils.py
│ ├── slim_logging.py
│ ├── path_utils.py
│ └── config_utils.py
├── run_slim_py_tests
├── conda_env_slim_py.txt
├── pyproject.toml
├── conda_env_slim_py_cgd.txt
├── README.md
└── Makefile
├── manage_externals
├── test
│ ├── doc
│ │ ├── .gitignore
│ │ ├── index.rst
│ │ ├── Makefile
│ │ └── testing.rst
│ ├── repos
│ │ ├── container.git
│ │ │ ├── HEAD
│ │ │ ├── refs
│ │ │ │ └── heads
│ │ │ │ │ └── master
│ │ │ ├── description
│ │ │ ├── config
│ │ │ ├── objects
│ │ │ │ ├── 41
│ │ │ │ │ └── 1de5d96ee418c1c55f3e96e6e6e7c06bb95801
│ │ │ │ ├── 71
│ │ │ │ │ └── 5b8f3e4afe1802a178e1d603af404ba45d59de
│ │ │ │ ├── b0
│ │ │ │ │ └── f87705e2b9601cb831878f3d51efa78b910d7b
│ │ │ │ └── f9
│ │ │ │ │ └── e08370a737e941de6f6492e3f427c2ef4c1a03
│ │ │ └── info
│ │ │ │ └── exclude
│ │ ├── mixed-cont-ext.git
│ │ │ ├── HEAD
│ │ │ ├── refs
│ │ │ │ └── heads
│ │ │ │ │ ├── master
│ │ │ │ │ └── new-feature
│ │ │ ├── description
│ │ │ ├── config
│ │ │ ├── objects
│ │ │ │ ├── 14
│ │ │ │ │ └── 368b701616a8c53820b610414a4b9a07540cf6
│ │ │ │ ├── 15
│ │ │ │ │ └── 2b57e1cf23721cd17ff681cb9276e3fb9fc091
│ │ │ │ ├── 37
│ │ │ │ │ └── f0e70b609adc90f4c09ee21d82ed1d79c81d69
│ │ │ │ ├── 38
│ │ │ │ │ └── 9a2b876b8965d3c91a3db8d28a483eaf019d5c
│ │ │ │ ├── 41
│ │ │ │ │ └── 1de5d96ee418c1c55f3e96e6e6e7c06bb95801
│ │ │ │ ├── 93
│ │ │ │ │ └── a159deb9175bfeb2820a0006ddd92d78131332
│ │ │ │ ├── 95
│ │ │ │ │ └── 80ecc12f16334ce44e42287d5d46f927bb7b75
│ │ │ │ ├── 00
│ │ │ │ │ └── 437ac2000d5f06fb8a572a01a5bbdae98b17cb
│ │ │ │ ├── 01
│ │ │ │ │ └── 97458f2dbe5fcd6bc44fa46983be0a30282379
│ │ │ │ ├── 06
│ │ │ │ │ └── ea30b03ffa2f8574705f8b9583f7ca7e2dccf7
│ │ │ │ ├── 1f
│ │ │ │ │ └── 01fa46c17b1f38b37e6259f6e9d041bda3144f
│ │ │ │ ├── 6e
│ │ │ │ │ └── 9f4baa6e94a0af4e094836c2eb55ccedef5fc4
│ │ │ │ ├── 6f
│ │ │ │ │ └── c379457ecb4e576a13c7610ae1fa73f845ee6a
│ │ │ │ ├── a9
│ │ │ │ │ └── 288dcd8a719a1f4ed3cba43a2a387ae7cd60fd
│ │ │ │ ├── e8
│ │ │ │ │ └── ea32a11d30ee703f6f661ae7c2376f4ab84d38
│ │ │ │ └── fd
│ │ │ │ │ └── 15a5ad5204356229c60a831d2a8120a43ac901
│ │ │ └── info
│ │ │ │ └── exclude
│ │ ├── simple-ext.git
│ │ │ ├── HEAD
│ │ │ ├── refs
│ │ │ │ ├── tags
│ │ │ │ │ ├── tag1
│ │ │ │ │ └── tag2
│ │ │ │ └── heads
│ │ │ │ │ ├── feature2
│ │ │ │ │ ├── feature3
│ │ │ │ │ └── master
│ │ │ ├── description
│ │ │ ├── config
│ │ │ ├── objects
│ │ │ │ ├── 11
│ │ │ │ │ └── a76e3d9a67313dec7ce1230852ab5c86352c5c
│ │ │ │ ├── 14
│ │ │ │ │ └── 2711fdbbcb8034d7cad6bae6801887b12fe61d
│ │ │ │ ├── 31
│ │ │ │ │ └── dbcd6de441e671a467ef317146539b7ffabb11
│ │ │ │ ├── 36
│ │ │ │ │ └── 418b4e5665956a90725c9a1b5a8e551c5f3d48
│ │ │ │ ├── 41
│ │ │ │ │ └── 1de5d96ee418c1c55f3e96e6e6e7c06bb95801
│ │ │ │ ├── 60
│ │ │ │ │ ├── 7ec299c17dd285c029edc41a0109e49d441380
│ │ │ │ │ └── b1cc1a38d63a4bcaa1e767262bbe23dbf9f5f5
│ │ │ │ ├── 63
│ │ │ │ │ └── a99393d1baff97ccef967af30380659867b139
│ │ │ │ ├── 95
│ │ │ │ │ └── 3256da5612fcd9263590a353bc18c6f224e74f
│ │ │ │ ├── 00
│ │ │ │ │ └── fd13e76189f9134b0506b4b8ed3172723b467f
│ │ │ │ ├── 09
│ │ │ │ │ └── 0e1034746b2c865f7b0280813dbf4061a700e8
│ │ │ │ ├── 0b
│ │ │ │ │ └── 15e8af3d4615b42314216efeae3fff184046a8
│ │ │ │ ├── 9b
│ │ │ │ │ └── 75494003deca69527bb64bcaa352e801611dd2
│ │ │ │ ├── a2
│ │ │ │ │ └── 2a5da9119328ea6d693f88861457c07e14ac04
│ │ │ │ ├── b7
│ │ │ │ │ └── 692b6d391899680da7b9b6fd8af4c413f06fe7
│ │ │ │ ├── c5
│ │ │ │ │ └── b315915742133dbdfbeed0753e481b55c1d364
│ │ │ │ ├── d1
│ │ │ │ │ └── 163870d19c3dee34fada3a76b785cfa2a8424b
│ │ │ │ ├── d8
│ │ │ │ │ └── ed2f33179d751937f8fde2e33921e4827babf4
│ │ │ │ └── df
│ │ │ │ │ └── 312890f93ba4d2c694208599b665c4a08afeff
│ │ │ └── info
│ │ │ │ └── exclude
│ │ ├── simple-ext-fork.git
│ │ │ ├── HEAD
│ │ │ ├── refs
│ │ │ │ ├── heads
│ │ │ │ │ └── feature2
│ │ │ │ └── tags
│ │ │ │ │ ├── abandoned-feature
│ │ │ │ │ └── forked-feature-v1
│ │ │ ├── description
│ │ │ ├── objects
│ │ │ │ ├── 11
│ │ │ │ │ └── a76e3d9a67313dec7ce1230852ab5c86352c5c
│ │ │ │ ├── 16
│ │ │ │ │ └── 5506a7408a482f50493434e13fffeb44af893f
│ │ │ │ ├── 24
│ │ │ │ │ └── 4386e788c9bc608613e127a329c742450a60e4
│ │ │ │ ├── 32
│ │ │ │ │ └── 7e97d86e941047d809dba58f2804740c6c30cf
│ │ │ │ ├── 36
│ │ │ │ │ └── 418b4e5665956a90725c9a1b5a8e551c5f3d48
│ │ │ │ ├── 41
│ │ │ │ │ └── 1de5d96ee418c1c55f3e96e6e6e7c06bb95801
│ │ │ │ ├── 56
│ │ │ │ │ └── 175e017ad38bf3d33d74b6bd7c74624b28466a
│ │ │ │ ├── 67
│ │ │ │ │ └── 136e5ab4d5c1c65d10c8048763b96b0e53c1d6
│ │ │ │ ├── 88
│ │ │ │ │ └── cf20868e0cc445f5642a480ed034c71e0d7e9f
│ │ │ │ ├── 00
│ │ │ │ │ └── fd13e76189f9134b0506b4b8ed3172723b467f
│ │ │ │ ├── 0b
│ │ │ │ │ ├── 15e8af3d4615b42314216efeae3fff184046a8
│ │ │ │ │ └── 67df4e7e8e6e1c6e401542738b352d18744677
│ │ │ │ ├── 3d
│ │ │ │ │ ├── 7099c35404ae6c8640ce263b38bef06e98cc26
│ │ │ │ │ └── ec1fdf8e2f5edba28148c5db2fe8d7a842360b
│ │ │ │ ├── 4d
│ │ │ │ │ └── 837135915ed93eed6fff6b439f284ce317296f
│ │ │ │ ├── 5f
│ │ │ │ │ └── 1d4786d12e52d7ab28d2f2f1118c1059a9f1ae
│ │ │ │ ├── 7b
│ │ │ │ │ └── 0bd630ac13865735a1dff3437a137d8ab50663
│ │ │ │ ├── 8d
│ │ │ │ │ └── 2b3b35126224c975d23f109aa1e3cbac452989
│ │ │ │ ├── 9b
│ │ │ │ │ └── 75494003deca69527bb64bcaa352e801611dd2
│ │ │ │ ├── a2
│ │ │ │ │ └── 2a5da9119328ea6d693f88861457c07e14ac04
│ │ │ │ ├── a4
│ │ │ │ │ └── 2fe9144f5707bc1e9515ce1b44681f7aba6f95
│ │ │ │ ├── b9
│ │ │ │ │ └── 3737be3ea6b19f6255983748a0a0f4d622f936
│ │ │ │ ├── c5
│ │ │ │ │ ├── 32bc8fde96fa63103a52057f0baffcc9f00c6b
│ │ │ │ │ └── b315915742133dbdfbeed0753e481b55c1d364
│ │ │ │ └── f2
│ │ │ │ │ └── 68d4e56d067da9bd1d85e55bdc40a8bd2b0bca
│ │ │ ├── info
│ │ │ │ └── exclude
│ │ │ ├── packed-refs
│ │ │ └── config
│ │ └── error
│ │ │ └── readme.txt
│ ├── requirements.txt
│ ├── .gitignore
│ ├── .coveragerc
│ ├── README.md
│ └── Makefile
├── manic
│ ├── __init__.py
│ ├── global_constants.py
│ ├── repository_factory.py
│ └── repository.py
├── .gitignore
├── .dir_locals.el
├── .travis.yml
├── .github
│ ├── ISSUE_TEMPLATE.md
│ └── PULL_REQUEST_TEMPLATE.md
├── checkout_externals
├── README_FIRST
└── LICENSE.txt
├── cime_config
├── testdefs
│ ├── testmods_dirs
│ │ └── slim
│ │ │ ├── Monthly
│ │ │ ├── include_user_mods
│ │ │ └── user_nl_slim
│ │ │ ├── g16_SOM
│ │ │ ├── include_user_mods
│ │ │ ├── shell_commands
│ │ │ └── user_docn.streams.txt.som
│ │ │ ├── global_uniform
│ │ │ ├── include_user_mods
│ │ │ └── shell_commands
│ │ │ ├── realistic_2000
│ │ │ ├── include_user_mods
│ │ │ └── shell_commands
│ │ │ ├── save_cplhist
│ │ │ ├── include_user_mods
│ │ │ └── user_nl_cpl
│ │ │ ├── g16_SOM_save_cplhist
│ │ │ └── include_user_mods
│ │ │ ├── default
│ │ │ ├── shell_commands
│ │ │ └── user_nl_slim
│ │ │ ├── global_uniform_g16_SOM
│ │ │ └── include_user_mods
│ │ │ └── global_uniform_g16_SOMMonthly
│ │ │ └── include_user_mods
│ └── ExpectedTestFails.xml
├── slim_cime_py
│ └── __init__.py
├── buildnml_test
│ ├── run_buildnml
│ ├── env_archive.xml
│ ├── env_workflow.xml
│ ├── env_mach_specific.xml
│ ├── env_batch.xml
│ ├── env_build.xml
│ ├── user_nl_slim
│ ├── env_run.xml
│ ├── env_case.xml
│ └── env_mach_pes.xml
├── user_nl_slim
├── buildnml
├── config_archive.xml
├── config_component.xml
├── namelist_definition.xsl
├── buildlib
└── config_compsets.xml
├── README.rst
├── src
├── main
│ ├── dtypes.h
│ ├── clm_varpar.F90
│ ├── abortutils.F90
│ ├── ncdio_utils.F90
│ ├── clm_instMod.F90
│ ├── GridcellType.F90
│ ├── GetGlobalValuesMod.F90
│ └── subgridRestMod.F90
├── utils
│ ├── dtypes.h
│ ├── clm_varorb.F90
│ ├── getdatetime.F90
│ ├── array_utils.F90.in
│ ├── clm_nlUtilsMod.F90
│ └── spmdMod.F90
├── cpl
│ └── nuopc
│ │ └── lnd_comp_shr.F90
└── init_interp
│ ├── initInterpMultilevelBase.F90
│ ├── initInterpBounds.F90
│ ├── initInterp1dData.F90
│ └── initInterpMultilevelCopy.F90
├── tools
├── modify_input_files
│ ├── surdat_modifier
│ ├── README.surdat_modifier
│ ├── modify_surdat_defaults.cfg
│ └── modify_surdat_template.cfg
├── README
└── mksurdat
│ └── README.mksurdat
├── README.md
├── .gitignore
├── README.testing
├── CONTRIBUTING.md
├── .config_files.xml
├── Externals.cfg
├── LICENSE
├── README
├── Copyright
├── README_EXTERNALS.rst
└── py_env_create
/python/slim/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/python/slim/test/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/python/slim/mksurdat/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/python/slim/modify_input_files/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/manage_externals/test/doc/.gitignore:
--------------------------------------------------------------------------------
1 | _build
2 |
3 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/Monthly/include_user_mods:
--------------------------------------------------------------------------------
1 | ../default
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/g16_SOM/include_user_mods:
--------------------------------------------------------------------------------
1 | ../default
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/global_uniform/include_user_mods:
--------------------------------------------------------------------------------
1 | ../default
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/realistic_2000/include_user_mods:
--------------------------------------------------------------------------------
1 | ../default
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/save_cplhist/include_user_mods:
--------------------------------------------------------------------------------
1 | ../default
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/refs/tags/tag1:
--------------------------------------------------------------------------------
1 | 11a76e3d9a67313dec7ce1230852ab5c86352c5c
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/refs/tags/tag2:
--------------------------------------------------------------------------------
1 | b7692b6d391899680da7b9b6fd8af4c413f06fe7
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/Monthly/user_nl_slim:
--------------------------------------------------------------------------------
1 | hist_nhtfrq = 0
2 | hist_mfilt = 1
3 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/refs/heads/master:
--------------------------------------------------------------------------------
1 | 715b8f3e4afe1802a178e1d603af404ba45d59de
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/refs/heads/feature2:
--------------------------------------------------------------------------------
1 | 36418b4e5665956a90725c9a1b5a8e551c5f3d48
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/refs/heads/feature3:
--------------------------------------------------------------------------------
1 | 090e1034746b2c865f7b0280813dbf4061a700e8
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/refs/heads/master:
--------------------------------------------------------------------------------
1 | 607ec299c17dd285c029edc41a0109e49d441380
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/g16_SOM_save_cplhist/include_user_mods:
--------------------------------------------------------------------------------
1 | ../g16_SOM
2 | ../save_cplhist
3 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/master:
--------------------------------------------------------------------------------
1 | 6fc379457ecb4e576a13c7610ae1fa73f845ee6a
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/refs/heads/feature2:
--------------------------------------------------------------------------------
1 | f268d4e56d067da9bd1d85e55bdc40a8bd2b0bca
2 |
--------------------------------------------------------------------------------
/cime_config/slim_cime_py/__init__.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=missing-module-docstring
2 | from .buildnml import buildnml
3 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/default/shell_commands:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./xmlchange SLIM_START_TYPE="cold"
3 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/global_uniform_g16_SOM/include_user_mods:
--------------------------------------------------------------------------------
1 | ../global_uniform
2 | ../g16_SOM
3 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/new-feature:
--------------------------------------------------------------------------------
1 | 9580ecc12f16334ce44e42287d5d46f927bb7b75
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature:
--------------------------------------------------------------------------------
1 | a42fe9144f5707bc1e9515ce1b44681f7aba6f95
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1:
--------------------------------------------------------------------------------
1 | 8d2b3b35126224c975d23f109aa1e3cbac452989
2 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/default/user_nl_slim:
--------------------------------------------------------------------------------
1 | hist_ndens = 1
2 | hist_nhtfrq =-24
3 | hist_mfilt = 5
4 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/global_uniform/shell_commands:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./xmlchange SLIM_SCENARIO="global_uniform"
3 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/global_uniform_g16_SOMMonthly/include_user_mods:
--------------------------------------------------------------------------------
1 | ../Monthly
2 | ../global_uniform_g16_SOM
3 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/description:
--------------------------------------------------------------------------------
1 | Unnamed repository; edit this file 'description' to name the repository.
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/description:
--------------------------------------------------------------------------------
1 | Unnamed repository; edit this file 'description' to name the repository.
2 |
--------------------------------------------------------------------------------
/README.rst:
--------------------------------------------------------------------------------
1 | ================
2 | SimpleLandModel
3 | ================
4 |
5 | SLIM the Simple Land Interface Model coupled to CESM2
6 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/realistic_2000/shell_commands:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./xmlchange SLIM_SCENARIO="realistic_from_2000"
3 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/description:
--------------------------------------------------------------------------------
1 | Unnamed repository; edit this file 'description' to name the repository.
2 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/description:
--------------------------------------------------------------------------------
1 | Unnamed repository; edit this file 'description' to name the repository.
2 |
--------------------------------------------------------------------------------
/manage_externals/test/requirements.txt:
--------------------------------------------------------------------------------
1 | pylint>=1.7.0
2 | autopep8>=1.3.0
3 | coverage>=4.4.0
4 | coveralls>=1.2.0
5 | sphinx>=1.6.0
6 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/error/readme.txt:
--------------------------------------------------------------------------------
1 | Invalid or corrupted git repository (.git dir exists, but is empty) for error
2 | testing.
3 |
4 |
--------------------------------------------------------------------------------
/manage_externals/test/.gitignore:
--------------------------------------------------------------------------------
1 | # virtual environments
2 | env_python*
3 |
4 | # python code coverage tool output
5 | .coverage
6 | htmlcov
7 |
8 |
--------------------------------------------------------------------------------
/src/main/dtypes.h:
--------------------------------------------------------------------------------
1 | #define TYPETEXT 100
2 | #define TYPEREAL 101
3 | #define TYPEDOUBLE 102
4 | #define TYPEINT 103
5 | #define TYPELONG 104
6 | #define TYPELOGICAL 105
7 |
--------------------------------------------------------------------------------
/manage_externals/test/.coveragerc:
--------------------------------------------------------------------------------
1 | [run]
2 | branch = True
3 | omit = test_unit_*.py
4 | test_sys_*.py
5 | /usr/*
6 | .local/*
7 | */site-packages/*
--------------------------------------------------------------------------------
/src/utils/dtypes.h:
--------------------------------------------------------------------------------
1 | #define TYPEDOUBLE 102
2 | #define TYPEINT 103
3 | #define TYPETEXT 100
4 | #define TYPELONG 104
5 | #define TYPEREAL 101
6 | #define TYPELOGICAL 105
7 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/config:
--------------------------------------------------------------------------------
1 | [core]
2 | repositoryformatversion = 0
3 | filemode = true
4 | bare = true
5 | ignorecase = true
6 | precomposeunicode = true
7 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/config:
--------------------------------------------------------------------------------
1 | [core]
2 | repositoryformatversion = 0
3 | filemode = true
4 | bare = true
5 | ignorecase = true
6 | precomposeunicode = true
7 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/config:
--------------------------------------------------------------------------------
1 | [core]
2 | repositoryformatversion = 0
3 | filemode = true
4 | bare = true
5 | ignorecase = true
6 | precomposeunicode = true
7 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/run_buildnml:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | rm Buildconf/slimconf/lnd_in
3 | env CIMEROOT=`pwd`/../../cime ../buildnml `pwd` --verbose --debug
4 | cat Buildconf/slimconf/lnd_in
5 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/g16_SOM/shell_commands:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | CIMEROOT=`./xmlquery --value -s CIMEROOT`
3 | cp $CIMEROOT/../cime_config/testdefs/testmods_dirs/slim/g16_SOM/user_docn* .
4 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_archive.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/save_cplhist/user_nl_cpl:
--------------------------------------------------------------------------------
1 | histaux_a2x3hr=.true.
2 | histaux_a2x3hrp = .true.
3 | histaux_a2x1hri = .true.
4 | histaux_a2x1hr = .true.
5 | histaux_a2x24hr = .true.
6 | histaux_a2x = .true.
7 |
--------------------------------------------------------------------------------
/python/slim/import_hook.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=missing-module-docstring
2 | import sys
3 | import os
4 |
5 | _CIMEROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "cime")
6 | sys.path.append(_CIMEROOT)
7 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_workflow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/manage_externals/manic/__init__.py:
--------------------------------------------------------------------------------
1 | """Public API for the manage_externals library
2 | """
3 |
4 | from manic import checkout
5 | from manic.utils import printlog
6 |
7 | __all__ = [
8 | 'checkout', 'printlog',
9 | ]
10 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/60/7ec299c17dd285c029edc41a0109e49d441380:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/60/7ec299c17dd285c029edc41a0109e49d441380
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/60/b1cc1a38d63a4bcaa1e767262bbe23dbf9f5f5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/60/b1cc1a38d63a4bcaa1e767262bbe23dbf9f5f5
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/63/a99393d1baff97ccef967af30380659867b139:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/63/a99393d1baff97ccef967af30380659867b139
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/95/3256da5612fcd9263590a353bc18c6f224e74f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/95/3256da5612fcd9263590a353bc18c6f224e74f
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/b7/692b6d391899680da7b9b6fd8af4c413f06fe7:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/b7/692b6d391899680da7b9b6fd8af4c413f06fe7
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/d1/163870d19c3dee34fada3a76b785cfa2a8424b:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/d1/163870d19c3dee34fada3a76b785cfa2a8424b
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ESCOMP/SimpleLand/cesm2_3_slim/manage_externals/test/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca
--------------------------------------------------------------------------------
/manage_externals/.gitignore:
--------------------------------------------------------------------------------
1 | # directories that are checked out by the tool
2 | cime/
3 | cime_config/
4 | components/
5 |
6 | # generated local files
7 | *.log
8 |
9 | # editor files
10 | *~
11 | *.bak
12 |
13 | # generated python files
14 | *.pyc
15 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/container.git/info/exclude:
--------------------------------------------------------------------------------
1 | # git ls-files --others --exclude-from=.git/info/exclude
2 | # Lines that start with '#' are comments.
3 | # For a project mostly in C, the following would be a good set of
4 | # exclude patterns (uncomment them if you want to use them):
5 | # *.[oa]
6 | # *~
7 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/mixed-cont-ext.git/info/exclude:
--------------------------------------------------------------------------------
1 | # git ls-files --others --exclude-from=.git/info/exclude
2 | # Lines that start with '#' are comments.
3 | # For a project mostly in C, the following would be a good set of
4 | # exclude patterns (uncomment them if you want to use them):
5 | # *.[oa]
6 | # *~
7 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext.git/info/exclude:
--------------------------------------------------------------------------------
1 | # git ls-files --others --exclude-from=.git/info/exclude
2 | # Lines that start with '#' are comments.
3 | # For a project mostly in C, the following would be a good set of
4 | # exclude patterns (uncomment them if you want to use them):
5 | # *.[oa]
6 | # *~
7 |
--------------------------------------------------------------------------------
/manage_externals/.dir_locals.el:
--------------------------------------------------------------------------------
1 | ; -*- mode: Lisp -*-
2 |
3 | ((python-mode
4 | . (
5 | ;; fill the paragraph to 80 columns when using M-q
6 | (fill-column . 80)
7 |
8 | ;; Use 4 spaces to indent in Python
9 | (python-indent-offset . 4)
10 | (indent-tabs-mode . nil)
11 | )))
12 |
13 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/info/exclude:
--------------------------------------------------------------------------------
1 | # git ls-files --others --exclude-from=.git/info/exclude
2 | # Lines that start with '#' are comments.
3 | # For a project mostly in C, the following would be a good set of
4 | # exclude patterns (uncomment them if you want to use them):
5 | # *.[oa]
6 | # *~
7 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/packed-refs:
--------------------------------------------------------------------------------
1 | # pack-refs with: peeled fully-peeled sorted
2 | 36418b4e5665956a90725c9a1b5a8e551c5f3d48 refs/heads/feature2
3 | 9b75494003deca69527bb64bcaa352e801611dd2 refs/heads/master
4 | 11a76e3d9a67313dec7ce1230852ab5c86352c5c refs/tags/tag1
5 | ^9b75494003deca69527bb64bcaa352e801611dd2
6 |
--------------------------------------------------------------------------------
/manage_externals/test/repos/simple-ext-fork.git/config:
--------------------------------------------------------------------------------
1 | [core]
2 | repositoryformatversion = 0
3 | filemode = true
4 | bare = true
5 | ignorecase = true
6 | precomposeunicode = true
7 | [remote "origin"]
8 | url = /Users/andreb/projects/ncar/git-conversion/checkout-model-dev/cesm-demo-externals/manage_externals/test/repos/simple-ext.git
9 |
--------------------------------------------------------------------------------
/manage_externals/.travis.yml:
--------------------------------------------------------------------------------
1 | language: python
2 | os: linux
3 | python:
4 | - "2.7"
5 | - "3.4"
6 | - "3.5"
7 | - "3.6"
8 | - "3.7"
9 | - "3.8"
10 | install:
11 | - pip install -r test/requirements.txt
12 | before_script:
13 | - git --version
14 | script:
15 | - cd test; make test
16 | - cd test; make lint
17 | after_success:
18 | - cd test; make coverage
19 | - cd test; coveralls
20 |
--------------------------------------------------------------------------------
/python/run_slim_py_tests:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | """Driver for running the unit tests of the python code
3 |
4 | We use this rather than simply relying on 'python -m unittest discover' so we can do some
5 | initial setup, like configuring logging, before running the unit tests.
6 | """
7 |
8 | from slim import add_cime_to_path
9 | from slim.run_slim_py_tests import main
10 |
11 | if __name__ == "__main__":
12 | main(__doc__)
13 |
--------------------------------------------------------------------------------
/manage_externals/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Summary of Issue:
2 | ### Expected behavior and actual behavior:
3 | ### Steps to reproduce the problem (should include model description file(s) or link to publi c repository):
4 | ### What is the changeset ID of the code, and the machine you are using:
5 | ### have you modified the code? If so, it must be committed and available for testing:
6 | ### Screen output or log file showing the error message and context:
7 |
--------------------------------------------------------------------------------
/src/cpl/nuopc/lnd_comp_shr.F90:
--------------------------------------------------------------------------------
1 | module lnd_comp_shr
2 |
3 | ! Model mesh info is here in order to be leveraged by CDEPS in line calls
4 |
5 | use ESMF
6 | use shr_kind_mod, only : r8 => shr_kind_r8, cl=>shr_kind_cl
7 |
8 | implicit none
9 | public
10 |
11 | type(ESMF_Clock) :: model_clock ! model clock
12 | type(ESMF_Mesh) :: mesh ! model_mesh
13 | character(len=cl) :: model_meshfile ! model mesh file
14 |
15 | end module lnd_comp_shr
16 |
--------------------------------------------------------------------------------
/manage_externals/manic/global_constants.py:
--------------------------------------------------------------------------------
1 | """Globals shared across modules
2 | """
3 |
4 | from __future__ import absolute_import
5 | from __future__ import unicode_literals
6 | from __future__ import print_function
7 |
8 | import pprint
9 |
10 | EMPTY_STR = ''
11 | LOCAL_PATH_INDICATOR = '.'
12 | VERSION_SEPERATOR = '.'
13 | LOG_FILE_NAME = 'manage_externals.log'
14 | PPRINTER = pprint.PrettyPrinter(indent=4)
15 |
16 | VERBOSITY_DEFAULT = 0
17 | VERBOSITY_VERBOSE = 1
18 | VERBOSITY_DUMP = 2
19 |
--------------------------------------------------------------------------------
/python/conda_env_slim_py.txt:
--------------------------------------------------------------------------------
1 | #
2 | # NOTE: Changes here should be coordinated with the cgd python environment file
3 | #
4 | # To install this on cheyenne with conda loaded in modules
5 | # use the top level bash script:
6 | # ../py_env_create # Do this each time you update your CTSM Version
7 | # conda activate ctsm_pylib # Do this anytime you want to run a CTSM python script
8 | #
9 | python=3.7.9
10 | pylint=2.8.3
11 | black=22.6.0
12 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_mach_specific.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 | char
14 | executable name
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/tools/modify_input_files/surdat_modifier:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | """
3 | For description and instructions, please see README.
4 | """
5 |
6 | import os
7 | import sys
8 |
9 | _SLIM_PYTHON = os.path.join(os.path.dirname(os.path.realpath(__file__)),
10 | os.pardir,
11 | os.pardir,
12 | 'python')
13 | sys.path.insert(1, _SLIM_PYTHON)
14 |
15 | from slim.modify_input_files.surdat_modifier import main
16 |
17 | if __name__ == "__main__":
18 | main()
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SLIM: The Simple Land Interface Model
2 | Simple Land Model for CESM
3 |
4 |
5 | For instructions on how to run SLIM on it's own or coupled to CESM on Cheyenne, see the Wiki, and the README file at the top of the
6 | SLIM checkout.
7 |
8 | To cite, please use:
9 |
10 | Laguë, M. M., Bonan, G. B., & Swann, A. L. S. (2019). Separating the Impact of Individual Land Surface Properties on the Terrestrial Surface Energy Budget in both the Coupled and Uncoupled Land–Atmosphere System. Journal of Climate, 32(18), 5725–5744. https://doi.org/10.1175/jcli-d-18-0812.1
11 |
12 |
--------------------------------------------------------------------------------
/python/pyproject.toml:
--------------------------------------------------------------------------------
1 | #
2 | # This is a configuration file for python projects.
3 | # Sepcifically covering build system requirements.
4 | #
5 | # Here we are just using a couple options to specify the operation
6 | # of the python formatter "black".
7 | #
8 | [tool.black]
9 |
10 | line-length = 100 # This is the black default
11 | target-version = ['py37']
12 | include = '(run_slim_py_tests|\.py$)' # Files to include
13 | exclude = '(\.pylintrc|\.pyc)' # Files to explicitly exclude pylint file and compiled python
14 |
--------------------------------------------------------------------------------
/python/slim/unit_testing.py:
--------------------------------------------------------------------------------
1 | """Functions to aid unit tests"""
2 |
3 | from slim.slim_logging import setup_logging_for_tests
4 |
5 |
6 | def setup_for_tests(enable_critical_logs=False):
7 | """Call this at the beginning of unit testing
8 |
9 | Does various setup that would normally be done by the top-level application/script
10 |
11 | Args:
12 | enable_critical_logs (bool): If True, then critical logging messages will be output;
13 | if False, then even critical messages will be suppressed
14 | """
15 | setup_logging_for_tests(enable_critical_logs)
16 |
--------------------------------------------------------------------------------
/manage_externals/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | [ 50 character, one line summary ]
2 |
3 | [ Description of the changes in this commit. It should be enough
4 | information for someone not following this development to understand.
5 | Lines should be wrapped at about 72 characters. ]
6 |
7 | User interface changes?: [ No/Yes ]
8 | [ If yes, describe what changed, and steps taken to ensure backward compatibilty ]
9 |
10 | Fixes: [Github issue #s] And brief description of each issue.
11 |
12 | Testing:
13 | test removed:
14 | unit tests:
15 | system tests:
16 | manual testing:
17 |
18 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_batch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 | char
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/manage_externals/test/doc/index.rst:
--------------------------------------------------------------------------------
1 | .. Manage Externals documentation master file, created by
2 | sphinx-quickstart on Wed Nov 29 10:53:25 2017.
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 Manage Externals's documentation!
7 | ============================================
8 |
9 | .. toctree::
10 | :maxdepth: 2
11 | :caption: Contents:
12 |
13 |
14 | develop.rst
15 | testing.rst
16 |
17 | Indices and tables
18 | ==================
19 |
20 | * :ref:`genindex`
21 | * :ref:`modindex`
22 | * :ref:`search`
23 |
--------------------------------------------------------------------------------
/src/utils/clm_varorb.F90:
--------------------------------------------------------------------------------
1 |
2 | module clm_varorb
3 |
4 | use shr_kind_mod , only: r8 => shr_kind_r8
5 | implicit none
6 |
7 | ! Orbital information needed as input to orbit_parms
8 |
9 | real(r8) :: eccen ! Earth's eccentricity factor (unitless) (typically 0 to 0.1)
10 |
11 | ! Orbital information after processed by orbit_params
12 |
13 | real(r8) :: obliqr ! Earth's obliquity in radians
14 | real(r8) :: lambm0 ! Mean longitude of perihelion at the vernal equinox (radians)
15 | real(r8) :: mvelpp ! Earth's moving vernal equinox longitude of perihelion plus pi (radians)
16 |
17 | end module clm_varorb
18 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 | char
13 | Land (lnd) grid
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/python/conda_env_slim_py_cgd.txt:
--------------------------------------------------------------------------------
1 | # NOTE: This version is just for cgd.ucar.edu systems, where conda limits python to version 3.7.0
2 | # See issue https://github.com/ESCOMP/CTSM/issues/1792
3 | #
4 | # This should be coordinated with the main python environment file!
5 | #
6 | # To install this on cheyenne with conda loaded in modules
7 | # use the top level bash script:
8 | # ../py_env_create # Do this each time you update your CTSM Version
9 | #
10 | python=3.7.0 # The python version MUST match the python version available on CGD systems through modules exactly
11 | pylint=2.8.3
12 | black=22.6.0
13 |
--------------------------------------------------------------------------------
/python/slim/add_slim_cime_py_to_path.py:
--------------------------------------------------------------------------------
1 | """Adds slim_cime_py lib to path
2 |
3 | Any file that can potentially be run as a top-level script (with an if __name__ ==
4 | '__main__' block) that needs slim_cime_py should import this. This includes unit test
5 | modules.
6 |
7 | This should be the very first slim module imported. That way, slim_cime_py will be added to your
8 | path before other imports. That is, your script should have:
9 |
10 | # Standard library imports go here
11 | # Then:
12 | from slim import add_slim_cime_py_to_path
13 | """
14 |
15 | from slim.path_utils import add_slim_cime_pylib_to_path
16 |
17 | _ = add_slim_cime_pylib_to_path()
18 |
--------------------------------------------------------------------------------
/manage_externals/test/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 = ManageExternals
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)
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # directories checked out by manage_externals, and other files created
2 | # by manage_externals
3 | manage_externals.log
4 | cime/
5 | components/
6 | ccs_config/
7 | libraries/
8 | share/
9 |
10 | # ignore svn directories
11 | **/.svn/**
12 | .svn/
13 |
14 | # binary files
15 | *.nc
16 |
17 | # editor files
18 | *.swp
19 | *~
20 |
21 | # cime_config
22 | buildnmlc
23 | buildcppc
24 |
25 | # mac files
26 | .DS_Store
27 |
28 | # cmake generated files
29 | build/
30 | CMakeFiles/
31 |
32 | # build output
33 | *.o
34 | *.mod
35 | core.*
36 | *.gz
37 | *.log !run.log
38 | *.pyc
39 |
40 | # buildnml testing
41 | cime_config/buildnml_test/run
42 | cime_config/buildnml_test/Buildconf
43 | cime_config/buildnml_test/buildnml.log
44 |
--------------------------------------------------------------------------------
/python/slim/test/README:
--------------------------------------------------------------------------------
1 | SLIM-specific boiler-plate needed for most unit test modules:
2 |
3 | (1) If cime stuff is invoked by these unit tests (directly or
4 | indirectly, then: the first slim import statement near the top of
5 | the module should be:
6 |
7 | from slim import add_cime_to_path # pylint: disable=unused-import
8 |
9 | (2) Import the slim-specific unit_testing module:
10 |
11 | from slim import unit_testing
12 |
13 | (3) Allow names that pylint doesn't like:
14 |
15 | # Allow names that pylint doesn't like, because otherwise I find it hard
16 | # to make readable unit test names
17 | # pylint: disable=invalid-name
18 |
19 | (4) Have a 'main' block at the bottom:
20 |
21 | if __name__ == '__main__':
22 | unit_testing.setup_for_tests()
23 | unittest.main()
24 |
--------------------------------------------------------------------------------
/cime_config/user_nl_slim:
--------------------------------------------------------------------------------
1 | !----------------------------------------------------------------------------------
2 | ! Users should add all user specific namelist changes below in the form of
3 | ! namelist_var = new_namelist_value
4 | !
5 | ! EXCEPTIONS:
6 | ! Set dtime with L_NCPL option
7 | ! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
8 | ! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
9 | ! (includes $inst_string for multi-ensemble cases)
10 | ! or with SLIM_START_TYPE=cold to do a cold start
11 | ! or set it with an explicit filename here.
12 | !----------------------------------------------------------------------------------
13 |
14 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/user_nl_slim:
--------------------------------------------------------------------------------
1 | !----------------------------------------------------------------------------------
2 | ! Users should add all user specific namelist changes below in the form of
3 | ! namelist_var = new_namelist_value
4 | !
5 | ! EXCEPTIONS:
6 | ! Set dtime with L_NCPL option
7 | ! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
8 | ! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
9 | ! (includes $inst_string for multi-ensemble cases)
10 | ! or with SLIM_START_TYPE=cold to do a cold start
11 | ! or set it with an explicit filename here.
12 | !----------------------------------------------------------------------------------
13 |
14 |
--------------------------------------------------------------------------------
/cime_config/testdefs/testmods_dirs/slim/g16_SOM/user_docn.streams.txt.som:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GENERIC
5 |
6 |
7 |
8 | time time
9 | xc lon
10 | yc lat
11 | area area
12 | mask mask
13 |
14 |
15 | /gpfs/fs1/work/mlague/CESM/som/qflux
16 |
17 |
18 | pop_frc.b.e11.B1850C5CN.f09_g16.005.082914_j.nc
19 |
20 |
21 |
22 |
23 | T t
24 | U u
25 | V v
26 | dhdx dhdx
27 | dhdy dhdy
28 | hblt h
29 | qdp qbot
30 |
31 |
32 | /gpfs/fs1/work/mlague/CESM/som/qflux
33 |
34 |
35 | pop_frc.b.e11.B1850C5CN.f09_g16.005.082914_j.nc
36 |
37 |
38 | 0
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/manage_externals/checkout_externals:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | """Main driver wrapper around the manic/checkout utility.
4 |
5 | Tool to assemble external respositories represented in an externals
6 | description file.
7 |
8 | """
9 | from __future__ import absolute_import
10 | from __future__ import unicode_literals
11 | from __future__ import print_function
12 |
13 | import sys
14 | import traceback
15 |
16 | import manic
17 |
18 | if sys.hexversion < 0x02070000:
19 | print(70 * '*')
20 | print('ERROR: {0} requires python >= 2.7.x. '.format(sys.argv[0]))
21 | print('It appears that you are running python {0}'.format(
22 | '.'.join(str(x) for x in sys.version_info[0:3])))
23 | print(70 * '*')
24 | sys.exit(1)
25 |
26 |
27 | if __name__ == '__main__':
28 | ARGS = manic.checkout.commandline_arguments()
29 | try:
30 | RET_STATUS, _ = manic.checkout.main(ARGS)
31 | sys.exit(RET_STATUS)
32 | except Exception as error: # pylint: disable=broad-except
33 | manic.printlog(str(error))
34 | if ARGS.backtrace:
35 | traceback.print_exc()
36 | sys.exit(1)
37 |
--------------------------------------------------------------------------------
/manage_externals/manic/repository_factory.py:
--------------------------------------------------------------------------------
1 | """Factory for creating and initializing the appropriate repository class
2 | """
3 |
4 | from __future__ import absolute_import
5 | from __future__ import unicode_literals
6 | from __future__ import print_function
7 |
8 | from .repository_git import GitRepository
9 | from .repository_svn import SvnRepository
10 | from .externals_description import ExternalsDescription
11 | from .utils import fatal_error
12 |
13 |
14 | def create_repository(component_name, repo_info, svn_ignore_ancestry=False):
15 | """Determine what type of repository we have, i.e. git or svn, and
16 | create the appropriate object.
17 |
18 | """
19 | protocol = repo_info[ExternalsDescription.PROTOCOL].lower()
20 | if protocol == 'git':
21 | repo = GitRepository(component_name, repo_info)
22 | elif protocol == 'svn':
23 | repo = SvnRepository(component_name, repo_info, ignore_ancestry=svn_ignore_ancestry)
24 | elif protocol == 'externals_only':
25 | repo = None
26 | else:
27 | msg = 'Unknown repo protocol "{0}"'.format(protocol)
28 | fatal_error(msg)
29 | return repo
30 |
--------------------------------------------------------------------------------
/cime_config/buildnml:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """
4 | SLIM namelist creator executable
5 | """
6 | import sys, os
7 |
8 | _SLIM_PYTHON = os.path.normpath(
9 | os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, "python")
10 | )
11 | sys.path.insert(1, _SLIM_PYTHON)
12 |
13 | from slim import add_cime_to_path
14 | from slim import add_slim_cime_py_to_path
15 | from slim.slim_logging import setup_logging
16 |
17 | from standard_script_setup import *
18 | from CIME.buildnml import parse_input
19 | from CIME.case import Case
20 | from slim_cime_py import buildnml
21 |
22 | ###############################################################################
23 | def _main_func():
24 |
25 | caseroot = parse_input(sys.argv)
26 | level = logging.WARNING
27 | setup_logging(level)
28 | with Case(caseroot) as case:
29 | compname = case.get_value("COMP_LND")
30 | logger.warning( "WARNING: buildnml is being called as program rather than a subroutine " +
31 | "as it is expected to be in the CESM context" )
32 | buildnml(case, caseroot, compname)
33 |
34 |
35 | if __name__ == "__main__":
36 | _main_func()
37 |
--------------------------------------------------------------------------------
/python/README.md:
--------------------------------------------------------------------------------
1 | # Testing the code here
2 |
3 | ## Running everything
4 |
5 | To run all tests (unit tests, system tests and pylint), simply run `make
6 | all` from this directory.
7 |
8 | ## Python environment
9 |
10 | use the "npl" conda environment on cheyenne
11 |
12 | ## Unit and system tests
13 |
14 | Unit and system tests can be run in one of two ways; these do the same
15 | thing, but support different options:
16 |
17 | 1. via `make test`
18 |
19 | You can specify a few arguments to this:
20 |
21 | - python version: `make python=python3.9 test` (defaults to `python3`; you should expect errors if trying to run with python2)
22 | - verbose: `make verbose=true test`
23 | - debug: `make debug=true test`
24 |
25 | Note that unit tests and system tests can be run separately with
26 | `make utest` or `make stest`, or they can all be run with `make
27 | test`.
28 |
29 | 2. via `./run_slim_py_tests`
30 |
31 | You can specify various arguments to this; run `./run_slim_py_tests
32 | -h` for details
33 |
34 | ## pylint
35 |
36 | You can run pylint on everything in the slim package with `make lint`.
37 |
38 | ## black
39 |
40 | You can run black on everything in the slim package with `make black`.
41 |
42 |
--------------------------------------------------------------------------------
/python/slim/add_cime_to_path.py:
--------------------------------------------------------------------------------
1 | """Adds cime lib to path
2 |
3 | Any file that can potentially be run as a top-level script (with an if __name__ ==
4 | '__main__' block) that needs cime should import this. This includes unit test
5 | modules. However: see the NOTE at the bottom of this documentation.
6 |
7 | This should be the very first slim module imported. That way, cime will be added to your
8 | path before other imports. That is, your script should have:
9 |
10 | # Standard library imports go here
11 | # Then something like this:
12 | _SLIM_PYTHON = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'python')
13 | sys.path.insert(1, _SLIM_PYTHON)
14 | # Then:
15 | from slim import add_cime_to_path
16 |
17 | NOTE: For top-level scripts that either (a) want to pass some argument(s) to
18 | add_cime_lib_to_path, or (b) want to store the returned value from add_cime_lib_to_path:
19 | they should include copies of what's in this module (adding the appropriate argument(s)),
20 | rather than actually importing this module. So this module should be viewed as a
21 | convenience that can be used by scripts with simple needs, but does not need to be used.
22 | """
23 |
24 | from slim.path_utils import add_cime_lib_to_path
25 |
26 | _ = add_cime_lib_to_path()
27 |
--------------------------------------------------------------------------------
/tools/modify_input_files/README.surdat_modifier:
--------------------------------------------------------------------------------
1 | surdat_modifier is a tool that modifies SLIM surdat files. It reads a surface
2 | dataset (surdat file) and outputs a modified copy of the same file.
3 |
4 | SLIM's surdat_modifier used CTSM's fsurdat_modifier as a design template.
5 |
6 | Files involved
7 | --------------
8 | python/slim/modify_input_files/surdat_modifier.py
9 | python/slim/modify_input_files/modify_surdat.py
10 | tools/modify_input_files/surdat_modifier
11 | tools/modify_input_files/modify_surdat_template.cfg
12 |
13 | Instructions
14 | ------------
15 | To run on Cheyenne/Casper/Izumi
16 | 1) (Un)load, execute, and activate the following:
17 | module unload python
18 | module load conda
19 | ./py_env_create
20 | conda activate slim_pylib # conda activate ctsm_pylib UNTIL slim separates from ctsm
21 | (Use "deactivate" to reverse the latter.)
22 | 2) Copy, then modify the configure file named modify_surdat_template.cfg, which
23 | contains all the arguments needed by the script.
24 | 3) Run the script ./surdat_modifier pointing to the copied/modified .cfg file,
25 | e.g. modify_users_copy.cfg
26 | ./surdat_modifier modify_users_copy.cfg
27 | See modify_surdat_template.cfg for required and optional settings.
28 | 4) Use the --verbose option to see progress output on your screen
29 |
--------------------------------------------------------------------------------
/tools/README:
--------------------------------------------------------------------------------
1 | $SLIMROOT/tools/README Feb/28/2023
2 |
3 | SLIM tools for analysis of SLIM history files or
4 | for creation or modification of SLIM input files.
5 |
6 | I. General directory structure:
7 |
8 | $SLIMROOT/tools
9 | mksurdat Create SLIM surface dataset (surdat file) from CTSM
10 | history output files. TOOL NOT AVAILABLE
11 |
12 | modify_input_files Scripts to modify SLIM input files. Currently
13 | there is one available tool and it can modify
14 | SLIM surdat files.
15 |
16 | cime-tools ($CIMEROOT/tools/) (CIMEROOT is ../cime for a SLIM checkout and ../../../cime for a CESM checkout)
17 | $CIMEROOT/mapping/gen_domain_files
18 | gen_domain ------- Create data model domain datasets from SCRIP mapping datasets.
19 |
20 | II. Notes on building/running for each of the above tools:
21 |
22 | Refer to each tool's README for more information.
23 |
24 | III. Create input datasets needed to run SLIM
25 |
26 | 1.) Create surface dataset with mksurdat.ipynb. Detailed instructions here:
27 | /glade/work/slevis/git_slim/surdat_modifier/tools/mksurdat/README.mksurdat
28 |
29 | 2.) Add the new file to XML data or using user_nl_clm (optional)
30 |
--------------------------------------------------------------------------------
/cime_config/config_archive.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | r
4 | rh\d?
5 | h\d*.*\.nc$
6 | e
7 | locfnh
8 |
9 | rpointer.lnd$NINST_STRING
10 | ./$CASE.slim$NINST_STRING.r.$DATENAME.nc
11 |
12 |
13 | rpointer.lnd
14 | rpointer.lnd_9999
15 | casename.slim.r.1976-01-01-00000.nc
16 | casename.slim.rh4.1976-01-01-00000.nc
17 | casename.slim.h0.1976-01-01-00000.nc
18 | casename.slim.h0.1976-01-01-00000.nc.base
19 | casename.slim_0002.e.postassim.1976-01-01-00000.nc
20 | casename.slim_0002.e.preassim.1976-01-01-00000.nc
21 | anothercasename.slim.i.1976-01-01-00000.nc
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/tools/modify_input_files/modify_surdat_defaults.cfg:
--------------------------------------------------------------------------------
1 | [modify_input]
2 |
3 | # ------------------------------------------------------------------------
4 | # .cfg file with defaults for surdat_modifier.
5 | # ------------------------------------------------------------------------
6 |
7 | glc_mask = 0 0 0 0 0 0 0 0 0 0 0 0
8 | alb_gvd = 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2
9 | alb_svd = 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8
10 | alb_gnd = 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
11 | alb_snd = 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6
12 | alb_gvf = 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2
13 | alb_svf = 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8
14 | alb_gnf = 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
15 | alb_snf = 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6
16 | bucketdepth = 200 200 200 200 200 200 200 200 200 200 200 200
17 | emissivity = 1 1 1 1 1 1 1 1 1 1 1 1
18 | snowmask = 50 50 50 50 50 50 50 50 50 50 50 50
19 | roughness = 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1
20 | evap_res = 100 100 100 100 100 100 100 100 100 100 100 100
21 | soil_type = 0 0 0 0 0 0 0 0 0 0 0 0
22 | soil_tk_1d = 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
23 | soil_cv_1d = 2e6 2e6 2e6 2e6 2e6 2e6 2e6 2e6 2e6 2e6 2e6 2e6
24 | glc_tk_1d = 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4
25 | glc_cv_1d = 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6 1.9e6
26 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_run.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/python/slim/git_utils.py:
--------------------------------------------------------------------------------
1 | """General-purpose git utility functions"""
2 |
3 | import logging
4 | import subprocess
5 |
6 | from slim.path_utils import path_to_slim_root
7 |
8 | logger = logging.getLogger(__name__)
9 |
10 |
11 | def get_slim_git_short_hash():
12 | """
13 | Returns Git short SHA for the SLIM repository.
14 |
15 | Args:
16 |
17 | Raises:
18 |
19 | Returns:
20 | sha (str) : git short hash for slim repository
21 | """
22 | sha = (
23 | subprocess.check_output(["git", "-C", path_to_slim_root(), "rev-parse", "--short", "HEAD"])
24 | .strip()
25 | .decode()
26 | )
27 | return sha
28 |
29 |
30 | def get_slim_git_long_hash():
31 | """
32 | Returns Git long SHA for the SLIM repository.
33 |
34 | Args:
35 |
36 | Raises:
37 |
38 | Returns:
39 | sha (str) : git long hash for slim repository
40 | """
41 | sha = (
42 | subprocess.check_output(["git", "-C", path_to_slim_root(), "rev-parse", "HEAD"])
43 | .strip()
44 | .decode()
45 | )
46 | return sha
47 |
48 |
49 | def get_slim_git_describe():
50 | """
51 | Function for giving the recent tag of the SLIM repository
52 |
53 | Args:
54 |
55 | Raises:
56 |
57 | Returns:
58 | label (str) : ouput of running 'git describe' for the SLIM repository
59 | """
60 | label = subprocess.check_output(["git", "-C", path_to_slim_root(), "describe"]).strip().decode()
61 | return label
62 |
--------------------------------------------------------------------------------
/README.testing:
--------------------------------------------------------------------------------
1 | # README.testing
2 | #
3 | # The test list "aux_slim" is run as a test suite with the "create_test" script under cime/scripts
4 | # as follows.
5 | # NOTE: There are also tests for prealpha, prebeta for use with CESM testing
6 | # And slim_sci to run a few standard tests for SLIM science
7 | #
8 | # Tests on cheyenne
9 |
10 |
11 | cd cime/scripts
12 | qcmd -l walltime=08:00:00 -q premium -- ./create_test --compare \
13 | --queue premium --machine cheyenne -r cases --baseline-root /glade/p/cgd/tss/ctsm_baselines \
14 | --generate --xml-category aux_slim --xml-machine cheyenne \
15 | --xml-compiler intel --compiler intel
16 | qcmd -l walltime=08:00:00 -q premium -- ./create_test --compare \
17 | --queue premium --machine cheyenne -r cases --baseline-root /glade/p/cgd/tss/ctsm_baselines \
18 | --generate --xml-category aux_slim --xml-machine cheyenne \
19 | --xml-compiler gnu --compiler gnu
20 |
21 | # Tests on izumi
22 | #
23 | cd cime/scripts
24 | nohup ./create_test --compare --generate machine izumi -r cases \
25 | --xml-category aux_slim --xml-machine izumi --xml-compiler nag &
26 | nohup ./create_test --compare --generate machine izumi -r cases \
27 | --xml-category aux_slim --xml-machine izumi --xml-compiler gnu &
28 | nohup ./create_test --compare --generate machine izumi -r cases \
29 | --xml-category aux_slim --xml-machine izumi --xml-compiler intel &
30 |
--------------------------------------------------------------------------------
/tools/mksurdat/README.mksurdat:
--------------------------------------------------------------------------------
1 | mksurdat is a jupyter notebook tool that generates SLIM surdat files.
2 | It reads pre-averaged ctsm and cpl history files and outputs a SLIM
3 | surdat file.
4 |
5 | Files involved
6 | --------------
7 | python/slim/mksurdat/mksurdat.ipynb
8 |
9 | Instructions
10 | ------------
11 | To run on Cheyenne/Casper
12 | 1) Before starting the jupyter session for the first time, set up your
13 | conda environment:
14 |
15 | > cd /path/to/your_checked_out_ctsm_directory
16 | > ./py_env_create # needed the first time & periodically for environment updates
17 | > conda activate ctsm_pylib
18 | > pip install ipykernel
19 |
20 | Also you need the next line to use nco (netcdf operators) a bit later:
21 | > module load nco
22 |
23 | 2) On your browser go here:
24 | https://jupyterhub.hpc.ucar.edu/
25 |
26 | a) Start default server
27 | b) Launch server
28 | c) Use jupyter's file navigation to get to
29 | your_checked_out_ctsm_directory/python/slim/mksurdat
30 | d) Open mksurdat.ipynb
31 | e) Use the menu to select Kernel --> Change Kernel --> ctsm_pylib
32 | f) In the notebook's second cell, modify the following settings:
33 | - casename
34 | - start_yr
35 | - surfdat_file (not required; tool will work without this file)
36 | g) In the notebook's third cell, find a suggestion for generating
37 | concatenated ctsm and cpl history files using nco
38 |
39 | 9) Using the menu, select Run, Run all cells
40 |
41 | 10) You should have a new surdat file in the same directory as the .ipynb
42 | file (see Files involved above) in less than a minute
43 |
--------------------------------------------------------------------------------
/src/utils/getdatetime.F90:
--------------------------------------------------------------------------------
1 | !-----------------------------------------------------------------------
2 | !BOP
3 | !
4 | ! !ROUTINE: getdatetime
5 | !
6 | ! !INTERFACE:
7 | subroutine getdatetime (cdate, ctime)
8 | !
9 | ! !DESCRIPTION:
10 | ! A generic Date and Time routine
11 | !
12 | ! !USES:
13 | use spmdMod , only : mpicom, masterproc, MPI_CHARACTER
14 | ! !ARGUMENTS:
15 | implicit none
16 | character(len=8), intent(out) :: cdate !current date
17 | character(len=8), intent(out) :: ctime !current time
18 | !
19 | ! !REVISION HISTORY:
20 | ! Created by Mariana Vertenstein
21 | !
22 | !
23 | ! !LOCAL VARIABLES:
24 | !EOP
25 | character(len=8) :: date !current date
26 | character(len=10) :: time !current time
27 | character(len=5) :: zone !zone
28 | integer, dimension(8) :: values !temporary
29 | integer :: ier !MPI error code
30 | !-----------------------------------------------------------------------
31 | if (masterproc) then
32 |
33 | call date_and_time (date, time, zone, values)
34 |
35 | cdate(1:2) = date(5:6)
36 | cdate(3:3) = '/'
37 | cdate(4:5) = date(7:8)
38 | cdate(6:6) = '/'
39 | cdate(7:8) = date(3:4)
40 |
41 | ctime(1:2) = time(1:2)
42 | ctime(3:3) = ':'
43 | ctime(4:5) = time(3:4)
44 | ctime(6:6) = ':'
45 | ctime(7:8) = time(5:6)
46 |
47 | endif
48 |
49 | call mpi_bcast (cdate,len(cdate),MPI_CHARACTER, 0, mpicom, ier)
50 | call mpi_bcast (ctime,len(ctime),MPI_CHARACTER, 0, mpicom, ier)
51 |
52 | return
53 | end subroutine getdatetime
54 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## How to contribute:
2 |
3 | We recommend that you first open an issue (https://github.com/escomp/ctsm/issues/) to
4 | discuss the changes or additions that you propose. You should also contact some of the responsible
5 | individuals for SLIM and run by the changes with them.
6 |
7 | Erik Kluzek -- Software Engineering (erik@ucar.edu)
8 | Marysa Lague -- Originator (marysa.lague@usask.ca)
9 | Isla Simpson -- Principal Investigator (simpson@ucar.edu)
10 |
11 | Use the help from the wiki below to setup a fork and personal branch in GitHub to put your developments
12 | on and keep up to date with the master branch of SLIM. Once the changes are sufficiently advanced you
13 | can form a Pull Request on GitHub. Either from your fork on GitHub, or from the main ESCOMP GitHub page
14 | for SLIM (be sure to hit the "compare across forks" link at the top of the page when you first create
15 | the pull request).
16 |
17 | https://github.com/ESCOMP/SimpleLand/pulls
18 |
19 | This allows you to show your proposed changes and start getting feedback on them (even if they aren't finished).
20 | This also allows your changes to be planned for and slated for a time to come into SLIM master. In most
21 | cases you won't merge the Pull Request yourself, but a software engineer responsible for SLIM will do
22 | additional testing and bring the changes to SLIM master.
23 |
24 | #### SLIM Wiki:
25 |
26 | https://github.com/ESCOMP/SimpleLand/wiki
27 |
28 | #### Code of Conduct:
29 |
30 | See the `CODE_OF_CONDUCT.md` file for expectations of how to work in the community.
31 |
--------------------------------------------------------------------------------
/.config_files.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
16 |
17 | char
18 | unset
19 |
20 | $SRCROOT
21 | $SRCROOT/components/cpl7/components/data_comps_mct/dlnd
22 | $SRCROOT/components/cdeps/dlnd
23 | $SRCROOT/components/cpl7/components/stub_comps_mct/slnd
24 | $SRCROOT/components/cpl7/components/xcpl_comps_mct/xlnd
25 | $CIMEROOT/src/components/stub_comps_nuopc/slnd
26 | $CIMEROOT/src/components/xcpl_comps_nuopc/xlnd
27 |
28 | case_comps
29 | env_case.xml
30 | Root directory of the case land model component
31 | $CIMEROOT/config/xml_schemas/config_compsets.xsd
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/python/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for running tests on the python code here
2 |
3 | # These variables can be overridden from the command-line
4 | python = not-set
5 | verbose = not-set
6 | debug = not-set
7 |
8 | ifneq ($(python), not-set)
9 | PYTHON=$(python)
10 | else
11 | PYTHON=python3
12 | endif
13 |
14 | ifneq ($(debug), not-set)
15 | TEST_ARGS+=--debug
16 | endif
17 | ifneq ($(verbose), not-set)
18 | TEST_ARGS+=--verbose
19 | endif
20 |
21 | PYLINT=pylint
22 | PYLINT_ARGS=-j 4 --rcfile=slim/.pylintrc
23 | DIR_SRC = \
24 | slim \
25 | ../cime_config/slim_cime_py
26 |
27 | all: lint black test
28 | test: utest stest
29 |
30 | .PHONY: utest
31 | utest: FORCE
32 | $(PYTHON) ./run_slim_py_tests $(TEST_ARGS) --unit
33 |
34 | .PHONY: stest
35 | stest: FORCE
36 | $(PYTHON) ./run_slim_py_tests $(TEST_ARGS) --sys
37 |
38 | .PHONY: lint
39 | lint: FORCE
40 | $(PYLINT) $(PYLINT_ARGS) $(DIR_SRC)
41 |
42 | .PHONY: black
43 | # Run black check on all of the python files here and undeneath.
44 | # Should be identical to run_black option below, other than the --check option added in
45 | # Use the black configure file to explicitly set a few things and specifiy the exact files.
46 | black: FORCE
47 | black --check --config pyproject.toml $(DIR_SRC)
48 |
49 | .PHONY: run_black
50 | # Run black on all of the python files here and undeneath -- CHANGING THE FILES!
51 | # Should be identical to above, other than the "--check" option is removed.
52 | # Use the black configure file to explicitly set a few things and specifiy the exact files.
53 | run_black: FORCE
54 | black --config pyproject.toml $(DIR_SRC)
55 |
56 |
57 | .PHONY: clean
58 | clean: FORCE
59 | find . -name '*.pyc' -exec rm {} \;
60 |
61 | FORCE:
62 |
63 |
--------------------------------------------------------------------------------
/src/main/clm_varpar.F90:
--------------------------------------------------------------------------------
1 | module clm_varpar
2 |
3 | !-----------------------------------------------------------------------
4 | ! !DESCRIPTION:
5 | ! Module containing CLM parameters
6 | !
7 | ! !USES:
8 | use shr_kind_mod , only: r8 => shr_kind_r8
9 | use spmdMod , only: masterproc
10 | use clm_varctl , only: iulog
11 |
12 | ! !PUBLIC TYPES:
13 | implicit none
14 | save
15 |
16 | ! Note - model resolution is read in from the surface dataset
17 |
18 | integer :: nlevgrnd ! number of ground layers
19 | ! (includes lower layers that are hydrologically inactive)
20 | ! (includes lower layers that are biogeochemically inactive)
21 | !ED variables
22 | integer, parameter :: numrad = 2 ! number of solar radiation bands: vis, nir
23 | integer, parameter :: ndst = 4 ! number of dust size classes (BGC only)
24 |
25 | ! !PUBLIC MEMBER FUNCTIONS:
26 | public clm_varpar_init ! set parameters
27 | !
28 | !-----------------------------------------------------------------------
29 |
30 | contains
31 |
32 | !------------------------------------------------------------------------------
33 | subroutine clm_varpar_init()
34 | !
35 | ! !DESCRIPTION:
36 | ! Initialize module variables
37 | !
38 | ! !ARGUMENTS:
39 | implicit none
40 | !
41 | ! !LOCAL VARIABLES:
42 | !
43 | character(len=32) :: subname = 'clm_varpar_init' ! subroutine name
44 | !------------------------------------------------------------------------------
45 |
46 | nlevgrnd = 15
47 |
48 | if ( masterproc )then
49 | write(iulog, *) 'CLM varpar subsurface discretization levels '
50 | write(iulog, '(a, i3)') ' nlevgrnd = ', nlevgrnd
51 | write(iulog, *)
52 | end if
53 |
54 | end subroutine clm_varpar_init
55 |
56 | end module clm_varpar
57 |
--------------------------------------------------------------------------------
/Externals.cfg:
--------------------------------------------------------------------------------
1 | [slm]
2 | local_path = .
3 | protocol = externals_only
4 | required = True
5 |
6 | [cam]
7 | tag = cam6_3_116
8 | protocol = git
9 | repo_url = https://github.com/ESCOMP/CAM
10 | local_path = components/cam
11 | externals = Externals_CAM.cfg
12 | required = True
13 |
14 | [cice6]
15 | tag = cesm_cice6_4_1_9
16 | protocol = git
17 | repo_url = https://github.com/ESCOMP/CESM_CICE
18 | local_path = components/cice
19 | externals = Externals.cfg
20 | required = True
21 |
22 | [cice5]
23 | tag = cice5_20220204
24 | protocol = git
25 | repo_url = https://github.com/ESCOMP/CESM_CICE5
26 | local_path = components/cice5
27 | required = True
28 |
29 | [ccs_config]
30 | tag = ccs_config_cesm0.0.71
31 | protocol = git
32 | repo_url = https://github.com/ESMCI/ccs_config_cesm.git
33 | local_path = ccs_config
34 | required = True
35 |
36 | [cdeps]
37 | tag = cdeps1.0.14
38 | protocol = git
39 | repo_url = https://github.com/ESCOMP/CDEPS
40 | local_path = components/cdeps
41 | externals = Externals_CDEPS.cfg
42 | required = True
43 |
44 | [cmeps]
45 | tag = cmeps0.14.34
46 | protocol = git
47 | repo_url = https://github.com/ESCOMP/CMEPS
48 | local_path = components/cmeps
49 | required = True
50 |
51 | [cpl7]
52 | tag = cpl77.0.5
53 | protocol = git
54 | repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps
55 | local_path = components/cpl7
56 | required = True
57 |
58 | [share]
59 | tag = share1.0.17
60 | protocol = git
61 | repo_url = https://github.com/ESCOMP/CESM_share
62 | local_path = share
63 | required = True
64 |
65 | [mct]
66 | tag = MCT_2.11.0
67 | protocol = git
68 | repo_url = https://github.com/MCSclimate/MCT
69 | local_path = libraries/mct
70 | required = True
71 |
72 | [parallelio]
73 | tag = pio2_5_10
74 | protocol = git
75 | repo_url = https://github.com/NCAR/ParallelIO
76 | local_path = libraries/parallelio
77 | required = True
78 |
79 | [cime]
80 | local_path = cime
81 | protocol = git
82 | repo_url = https://github.com/ESMCI/cime
83 | tag = cime6.0.140
84 | required = True
85 |
86 | [externals_description]
87 | schema_version = 1.0.01
88 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_case.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 | char
15 | file containing specification of component specific definitions and values(for documentation only - DO NOT EDIT)
16 | $CIMEROOT/config/xml_schemas/entry_id.xsd
17 | $CIMEROOT/config/xml_schemas/entry_id_version3.xsd
18 |
19 |
20 |
21 | char
22 | Component set long name (for documentation only - DO NOT EDIT)
23 |
24 |
25 |
26 | char
27 | Root directory of the case land model component
28 | $CIMEROOT/config/xml_schemas/config_compsets.xsd
29 |
30 |
31 |
32 | char
33 | slim
34 | Name of land component
35 |
36 |
37 |
38 | char
39 | full pathname of source root directory
40 |
41 |
42 |
43 | char
44 | case name
45 |
46 |
47 |
48 | char
49 | model system name
50 |
51 |
52 |
53 | char
54 | full pathname of case
55 |
56 |
57 |
58 | char
59 | Land grid
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/manage_externals/README_FIRST:
--------------------------------------------------------------------------------
1 | CESM is comprised of a number of different components that are
2 | developed and managed independently. Each component may have
3 | additional 'external' dependancies and optional parts that are also
4 | developed and managed independently.
5 |
6 | The checkout_externals.py tool manages retreiving and updating the
7 | components and their externals so you have a complete set of source
8 | files for the model.
9 |
10 | checkout_externals.py relies on a model description file that
11 | describes what components are needed, where to find them and where to
12 | put them in the source tree. The default file is called "CESM.xml"
13 | regardless of whether you are checking out CESM or a standalone
14 | component.
15 |
16 | checkout_externals requires access to git and svn repositories that
17 | require authentication. checkout_externals may pass through
18 | authentication requests, but it will not cache them for you. For the
19 | best and most robust user experience, you should have svn and git
20 | working without password authentication. See:
21 |
22 | https://help.github.com/articles/connecting-to-github-with-ssh/
23 |
24 | ?svn ref?
25 |
26 | NOTE: checkout_externals.py *MUST* be run from the root of the source
27 | tree it is managing. For example, if you cloned CLM with:
28 |
29 | $ git clone git@github.com/ncar/clm clm-dev
30 |
31 | Then the root of the source tree is /path/to/cesm-dev. If you obtained
32 | CLM via an svn checkout of CESM and you need to checkout the CLM
33 | externals, then the root of the source tree for CLM is:
34 |
35 | /path/to/cesm-dev/components/clm
36 |
37 | The root of the source tree will be referred to as ${SRC_ROOT} below.
38 |
39 | To get started quickly, checkout all required components from the
40 | default model description file:
41 |
42 | $ cd ${SRC_ROOT}
43 | $ ./checkout_cesm/checkout_externals.py
44 |
45 | For additional information about using checkout model, please see:
46 |
47 | ${SRC_ROOT}/checkout_cesm/README
48 |
49 | or run:
50 |
51 | $ cd ${SRC_ROOT}
52 | $ ./checkout_cesm/checkout_externals.py --help
53 |
54 |
55 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2005-2022, University Corporation for Atmospheric Research (UCAR)
2 | All rights reserved.
3 |
4 | Developed by:
5 | University Corporation for Atmospheric Research - National Center for Atmospheric Research
6 | https://www2.cesm.ucar.edu/working-groups/sewg
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining
9 | a copy of this software and associated documentation files (the "Software"),
10 | to deal with the Software without restriction, including without limitation
11 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 | and/or sell copies of the Software, and to permit persons to whom
13 | the Software is furnished to do so, subject to the following conditions:
14 |
15 | - Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimers.
17 | - Redistributions in binary form must reproduce the above copyright notice,
18 | this list of conditions and the following disclaimers in the documentation
19 | and/or other materials provided with the distribution.
20 | - Neither the names of [Name of Development Group, UCAR],
21 | nor the names of its contributors may be used to endorse or promote
22 | products derived from this Software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | POSSIBILITY OF SUCH DAMAGE.
35 |
--------------------------------------------------------------------------------
/manage_externals/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2017-2018, University Corporation for Atmospheric Research (UCAR)
2 | All rights reserved.
3 |
4 | Developed by:
5 | University Corporation for Atmospheric Research - National Center for Atmospheric Research
6 | https://www2.cesm.ucar.edu/working-groups/sewg
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining
9 | a copy of this software and associated documentation files (the "Software"),
10 | to deal with the Software without restriction, including without limitation
11 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 | and/or sell copies of the Software, and to permit persons to whom
13 | the Software is furnished to do so, subject to the following conditions:
14 |
15 | - Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimers.
17 | - Redistributions in binary form must reproduce the above copyright notice,
18 | this list of conditions and the following disclaimers in the documentation
19 | and/or other materials provided with the distribution.
20 | - Neither the names of [Name of Development Group, UCAR],
21 | nor the names of its contributors may be used to endorse or promote
22 | products derived from this Software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | POSSIBILITY OF SUCH DAMAGE.
35 |
--------------------------------------------------------------------------------
/manage_externals/test/README.md:
--------------------------------------------------------------------------------
1 | # Testing for checkout_externals
2 |
3 | NOTE: Python2 is the supported runtime environment. Python3 compatibility is
4 | in progress, complicated by the different proposed input methods
5 | (yaml, xml, cfg/ini, json) and their different handling of strings
6 | (unicode vs byte) in python2. Full python3 compatibility will be
7 | possible once the number of possible input formats has been narrowed.
8 |
9 | ## Setup development environment
10 |
11 | Development environments should be setup for python2 and python3:
12 |
13 | ```SH
14 | cd checkout_externals/test
15 | make python=python2 env
16 | make python=python3 env
17 | ```
18 |
19 | ## Unit tests
20 |
21 | Tests should be run for both python2 and python3. It is recommended
22 | that you have seperate terminal windows open python2 and python3
23 | testing to avoid errors activating and deactivating environments.
24 |
25 | ```SH
26 | cd checkout_externals/test
27 | . env_python2/bin/activate
28 | make utest
29 | deactivate
30 | ```
31 |
32 | ```SH
33 | cd checkout_externals/test
34 | . env_python2/bin/activate
35 | make utest
36 | deactivate
37 | ```
38 |
39 | ## System tests
40 |
41 | Not yet implemented.
42 |
43 | ## Static analysis
44 |
45 | checkout_externals is difficult to test thoroughly because it relies
46 | on git and svn, and svn requires a live network connection and
47 | repository. Static analysis will help catch bugs in code paths that
48 | are not being executed, but it requires conforming to community
49 | standards and best practices. autopep8 and pylint should be run
50 | regularly for automatic code formatting and linting.
51 |
52 | ```SH
53 | cd checkout_externals/test
54 | . env_python2/bin/activate
55 | make lint
56 | deactivate
57 | ```
58 |
59 | The canonical formatting for the code is whatever autopep8
60 | generates. All issues identified by pylint should be addressed.
61 |
62 |
63 | ## Code coverage
64 |
65 | All changes to the code should include maintaining existing tests and
66 | writing new tests for new or changed functionality. To ensure test
67 | coverage, run the code coverage tool:
68 |
69 | ```SH
70 | cd checkout_externals/test
71 | . env_python2/bin/activate
72 | make coverage
73 | open -a Firefox.app htmlcov/index.html
74 | deactivate
75 | ```
76 |
77 |
78 |
--------------------------------------------------------------------------------
/cime_config/buildnml_test/env_mach_pes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 | integer
15 |
16 |
17 |
18 | integer
19 |
20 |
21 |
22 | integer
23 |
24 |
25 |
26 | integer
27 |
28 |
29 |
30 | integer
31 | Force this exact number of spare nodes to be allocated
32 |
33 |
34 |
35 | integer
36 |
37 | 1
38 | 1
39 | 1
40 | 1
41 |
42 |
43 |
44 |
45 |
46 | integer
47 |
48 | -2
49 | -2
50 | -2
51 | -2
52 |
53 |
54 |
55 |
56 |
57 | integer
58 |
59 | 0
60 | 0
61 | 0
62 | 0
63 |
64 |
65 |
66 |
67 |
68 | integer
69 |
70 | 1
71 | 1
72 | 1
73 |
74 |
75 |
76 |
77 |
78 | integer
79 |
80 | 1
81 | 1
82 | 1
83 | 1
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/src/main/abortutils.F90:
--------------------------------------------------------------------------------
1 | module abortutils
2 |
3 | !-----------------------------------------------------------------------
4 | ! !MODULE: abortutils
5 | !
6 | ! !DESCRIPTION:
7 | ! Abort the model for abnormal termination
8 | !-----------------------------------------------------------------------
9 |
10 | private
11 | save
12 |
13 | public :: endrun
14 |
15 | interface endrun
16 | module procedure endrun_vanilla
17 | module procedure endrun_globalindex
18 | end interface
19 |
20 | CONTAINS
21 |
22 | !-----------------------------------------------------------------------
23 | subroutine endrun_vanilla(msg)
24 |
25 | !-----------------------------------------------------------------------
26 | ! !DESCRIPTION:
27 | ! Abort the model for abnormal termination
28 | !
29 | use shr_sys_mod , only: shr_sys_abort
30 | use clm_varctl , only: iulog
31 | !
32 | ! !ARGUMENTS:
33 | implicit none
34 | character(len=*), intent(in), optional :: msg ! string to be printed
35 | !-----------------------------------------------------------------------
36 |
37 | if (present (msg)) then
38 | write(iulog,*)'ENDRUN:', msg
39 | else
40 | write(iulog,*)'ENDRUN: called without a message string'
41 | end if
42 |
43 | call shr_sys_abort()
44 |
45 | end subroutine endrun_vanilla
46 |
47 | !-----------------------------------------------------------------------
48 | subroutine endrun_globalindex(decomp_index, clmlevel, msg)
49 |
50 | !-----------------------------------------------------------------------
51 | ! Description:
52 | ! Abort the model for abnormal termination
53 | !
54 | use shr_sys_mod , only: shr_sys_abort
55 | use clm_varctl , only: iulog
56 | use GetGlobalValuesMod, only: GetGlobalWrite
57 | !
58 | ! Arguments:
59 | implicit none
60 | integer , intent(in) :: decomp_index
61 | character(len=*) , intent(in) :: clmlevel
62 | character(len=*) , intent(in), optional :: msg ! string to be printed
63 | !
64 | ! Local Variables:
65 | integer :: igrc
66 | !-----------------------------------------------------------------------
67 |
68 | write(6,*)'calling getglobalwrite with decomp_index= ',decomp_index,' and clmlevel= ',trim(clmlevel)
69 | call GetGlobalWrite(decomp_index, clmlevel)
70 |
71 | if (present (msg)) then
72 | write(iulog,*)'ENDRUN:', msg
73 | else
74 | write(iulog,*)'ENDRUN: called without a message string'
75 | end if
76 |
77 | call shr_sys_abort()
78 |
79 | end subroutine endrun_globalindex
80 |
81 | end module abortutils
82 |
--------------------------------------------------------------------------------
/src/main/ncdio_utils.F90:
--------------------------------------------------------------------------------
1 | module ncdio_utils
2 |
3 | !-----------------------------------------------------------------------
4 | ! This module provides higher-level netcdf i/o utilities, which build on ncdio_pio.
5 | !
6 | ! The main reason for putting these utilities in a separate module (rather than putting
7 | ! them in ncdio_pio) is to enhance testability: These routines can be unit tested with
8 | ! a stub version of ncdio_pio.
9 | use ncdio_pio
10 | !
11 | implicit none
12 | save
13 | private
14 |
15 | public :: find_var_on_file ! given a list of possible variables, find the one that exists on the file
16 |
17 | contains
18 |
19 | !-----------------------------------------------------------------------
20 | subroutine find_var_on_file(ncid, varname_list, varname_on_file)
21 | !
22 | ! !DESCRIPTION:
23 | ! Given a colon-delimited list of possible variable names, return the first one that
24 | ! was found on the file.
25 | !
26 | ! If none are found, arbitrarily return the first variable in the list. (Doing this
27 | ! rather than returning a special flag simplifies the logic elsewhere - allowing the
28 | ! ncd_io call to fail rather than requiring extra error-checking logic.)
29 | !
30 | ! !USES:
31 | use shr_string_mod, only : shr_string_listGetNum, shr_string_listGetName
32 | !
33 | ! !ARGUMENTS:
34 | type(file_desc_t) , intent(inout) :: ncid ! netcdf file id
35 | character(len=*) , intent(in) :: varname_list ! colon-delimited list of possible variable names
36 | character(len=*) , intent(out) :: varname_on_file ! first variable from the list that was found on file
37 | !
38 | ! !LOCAL VARIABLES:
39 | integer :: num_vars
40 | integer :: n
41 | logical :: found
42 | logical :: readvar
43 | character(len=len(varname_on_file)) :: cur_varname
44 | integer :: varid
45 | type(var_desc_t) :: vardesc
46 |
47 | character(len=*), parameter :: subname = 'find_var_on_file'
48 | !-----------------------------------------------------------------------
49 |
50 | num_vars = shr_string_listGetNum(varname_list)
51 |
52 | found = .false.
53 | n = 1
54 | do while ((.not. found) .and. (n <= num_vars))
55 | call shr_string_listGetName(varname_list, n, cur_varname)
56 | call ncd_inqvid(ncid, cur_varname, varid, vardesc, readvar=readvar)
57 | found = readvar
58 | n = n + 1
59 | end do
60 |
61 | if (found) then
62 | varname_on_file = cur_varname
63 | else
64 | ! If none are found, arbitrarily return the first variable in the list
65 | call shr_string_listGetName(varname_list, 1, varname_on_file)
66 | end if
67 |
68 | end subroutine find_var_on_file
69 |
70 | end module ncdio_utils
71 |
--------------------------------------------------------------------------------
/python/slim/run_slim_py_tests.py:
--------------------------------------------------------------------------------
1 | """Runner for the python unit tests defined here
2 |
3 | This is the main implementation of the run_slim_py_tests script contained in the
4 | parent directory
5 | """
6 |
7 | import unittest
8 | import os
9 | import argparse
10 | import logging
11 | from slim import unit_testing
12 |
13 | logger = logging.getLogger(__name__)
14 |
15 |
16 | def main(description):
17 | """Main function called when run_tests is run from the command-line
18 |
19 | Args:
20 | description (str): description printed to usage message
21 | """
22 | args = _commandline_args(description)
23 | verbosity = _get_verbosity_level(args)
24 |
25 | if args.pattern is not None:
26 | pattern = args.pattern
27 | elif args.unit:
28 | pattern = "test_unit*.py"
29 | elif args.sys:
30 | pattern = "test_sys*.py"
31 | else:
32 | pattern = "test*.py"
33 |
34 | # This setup_for_tests call is the main motivation for having this wrapper script to
35 | # run the tests rather than just using 'python -m unittest discover'
36 | unit_testing.setup_for_tests(enable_critical_logs=args.debug)
37 |
38 | mydir = os.path.dirname(os.path.abspath(__file__))
39 | testsuite = unittest.defaultTestLoader.discover(start_dir=mydir, pattern=pattern)
40 | # NOTE(wjs, 2018-08-29) We may want to change the meaning of '--debug'
41 | # vs. '--verbose': I could imagine having --verbose set buffer=False, and --debug
42 | # additionally sets the logging level to much higher - e.g., debug level.
43 | testrunner = unittest.TextTestRunner(buffer=(not args.debug), verbosity=verbosity)
44 | testrunner.run(testsuite)
45 |
46 |
47 | def _commandline_args(description):
48 | """Parse and return command-line arguments"""
49 | parser = argparse.ArgumentParser(
50 | description=description, formatter_class=argparse.RawTextHelpFormatter
51 | )
52 |
53 | output_level = parser.add_mutually_exclusive_group()
54 |
55 | output_level.add_argument(
56 | "-v", "--verbose", action="store_true", help="Run tests with more verbosity"
57 | )
58 |
59 | output_level.add_argument(
60 | "-d", "--debug", action="store_true", help="Run tests with even more verbosity"
61 | )
62 |
63 | test_subset = parser.add_mutually_exclusive_group()
64 |
65 | test_subset.add_argument("-u", "--unit", action="store_true", help="Only run unit tests")
66 |
67 | test_subset.add_argument("-s", "--sys", action="store_true", help="Only run system tests")
68 |
69 | test_subset.add_argument(
70 | "-p", "--pattern", help="File name pattern to match\n" "Default is test*.py"
71 | )
72 |
73 | args = parser.parse_args()
74 |
75 | return args
76 |
77 |
78 | def _get_verbosity_level(args):
79 | if args.debug or args.verbose:
80 | verbosity = 2
81 | else:
82 | verbosity = 1
83 | return verbosity
84 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | =============================================================================================
2 | Important files in main directories:
3 | =============================================================================================
4 |
5 | Externals.cfg --------------- File for management of the main high level externals
6 |
7 | =============================================================================================
8 | Important main subdirectories
9 | =============================================================================================
10 |
11 | src --------------- SLIM Source code.
12 | tools ------------- SLIM Offline tools to prepare input datasets and process output.
13 | cime_config ------- Configuration files of cime for compsets and SLIM settings
14 | manage_externals -- Script to manage the external source directories
15 | py_env_create ----- Script to setup the python environment for SLIM python tools using conda
16 | python ------------ Some python modules
17 | components -------- Other active sub-components needed for SLIM to run (CAM and CICE)
18 | libraries --------- CESM libraries: MCT (Model Coupling Toolkit) and PIO
19 | share ------------- CESM shared code
20 |
21 | cime/scripts --------------- cesm/cime driver scripts
22 |
23 | =============================================================================================
24 | SLIM XML variables:
25 | =============================================================================================
26 |
27 | SLIM_SCENARIO: Scenario to use, usually set by the compset
28 | SLIM_START_TYPE: The start type to use, usually set by the RUN_TYPE
29 |
30 | =============================================================================================
31 | SLIM important namelist items:
32 | =============================================================================================
33 |
34 | mml_surdat -- Dataset of surface characteristics to use (usually set by the compset/grid)
35 | finidat ----- Initial conditions to startup with
36 | hist_nhtfrq - History file frequency of output
37 |
38 | =============================================================================================
39 | QUICKSTART: using the CPL7 scripts:
40 | =============================================================================================
41 |
42 | cd cime/scripts
43 | ./create_newcase # get help on how to run create_newcase
44 | ./create_newcase --case testI --res f19_f19_mg17 --compset I2000SlimRsGs
45 | # create new "I" case for cheyenne_intel at 1.9x2.5_gx1v7 res
46 | # "I2000SlimRsGs" case is SLIM active, datm8, and inactive ice/ocn/glc/rof
47 | cd testI
48 | ./case.setup # create the $CASE.run file
49 | ./case.build # build model and create namelists
50 | ./case.submit # submit script
51 | # (NOTE: ./xmlchange RESUBMIT=10 to set RESUBMIT to number
52 | # # of times to automatically resubmit -- 10 in this example)
53 |
54 |
--------------------------------------------------------------------------------
/cime_config/config_component.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
14 |
15 |
16 |
17 | Simple Land Model:
18 |
19 |
20 |
21 | char
22 | slim
23 | slim
24 | case_comp
25 | env_case.xml
26 | Name of land component
27 |
28 |
29 |
30 | char
31 | global_uniform
32 | global_uniform,realistic_from_1850,realistic_from_2000,user_defined
33 |
34 | realistic_from_2000
35 | realistic_from_1850
36 | realistic_from_1850
37 |
38 | run_component_slim
39 | env_run.xml
40 | SLIM namelist use_case scenario.
41 | Determines the use-case scenario that will be used in the SLIM buildnml utility.
42 | This is normally set by the component set.
43 | 'global_uniform' is for surface conditions are globally constant
44 | 'realistic_from_1850' are surface conditions taken from a 1850 control simulation with CTSM
45 | 'realistic_from_2000' are surface conditions taken from a 2000 control simulation with CTSM
46 | 'user_defined' means the user will provide their own surface condition file (mml_surdat)
47 |
48 |
49 |
50 |
51 | char
52 | cold,any,required
53 | any
54 |
55 | required
56 | required
57 | any
58 |
59 | run_component_slim
60 | env_run.xml
61 |
62 | SLIM run type.
63 | 'cold' is a cold start from arbitrary initial conditions, it will fail if you do provide initial conditions
64 | 'any' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found
65 | 'required' is a run where starting from provided initial conditions is required, it will fail if they aren't
66 |
67 |
68 |
69 |
70 | =========================================
71 | SLIM naming conventions
72 | =========================================
73 | note: [^_]* means match zero or more of any character BUT an underbar.
74 | (in other words make sure there is NOT a underbar before the string afterwards)
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/src/main/clm_instMod.F90:
--------------------------------------------------------------------------------
1 | module clm_instMod
2 |
3 | !------------------------------------------------------------------------------
4 | ! !DESCRIPTION:
5 | ! Instances and definitions of all data types
6 | !
7 | ! !USES:
8 | use shr_kind_mod , only : r8 => shr_kind_r8
9 | use decompMod , only : bounds_type
10 | use clm_varcon , only : bdsno
11 | use clm_varctl , only : iulog
12 | use perf_mod , only : t_startf, t_stopf
13 |
14 | !-----------------------------------------
15 | ! Constants
16 | !-----------------------------------------
17 |
18 | !-----------------------------------------
19 | ! Definition of component types
20 | !-----------------------------------------
21 |
22 | use atm2lndType , only : atm2lnd_type
23 | use lnd2atmType , only : lnd2atm_type
24 | use GridcellType , only : grc
25 | !
26 | implicit none
27 | public ! By default everything is public
28 | !
29 | !-----------------------------------------
30 | ! Instances of component types
31 | !-----------------------------------------
32 |
33 | ! Physics types
34 | type(atm2lnd_type) :: atm2lnd_inst
35 | type(lnd2atm_type) :: lnd2atm_inst
36 |
37 | public :: clm_instInit ! Initialize
38 | public :: clm_instRest ! Setup restart
39 | !-----------------------------------------------------------------------
40 |
41 | contains
42 |
43 | !-----------------------------------------------------------------------
44 | subroutine clm_instInit(bounds)
45 | !
46 | ! !ARGUMENTS
47 | type(bounds_type), intent(in) :: bounds ! processor bounds
48 | !
49 | ! !LOCAL VARIABLES:
50 | !----------------------------------------------------------------------
51 |
52 | ! Initialize clm->drv and drv->clm data structures
53 |
54 | call atm2lnd_inst%Init(bounds)
55 | call lnd2atm_inst%Init(bounds)
56 |
57 | ! Initialization of public data types
58 |
59 | ! TODO SLIM: slevis keeping an example of an accumulated field as template
60 | ! ! ------------------------------------------------------------------------
61 | ! ! Initialize accumulated fields
62 | ! ! ------------------------------------------------------------------------
63 |
64 | ! ! The time manager needs to be initialized before this called is made, since
65 | ! ! the step size is needed.
66 |
67 | ! call t_startf('init_accflds')
68 | ! call atm2lnd_inst%InitAccBuffer(bounds)
69 | ! call t_stopf('init_accflds')
70 |
71 | end subroutine clm_instInit
72 |
73 | !-----------------------------------------------------------------------
74 | subroutine clm_instRest(bounds, ncid, flag)
75 | !
76 | ! !USES:
77 | use ncdio_pio , only : file_desc_t
78 | !
79 | ! !DESCRIPTION:
80 | ! Define/write/read CLM restart file.
81 | !
82 | ! !ARGUMENTS:
83 | type(bounds_type) , intent(in) :: bounds
84 | type(file_desc_t) , intent(inout) :: ncid ! netcdf id
85 | character(len=*) , intent(in) :: flag ! 'define', 'write', 'read'
86 | !-----------------------------------------------------------------------
87 |
88 | call atm2lnd_inst%restart (bounds, ncid, flag=flag)
89 |
90 | end subroutine clm_instRest
91 |
92 | end module clm_instMod
93 |
94 |
--------------------------------------------------------------------------------
/Copyright:
--------------------------------------------------------------------------------
1 | CESM1.5: Copyright Notice and Disclaimer
2 |
3 | The Community Earth System Model (CESM was developed in cooperation with
4 | the National Science Foundation, the Department of Energy,
5 | the National Aeronautics and Space Administration, and
6 | the University Corporation for Atmospheric Research National Center for Atmospheric Research.
7 |
8 | Except for the segregable components listed below, CESM is public domain software.
9 | There may be other third party tools and libraries that are embedded, and
10 | they may have their own copyright notices and terms.
11 |
12 | The following components are copyrighted and may only be used, modified,
13 | or redistributed under the terms indicated below.
14 |
15 | Code Institution Copyright Terms of Use/Disclaimer
16 | ---- ----------- --------- -----------------------
17 | ESMF University of Copyright University of Illinois/NCSA Open Source License
18 | Illinois/NCSA 2002-2009,
19 | University of
20 | Illinois/NCSA
21 | Open Source
22 | License
23 |
24 | POP,SCRIP,CICE Los Alamos National Copyright 2008 Los Alamos National Security, LLC
25 | Laboratory Los Alamos
26 | National
27 | Security, LLC
28 |
29 | Glimmer-CISM LANL/U. Copyright GNU General Public License
30 | Bristol/U. 2004-2010,
31 | Edinburgh/U. GNU General
32 | Montana/U. Public License
33 | Swansea
34 |
35 | AER RRTMG Atmospheric Copyright AER RRTMG Copyright
36 | and 2002-2010,
37 | Environmental Atmospheric
38 | Research, Inc. and
39 | Environmental
40 | Research, Inc.
41 |
42 | MCT Argonne Copyright 2000, MCT Copyright
43 | National 2010,
44 | Laboratory University of
45 | Chicago.
46 |
47 | ICSSP N/A Copyright 2003, ISCCP Simulator Software
48 | 2010, Steve
49 | Klein and Mark
50 | Webb
51 |
52 | XML/Lite Wadsack-Allen Copyright 2001, The documentation for the Perl XML-Lite
53 | Digital Group 2010 module is no longer available on-line.
54 | Wadsack-Allen
55 | Digital Group
56 |
57 | Inf_NaN Lahey Copyright(c) Copies of this source code, or standalone compiled
58 | _Detection Computer 2003, Lahey files derived from this source may not be sold
59 | module Systems, Inc. Computer without permission from Lahey Computers Systems.
60 | Systems, Inc. All or part of this module may be freely incorporated
61 | into executable programs which are offered for sale.
62 | Otherwise, distribution of all or part of this file is
63 | permitted, provided this copyright notice and header
64 | are included.
65 |
66 |
67 | THIS SOFTWARE IS PROVIDED BY UCAR AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
68 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
69 | DISCLAIMED. IN NO EVENT SHALL UCAR OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
70 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
71 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
72 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
73 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
74 |
75 |
--------------------------------------------------------------------------------
/manage_externals/test/Makefile:
--------------------------------------------------------------------------------
1 | python = not-set
2 | verbose = not-set
3 | debug = not-set
4 |
5 | ifneq ($(python), not-set)
6 | PYTHON=$(python)
7 | else
8 | PYTHON=python
9 | endif
10 |
11 | # we need the python path to point one level up to access the package
12 | # and executables
13 | PYPATH=PYTHONPATH=..:
14 |
15 | # common args for running tests
16 | TEST_ARGS=-m unittest discover
17 |
18 | ifeq ($(debug), not-set)
19 | ifeq ($(verbose), not-set)
20 | # summary only output
21 | TEST_ARGS+=--buffer
22 | else
23 | # show individual test summary
24 | TEST_ARGS+=--buffer --verbose
25 | endif
26 | else
27 | # show detailed test output
28 | TEST_ARGS+=--verbose
29 | endif
30 |
31 |
32 | # auto reformat the code
33 | AUTOPEP8=autopep8
34 | AUTOPEP8_ARGS=--aggressive --in-place
35 |
36 | # run lint
37 | PYLINT=pylint
38 | PYLINT_ARGS=-j 2 --rcfile=.pylint.rc
39 |
40 | # code coverage
41 | COVERAGE=coverage
42 | COVERAGE_ARGS=--rcfile=.coveragerc
43 |
44 | # source files
45 | SRC = \
46 | ../checkout_externals \
47 | ../manic/*.py
48 |
49 | CHECKOUT_EXE = ../checkout_externals
50 |
51 | TEST_DIR = .
52 |
53 | README = ../README.md
54 |
55 | #
56 | # testing
57 | #
58 | .PHONY : utest
59 | utest : FORCE
60 | $(PYPATH) $(PYTHON) $(TEST_ARGS) --pattern 'test_unit_*.py'
61 |
62 | .PHONY : stest
63 | stest : FORCE
64 | $(PYPATH) $(PYTHON) $(TEST_ARGS) --pattern 'test_sys_*.py'
65 |
66 | .PHONY : test
67 | test : utest stest
68 |
69 | #
70 | # documentation
71 | #
72 | .PHONY : readme
73 | readme : $(CHECKOUT_EXE)
74 | printf "%s\n\n" "-- AUTOMATICALLY GENERATED FILE. DO NOT EDIT --" > $(README)
75 | printf "%s" '[](https://travis-ci.org/ESMCI/manage_externals)' >> $(README)
76 | printf "%s" '[](https://coveralls.io/github/ESMCI/manage_externals?branch=master)' >> $(README)
77 | printf "\n%s\n" '```' >> $(README)
78 | $(CHECKOUT_EXE) --help >> $(README)
79 |
80 | #
81 | # coding standards
82 | #
83 | .PHONY : style
84 | style : FORCE
85 | $(AUTOPEP8) $(AUTOPEP8_ARGS) --recursive $(SRC) $(TEST_DIR)/test_*.py
86 |
87 | .PHONY : lint
88 | lint : FORCE
89 | $(PYLINT) $(PYLINT_ARGS) $(SRC) $(TEST_DIR)/test_*.py
90 |
91 | .PHONY : stylint
92 | stylint : style lint
93 |
94 | .PHONY : coverage
95 | # Need to use a single coverage run with a single pattern rather than
96 | # using two separate commands with separate patterns for test_unit_*.py
97 | # and test_sys_*.py: The latter clobbers some results from the first
98 | # run, even if we use the --append flag to 'coverage run'.
99 | coverage : FORCE
100 | $(PYPATH) $(COVERAGE) erase
101 | $(PYPATH) $(COVERAGE) run $(COVERAGE_ARGS) $(TEST_ARGS) --pattern 'test_*.py'
102 | $(PYPATH) $(COVERAGE) html
103 |
104 | #
105 | # virtual environment creation
106 | #
107 | .PHONY : env
108 | env : FORCE
109 | $(PYPATH) virtualenv --python $(PYTHON) $@_$(PYTHON)
110 | . $@_$(PYTHON)/bin/activate; pip install -r requirements.txt
111 |
112 | #
113 | # utilites
114 | #
115 | .PHONY : clean
116 | clean : FORCE
117 | -rm -rf *~ *.pyc tmp fake htmlcov
118 |
119 | .PHONY : clobber
120 | clobber : clean
121 | -rm -rf env_*
122 |
123 | FORCE :
124 |
125 |
--------------------------------------------------------------------------------
/python/slim/utils.py:
--------------------------------------------------------------------------------
1 | """General-purpose utility functions"""
2 |
3 | import logging
4 | import os
5 | import sys
6 | import pdb
7 |
8 | from datetime import date
9 | from getpass import getuser
10 |
11 | from slim.git_utils import get_slim_git_short_hash
12 |
13 | logger = logging.getLogger(__name__)
14 |
15 |
16 | def abort(errmsg):
17 | """Abort the program with the given error message
18 |
19 | No traceback is given, but if the logging level is DEBUG, then we'll enter pdb
20 | """
21 | if logger.isEnabledFor(logging.DEBUG):
22 | pdb.set_trace()
23 |
24 | sys.exit("ERROR: {}".format(errmsg))
25 |
26 |
27 | def update_metadata(file, title, summary, contact, data_script, description):
28 | """
29 | Description
30 | -----------
31 | Update netcdf file's metadata
32 | Arguments
33 | ---------
34 | title: No more than short one-sentence explanation.
35 | summary: No more than two-sentence explanation.
36 | contact: E.g. CAM bulletin board at https://bb.cgd.ucar.edu
37 | data_script: Script or instructions used to generate the dataset.
38 | description: Anything else that's relevant. Capturing the command-line
39 | would be good (sys.argv) here or in data_script.
40 | """
41 |
42 | # update attributes
43 | today = date.today()
44 | today_string = today.strftime("%Y-%m-%d")
45 |
46 | # This is the required metadata for inputdata files
47 | file.attrs["title"] = title
48 | file.attrs["summary"] = summary
49 | file.attrs["creator"] = getuser()
50 | file.attrs["contact"] = contact
51 | file.attrs["creation_date"] = today_string
52 | file.attrs["data_script"] = data_script
53 | file.attrs["description"] = description
54 |
55 | # delete unrelated attributes if they exist
56 | del_attrs = [
57 | "source_code",
58 | "SVN_url",
59 | "hostname",
60 | "history",
61 | "History_Log",
62 | "Logname",
63 | "Host",
64 | "Version",
65 | "Compiler_Optimized",
66 | ]
67 | attr_list = file.attrs
68 |
69 | for attr in del_attrs:
70 | if attr in attr_list:
71 | del file.attrs[attr]
72 |
73 |
74 | def write_output(file, file_in, file_out, file_type):
75 | """
76 | Description
77 | -----------
78 | Write output file
79 | Arguments
80 | ---------
81 | file_in:
82 | (str) User-defined entry of input file
83 | file_out:
84 | (str) User-defined entry of output file
85 | file_type:
86 | (str) examples: mesh, surdat
87 | """
88 |
89 | # update attributes
90 | title = "Modified " + file_type + " file"
91 | summary = "Modified " + file_type + " file"
92 | contact = "N/A"
93 | data_script = os.path.abspath(__file__) + " -- " + get_slim_git_short_hash()
94 | description = "Modified this file: " + file_in
95 | update_metadata(
96 | file,
97 | title=title,
98 | summary=summary,
99 | contact=contact,
100 | data_script=data_script,
101 | description=description,
102 | )
103 |
104 | # mode 'w' overwrites file if it exists
105 | file.to_netcdf(path=file_out, mode="w", format="NETCDF3_64BIT")
106 | logger.info("Successfully created: %s", file_out)
107 | file.close()
108 |
--------------------------------------------------------------------------------
/cime_config/testdefs/ExpectedTestFails.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
29 |
30 |
31 |
32 |
33 |
34 | FAIL
35 | ESCOMP/SimpleLand#85
36 |
37 |
38 |
39 |
40 | FAIL
41 | ESCOMP/SimpleLand#85
42 |
43 |
44 |
45 |
46 | FAIL
47 | ESCOMP/SimpleLand#85
48 |
49 |
50 |
51 |
52 | FAIL
53 | ESCOMP/SimpleLand#85
54 |
55 |
56 |
57 |
58 | FAIL
59 | ESCOMP/SimpleLand#17
60 |
61 |
62 |
63 |
64 | FAIL
65 | ESCOMP/SimpleLand#17
66 |
67 |
68 |
69 |
70 | FAIL
71 | ESCOMP/SimpleLand#75
72 |
73 |
74 |
75 |
76 | FAIL
77 | ESCOMP/SimpleLand#79
78 |
79 |
80 |
81 |
82 | FAIL
83 | ESCOMP/SimpleLand#79
84 |
85 |
86 |
87 |
88 | FAIL
89 | ESCOMP/SimpleLand#79
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/python/slim/slim_logging.py:
--------------------------------------------------------------------------------
1 | """Utilities to facilitate logging
2 |
3 | A guide to logging in slim python scripts:
4 |
5 | - At the top of each module, you should have:
6 | logger = logging.getLogger(__name__)
7 |
8 | - Logging should be done via that logger, NOT via logging.[whatever]
9 |
10 | - If you want to allow the user to control logging via command-line arguments, you should:
11 |
12 | (1) At the very start of a script / application, call setup_logging_pre_config(). (We
13 | need to initialize logging to avoid errors from logging calls made very early in the
14 | script.)
15 |
16 | (2) When setting up the argument parser, call add_logging_args(parser)
17 |
18 | (3) After parsing arguments, call process_logging_args(args)
19 |
20 | - If you don't want to allow the user to control logging via command-line arguments, then
21 | simply:
22 |
23 | (1) At the very start of a script / application, call setup_logging() with the desired
24 | arguments
25 |
26 | - In unit tests, to avoid messages about loggers not being set up, you should call
27 | setup_logging_for_tests (this is typically done via unit_testing.setup_for_tests)
28 | """
29 |
30 | import logging
31 |
32 | logger = logging.getLogger(__name__)
33 |
34 |
35 | def setup_logging_pre_config():
36 | """Setup logging for a script / application
37 |
38 | This function should be called at the very start of a script / application where you
39 | intend to allow the user to control logging preferences via command-line arguments.
40 |
41 | This sets initial options that may be changed later by process_logging_args.
42 | """
43 | setup_logging(level=logging.WARNING)
44 |
45 |
46 | def setup_logging_for_tests(enable_critical=False):
47 | """Setup logging as appropriate for unit tests"""
48 | setup_logging(level=logging.CRITICAL)
49 | if not enable_critical:
50 | logging.disable(logging.CRITICAL)
51 |
52 |
53 | def setup_logging(level=logging.WARNING):
54 | """Setup logging for a script / application
55 |
56 | This function should be called at the very start of a script / application where you
57 | do NOT intend to allow the user to control logging preferences via command-line
58 | arguments, so that all of the final logging options are set here.
59 | """
60 | logging.basicConfig(format="%(levelname)s: %(message)s", level=level)
61 |
62 |
63 | def add_logging_args(parser):
64 | """Add common logging-related options to the argument parser"""
65 |
66 | logging_level = parser.add_mutually_exclusive_group()
67 |
68 | logging_level.add_argument(
69 | "-v", "--verbose", action="store_true", help="Output extra logging info"
70 | )
71 |
72 | logging_level.add_argument(
73 | "--debug",
74 | action="store_true",
75 | help="Output even more logging info for debugging",
76 | )
77 |
78 |
79 | def process_logging_args(args):
80 | """Configure logging based on the logging-related args added by add_logging_args"""
81 | root_logger = logging.getLogger()
82 |
83 | if args.debug:
84 | root_logger.setLevel(logging.DEBUG)
85 | elif args.verbose:
86 | root_logger.setLevel(logging.INFO)
87 | else:
88 | root_logger.setLevel(logging.WARNING)
89 |
90 |
91 | def output_to_file(file_path, message, log_to_logger=False):
92 | """
93 | helper function to write to log file.
94 | """
95 | with open(file_path, "a") as log_file:
96 | log_file.write(message)
97 | if log_to_logger:
98 | logger.info(message)
99 |
--------------------------------------------------------------------------------
/manage_externals/manic/repository.py:
--------------------------------------------------------------------------------
1 | """Base class representation of a repository
2 | """
3 |
4 | from .externals_description import ExternalsDescription
5 | from .utils import fatal_error
6 | from .global_constants import EMPTY_STR
7 |
8 |
9 | class Repository(object):
10 | """
11 | Class to represent and operate on a repository description.
12 | """
13 |
14 | def __init__(self, component_name, repo):
15 | """
16 | Parse repo externals description
17 | """
18 | self._name = component_name
19 | self._protocol = repo[ExternalsDescription.PROTOCOL]
20 | self._tag = repo[ExternalsDescription.TAG]
21 | self._branch = repo[ExternalsDescription.BRANCH]
22 | self._hash = repo[ExternalsDescription.HASH]
23 | self._url = repo[ExternalsDescription.REPO_URL]
24 | self._sparse = repo[ExternalsDescription.SPARSE]
25 |
26 | if self._url is EMPTY_STR:
27 | fatal_error('repo must have a URL')
28 |
29 | if ((self._tag is EMPTY_STR) and (self._branch is EMPTY_STR) and
30 | (self._hash is EMPTY_STR)):
31 | fatal_error('{0} repo must have a branch, tag or hash element')
32 |
33 | ref_count = 0
34 | if self._tag is not EMPTY_STR:
35 | ref_count += 1
36 | if self._branch is not EMPTY_STR:
37 | ref_count += 1
38 | if self._hash is not EMPTY_STR:
39 | ref_count += 1
40 | if ref_count != 1:
41 | fatal_error('repo {0} must have exactly one of '
42 | 'tag, branch or hash.'.format(self._name))
43 |
44 | def checkout(self, base_dir_path, repo_dir_name, verbosity, recursive): # pylint: disable=unused-argument
45 | """
46 | If the repo destination directory exists, ensure it is correct (from
47 | correct URL, correct branch or tag), and possibly update the source.
48 | If the repo destination directory does not exist, checkout the correce
49 | branch or tag.
50 | NB: is include as an argument for compatibility with
51 | git functionality (repository_git.py)
52 | """
53 | msg = ('DEV_ERROR: checkout method must be implemented in all '
54 | 'repository classes! {0}'.format(self.__class__.__name__))
55 | fatal_error(msg)
56 |
57 | def status(self, stat, repo_dir_path): # pylint: disable=unused-argument
58 | """Report the status of the repo
59 |
60 | """
61 | msg = ('DEV_ERROR: status method must be implemented in all '
62 | 'repository classes! {0}'.format(self.__class__.__name__))
63 | fatal_error(msg)
64 |
65 | def submodules_file(self, repo_path=None):
66 | # pylint: disable=no-self-use,unused-argument
67 | """Stub for use by non-git VC systems"""
68 | return None
69 |
70 | def url(self):
71 | """Public access of repo url.
72 | """
73 | return self._url
74 |
75 | def tag(self):
76 | """Public access of repo tag
77 | """
78 | return self._tag
79 |
80 | def branch(self):
81 | """Public access of repo branch.
82 | """
83 | return self._branch
84 |
85 | def hash(self):
86 | """Public access of repo hash.
87 | """
88 | return self._hash
89 |
90 | def name(self):
91 | """Public access of repo name.
92 | """
93 | return self._name
94 |
95 | def protocol(self):
96 | """Public access of repo protocol.
97 | """
98 | return self._protocol
99 |
--------------------------------------------------------------------------------
/cime_config/namelist_definition.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | SLIM Namelist Definition
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
Definition of SLIM namelist variables
22 |
We list all of the relevant namelist variables for SLIM cases. This includes
23 | SLIM Namelist items.
24 |
25 |
Definition of SLIM namelist variables
26 |
Note, these all would go into the user_nl_slim file
27 |
Included in the table are the following pieces of information:
28 |
29 |
Variable name.
30 |
Variable type (char, integer,
31 | real, or logical). The type
32 | char has the length appended
33 | following an asterisk, e.g., char*256. Variables that are
34 | arrays have their dimension specifier appended inside parentheses. For
35 | example char*1(6) denotes a array of six
36 | char*1 values.
37 |
38 |
Variable description (includes information on defaults).
39 |
Valid values (if restricted).
40 |
41 |
42 |
43 |
SLIM Namelist Physics Options
44 |
45 |
Name
46 |
Type
47 |
Description
48 |
49 |
50 |
Valid values
51 |
52 |
53 |
54 |
55 |
56 |
SLIM Namelist Datasets
57 |
58 |
Name
59 |
Type
60 |
Description
61 |
62 |
63 |
64 |
Valid values
65 |
66 |
67 |
68 |
69 |
70 |
SLIM Namelist History output settings
71 |
72 |
Name
73 |
Type
74 |
Description
75 |
76 |
77 |
Valid values
78 |
79 |
80 |
81 |
82 |
83 |
SLIM Namelist Performance Tuning
84 |
85 |
Name
86 |
Type
87 |
Description
88 |
89 |
90 |
Valid values
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
Valid Values:
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/src/main/GridcellType.F90:
--------------------------------------------------------------------------------
1 | module GridcellType
2 |
3 | !-----------------------------------------------------------------------
4 | ! !DESCRIPTION:
5 | ! Gridcell data type allocation
6 | ! --------------------------------------------------------
7 | ! gridcell types can have values of
8 | ! --------------------------------------------------------
9 | ! 1 => default
10 | !
11 | use shr_kind_mod , only : r8 => shr_kind_r8
12 | use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=)
13 | use clm_varcon , only : ispval
14 | !
15 | ! !PUBLIC TYPES:
16 | implicit none
17 | save
18 | private
19 | !
20 | type, public :: gridcell_type
21 |
22 | ! topological mapping functionality, local 1d gdc arrays
23 | integer , pointer :: gindex (:) ! global index
24 | real(r8), pointer :: area (:) ! total land area, gridcell (km^2)
25 | real(r8), pointer :: lat (:) ! latitude (radians)
26 | real(r8), pointer :: lon (:) ! longitude (radians)
27 | real(r8), pointer :: latdeg (:) ! latitude (degrees)
28 | real(r8), pointer :: londeg (:) ! longitude (degrees)
29 | logical , pointer :: active (:) ! just needed for symmetry with other subgrid types
30 |
31 | ! Daylength
32 | real(r8) , pointer :: max_dayl (:) ! maximum daylength for this grid cell (s)
33 | real(r8) , pointer :: dayl (:) ! daylength (seconds)
34 | real(r8) , pointer :: prev_dayl (:) ! daylength from previous timestep (seconds)
35 |
36 | contains
37 |
38 | procedure, public :: Init
39 | procedure, public :: Clean
40 |
41 | end type gridcell_type
42 | type(gridcell_type), public, target :: grc !gridcell data structure
43 | !------------------------------------------------------------------------
44 |
45 | contains
46 |
47 | !------------------------------------------------------------------------
48 | subroutine Init(this, begg, endg)
49 | !
50 | ! !ARGUMENTS:
51 | class(gridcell_type) :: this
52 | integer, intent(in) :: begg, endg
53 | !------------------------------------------------------------------------
54 |
55 | ! The following is set in InitGridCells
56 | allocate(this%gindex (begg:endg)) ; this%gindex (:) = ispval
57 | allocate(this%area (begg:endg)) ; this%area (:) = nan
58 | allocate(this%lat (begg:endg)) ; this%lat (:) = nan
59 | allocate(this%lon (begg:endg)) ; this%lon (:) = nan
60 | allocate(this%latdeg (begg:endg)) ; this%latdeg (:) = nan
61 | allocate(this%londeg (begg:endg)) ; this%londeg (:) = nan
62 | allocate(this%active (begg:endg)) ; this%active (:) = .true.
63 |
64 | ! This is initiailized in module DayLength
65 | allocate(this%max_dayl (begg:endg)) ; this%max_dayl (:) = nan
66 | allocate(this%dayl (begg:endg)) ; this%dayl (:) = nan
67 | allocate(this%prev_dayl (begg:endg)) ; this%prev_dayl (:) = nan
68 |
69 | end subroutine Init
70 |
71 | !------------------------------------------------------------------------
72 | subroutine Clean(this)
73 | !
74 | ! !ARGUMENTS:
75 | class(gridcell_type) :: this
76 | !------------------------------------------------------------------------
77 |
78 | deallocate(this%gindex )
79 | deallocate(this%area )
80 | deallocate(this%lat )
81 | deallocate(this%lon )
82 | deallocate(this%latdeg )
83 | deallocate(this%londeg )
84 | deallocate(this%active )
85 | deallocate(this%max_dayl )
86 | deallocate(this%dayl )
87 | deallocate(this%prev_dayl )
88 |
89 | end subroutine Clean
90 |
91 | end module GridcellType
92 |
--------------------------------------------------------------------------------
/src/utils/array_utils.F90.in:
--------------------------------------------------------------------------------
1 | module array_utils
2 |
3 | ! ------------------------------------------------------------------------
4 | ! !DESCRIPTION:
5 | ! This module contains routines for working with arrays.
6 | !
7 | ! NOTE(wjs, 2015-10-21) These routines could be moved to csm_share. However, I'm not
8 | ! sure if these routines will stick around for long, since they are just here to work
9 | ! around the fact that we don't specify -Mallocatable=03 with pgi (which in turn is
10 | ! because that flag led to bugs with pgi14).
11 | !
12 | ! !USES:
13 |
14 | use shr_kind_mod, only : r8 => shr_kind_r8, i4=>shr_kind_i4
15 |
16 | implicit none
17 | private
18 | save
19 |
20 | ! Public routines
21 |
22 | public :: transpose_wrapper ! wrap the intrinsic transpose function, first allocating the destination array
23 | public :: pack_wrapper ! wrap the intrinsic pack function, first allocating the destination array
24 |
25 | interface transpose_wrapper
26 | !TYPE int,double
27 | module procedure transpose_wrapper_{TYPE}
28 | end interface transpose_wrapper
29 |
30 | contains
31 |
32 | !-----------------------------------------------------------------------
33 | !TYPE int,double
34 | subroutine transpose_wrapper_{TYPE}(arr_out, arr_in)
35 | !
36 | ! !DESCRIPTION:
37 | ! Wrap the intrinsic transpose function, doing the necessary allocation of the
38 | ! destination array
39 | !
40 | ! NOTE(wjs, 2015-10-21) This is supposed to be handled for you in Fortran2003. Within
41 | ! CESM, it currently appears to be handled for all compilers except pgi: It is
42 | ! handled with intel through the use of '-assume realloc_lhs'. It could be handled
43 | ! with pgi through the use of '-Mallocatable=03', but we currently don't use that
44 | ! flag, because it triggered bugs with pgi14.
45 | !
46 | ! !USES:
47 | !
48 | ! !ARGUMENTS:
49 | {VTYPE}, allocatable, intent(out) :: arr_out(:,:)
50 | {VTYPE}, intent(in) :: arr_in(:,:)
51 | !
52 | ! !LOCAL VARIABLES:
53 | integer :: size1, size2
54 |
55 | character(len=*), parameter :: subname = 'transpose_wrapper_{TYPE}'
56 | !-----------------------------------------------------------------------
57 |
58 | size1 = size(arr_in, 1)
59 | size2 = size(arr_in, 2)
60 | allocate(arr_out(size2, size1))
61 |
62 | arr_out = transpose(arr_in)
63 |
64 | end subroutine transpose_wrapper_{TYPE}
65 |
66 | !-----------------------------------------------------------------------
67 | subroutine pack_wrapper(arr_packed, arr, mask)
68 | !
69 | ! !DESCRIPTION:
70 | ! Wrap the intrinsic pack function, doing the necessary allocation of the destination
71 | ! array.
72 | !
73 | ! NOTE(wjs, 2015-10-21) This is supposed to be handled for you in Fortran2003. Within
74 | ! CESM, it currently appears to be handled for all compilers except pgi: It is
75 | ! handled with intel through the use of '-assume realloc_lhs'. It could be handled
76 | ! with pgi through the use of '-Mallocatable=03', but we currently don't use that
77 | ! flag, because it triggered bugs with pgi14.
78 | !
79 | ! !USES:
80 | !
81 | ! !ARGUMENTS:
82 | real(r8), allocatable, intent(out) :: arr_packed(:)
83 | real(r8), intent(in) :: arr(:)
84 | logical , intent(in) :: mask(:)
85 | !
86 | ! !LOCAL VARIABLES:
87 | integer :: packed_size
88 |
89 | character(len=*), parameter :: subname = 'pack_wrapper'
90 | !-----------------------------------------------------------------------
91 |
92 | packed_size = count(mask)
93 | allocate(arr_packed(packed_size))
94 | arr_packed = pack(arr, mask)
95 |
96 | end subroutine pack_wrapper
97 |
98 | end module array_utils
99 |
100 |
--------------------------------------------------------------------------------
/cime_config/buildlib:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """
4 | build slim ibrary
5 | """
6 | import sys, os, time, filecmp
7 |
8 | _CIMEROOT = os.environ.get("CIMEROOT")
9 | if _CIMEROOT is None:
10 | raise SystemExit("ERROR: must set CIMEROOT environment variable")
11 |
12 | _LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools")
13 | sys.path.append(_LIBDIR)
14 |
15 | from standard_script_setup import *
16 | from CIME.buildlib import parse_input
17 | from CIME.build import get_standard_makefile_args
18 | from CIME.case import Case
19 | from CIME.utils import run_cmd, expect
20 |
21 | logger = logging.getLogger(__name__)
22 |
23 | ###############################################################################
24 | def _main_func():
25 | ###############################################################################
26 |
27 | caseroot, libroot, bldroot = parse_input(sys.argv)
28 |
29 | with Case(caseroot) as case:
30 |
31 | casetools = case.get_value("CASETOOLS")
32 | makefile = os.path.join(casetools, "Makefile")
33 | lnd_root = case.get_value("COMP_ROOT_DIR_LND")
34 | gmake_j = case.get_value("GMAKE_J")
35 | gmake = case.get_value("GMAKE")
36 | gmake_opts = get_standard_makefile_args(case)
37 | driver = case.get_value("COMP_INTERFACE").lower()
38 | nthrds = case.get_value("LND_NTHRDS")
39 |
40 | if nthrds > 1:
41 | expect(
42 | False,
43 | "LND_NTHRDS must be 1 as threading isn't implemented (see issue #14)",
44 | )
45 |
46 | # -------------------------------------------------------
47 | # create Filepath file
48 | #-------------------------------------------------------
49 | compname = case.get_value("COMP_LND")
50 | filepath_file = os.path.join(bldroot,"Filepath")
51 | if not os.path.isfile(filepath_file):
52 | caseroot = case.get_value("CASEROOT")
53 | expect( (compname == "slim"), "Unexpected COMP_LND name: %s" % (compname))
54 | paths = [os.path.join(caseroot,"SourceMods","src."+compname),
55 | os.path.join(lnd_root,"src","cpl",driver),
56 | os.path.join(lnd_root,"src","main"),
57 | os.path.join(lnd_root,"src","init_interp"),
58 | os.path.join(lnd_root,"src","utils"),
59 | os.path.join(lnd_root,"src","cpl")]
60 |
61 | # Paths needed to build the current system, but won't be long term
62 | paths.append(os.path.join(lnd_root, "src", "biogeophys"))
63 | paths.append(os.path.join(lnd_root, "src", "biogeochem"))
64 | paths.append(os.path.join(lnd_root, "src", "soilbiogeochem"))
65 |
66 | with open(filepath_file, "w") as filepath:
67 | filepath.write("\n".join(paths))
68 | filepath.write("\n")
69 |
70 | # -------------------------------------------------------
71 | # create the library in libroot
72 | # -------------------------------------------------------
73 |
74 | complib = os.path.join(libroot, "liblnd.a")
75 | makefile = os.path.join(casetools, "Makefile")
76 |
77 | cmd = "{} complib -j {} COMP_NAME={} COMPLIB={} -f {} {}" \
78 | .format(gmake, gmake_j, compname, complib, makefile, gmake_opts )
79 |
80 | rc, out, err = run_cmd(cmd)
81 | logger.info("%s: \n\n output:\n %s \n\n err:\n\n%s\n" % (cmd, out, err))
82 | expect(rc == 0, "Command %s failed with rc=%s" % (cmd, rc))
83 |
84 |
85 | ###############################################################################
86 |
87 | if __name__ == "__main__":
88 | logger.warning( "WARNING: buildlib is being called as a program rather than a subroutine as " +
89 | "it is expected to be in the CESM context" )
90 | _main_func()
91 |
--------------------------------------------------------------------------------
/src/init_interp/initInterpMultilevelBase.F90:
--------------------------------------------------------------------------------
1 | module initInterpMultilevelBase
2 |
3 | ! ------------------------------------------------------------------------
4 | ! !DESCRIPTION:
5 | ! This module defines a base class for handling multi-level fields
6 | !
7 | ! Usage: For a given variable:
8 | !
9 | ! First call check_npts with the number of destination points, to ensure that this
10 | ! interpolator is appropriate for this variable.
11 | !
12 | ! Then call interp_multilevel once for each destination point
13 | !
14 | ! Note that these interpolators only care about the destination point, not the source
15 | ! point. Any information on the source grid is expected to have already been
16 | ! interpolated to the destination grid. (This is needed for the sake of memory
17 | ! scalability: Information on the source grid is not decomposed across processors, so
18 | ! results in large amounts of memory usage.)
19 | !
20 | ! !USES:
21 |
22 | implicit none
23 | private
24 | save
25 |
26 | ! Public types
27 |
28 | public :: interp_multilevel_type
29 |
30 | type, abstract :: interp_multilevel_type
31 | contains
32 | procedure(check_npts_interface), deferred :: check_npts
33 | procedure(interp_multilevel_interface), deferred :: interp_multilevel
34 | procedure(get_description_interface), deferred :: get_description ! get text description of interpolator
35 | end type interp_multilevel_type
36 |
37 | abstract interface
38 |
39 | subroutine check_npts_interface(this, npts, varname)
40 | ! !DESCRIPTION:
41 | ! Checks the number of destination points, to ensure that this interpolator is
42 | ! appropriate for this variable. This should be called once for each variable.
43 | !
44 | ! Aborts if there is a mismatch.
45 | !
46 | ! !USES:
47 | import:: interp_multilevel_type
48 | !
49 | ! !ARGUMENTS:
50 | class(interp_multilevel_type), intent(in) :: this
51 | integer, intent(in) :: npts ! number of dest points (on this processor)
52 | character(len=*), intent(in) :: varname ! variable name (for diagnostic output)
53 | end subroutine check_npts_interface
54 |
55 | subroutine interp_multilevel_interface(this, &
56 | data_dest, data_source, index_dest)
57 | ! !DESCRIPTION:
58 | ! Interpolates a multi-level field from source to dest, for a single point.
59 | !
60 | ! data_dest and data_source give values for all levels, for one destination or
61 | ! source point. index_dest gives the spatial index (e.g., column index) of the dest
62 | ! point; this is needed for some types of interpolation (to find the appropriate
63 | ! metadata), but is ignored by others. This index should be 1-based (i.e., if the
64 | ! lower bounds in the caller are not 1, they should be adjusted so that the first
65 | ! index is 1).
66 | !
67 | ! !USES:
68 | use shr_kind_mod, only : r8 => shr_kind_r8
69 | import :: interp_multilevel_type
70 | !
71 | ! !ARGUMENTS:
72 | class(interp_multilevel_type), intent(in) :: this
73 | real(r8) , intent(inout) :: data_dest(:)
74 | real(r8) , intent(in) :: data_source(:)
75 | integer , intent(in) :: index_dest
76 | end subroutine interp_multilevel_interface
77 |
78 | pure function get_description_interface(this) result(description)
79 | ! !DESCRIPTION
80 | ! Returns a text description of this interpolator
81 | !
82 | ! !USES:
83 | import :: interp_multilevel_type
84 | !
85 | ! !ARGUMENTS:
86 | character(len=:), allocatable :: description ! function result
87 | class(interp_multilevel_type), intent(in) :: this
88 | end function get_description_interface
89 | end interface
90 |
91 | end module initInterpMultilevelBase
92 |
--------------------------------------------------------------------------------
/src/utils/clm_nlUtilsMod.F90:
--------------------------------------------------------------------------------
1 | module clm_nlUtilsMod
2 | !-----------------------------------------------------------------------
3 | !BOP
4 | !
5 | ! !MODULE: clm_nltUtilsMod
6 | !
7 | ! !DESCRIPTION:
8 | ! Utilities to handle namelists.
9 | !
10 | ! !USES:
11 |
12 | ! !PUBLIC TYPES:
13 | implicit none
14 | save
15 |
16 | private ! By default everything is private
17 |
18 | ! !PUBLIC MEMBER FUNCTIONS:
19 | public :: find_nlgroup_name ! find a specified namelist group in a file
20 | !
21 | ! !REVISION HISTORY:
22 | ! Created by B. Eaton
23 | ! Move to CLM by E. Kluzek
24 | !
25 | ! !PRIVATE MEMBER FUNCTIONS: None
26 | !-----------------------------------------------------------------------
27 | ! !PRIVATE DATA MEMBERS: None
28 |
29 | !EOP
30 | !-----------------------------------------------------------------------
31 | contains
32 |
33 | !-----------------------------------------------------------------------
34 |
35 | !-----------------------------------------------------------------------
36 | !BOP
37 | !
38 | ! !IROUTINE: find_nlgroup_name
39 | !
40 | ! !INTERFACE:
41 | subroutine find_nlgroup_name(unit, group, status)
42 | !
43 | ! !DESCRIPTION:
44 | ! Search a file that contains namelist input for the specified namelist group name.
45 | ! Leave the file positioned so that the current record is the first record of the
46 | ! input for the specified group.
47 | !
48 | ! METHOD:
49 | ! Read the file line by line. Each line is searched for an '&' which may only
50 | ! be preceded by blanks, immediately followed by the group name which is case
51 | ! insensitive. If found then backspace the file so the current record is the
52 | ! one containing the group name and return success. Otherwise return -1.
53 | !
54 | ! !USES:
55 | use shr_kind_mod , only : CS => shr_kind_cs
56 | use shr_string_mod, only : shr_string_toLower
57 | !
58 | ! !ARGUMENTS:
59 | integer, intent(in) :: unit ! fortran unit attached to file
60 | character(len=*), intent(in) :: group ! namelist group name
61 | integer, intent(out) :: status ! 0 for success, -1 if group name not found
62 | !
63 | ! !REVISION HISTORY:
64 | ! Created by B. Eaton, August 2007
65 | ! Move to CLM E. Kluzek, August 2012
66 | !
67 | !
68 | ! !LOCAL VARIABLES:
69 | !EOP
70 | integer :: len_grp ! length of the groupname
71 | integer :: ios ! io status
72 | character(len=CS) :: inrec ! first shr_kind_CS characters of input record
73 | character(len=CS) :: inrec2 ! left adjusted input record
74 | character(len=len(group)) :: lc_group ! lower-case group name
75 | character(len=32) :: subname = 'find_nlgroup_name' ! subroutine name
76 | !-----------------------------------------------------------------------
77 | len_grp = len_trim(group)
78 | lc_group = shr_string_toLower(group)
79 |
80 | ios = 0
81 | do while (ios <= 0)
82 |
83 | read(unit, '(a)', iostat=ios, end=100) inrec
84 |
85 | if (ios <= 0) then ! ios < 0 indicates an end of record condition
86 |
87 | ! look for group name in this record
88 |
89 | ! remove leading blanks
90 | inrec2 = adjustl(inrec)
91 |
92 | ! check for leading '&'
93 | if (inrec2(1:1) == '&') then
94 |
95 | ! check for case insensitive group name
96 | if (trim(lc_group) == shr_string_toLower(inrec2(2:len_grp+1))) then
97 |
98 | ! found group name. backspace to leave file position at this record
99 | backspace(unit)
100 | status = 0
101 | return
102 |
103 | end if
104 | end if
105 | end if
106 |
107 | end do
108 |
109 | 100 continue ! end of file processing
110 | status = -1
111 |
112 | end subroutine find_nlgroup_name
113 |
114 | !-----------------------------------------------------------------------
115 |
116 | end module clm_nlUtilsMod
117 |
--------------------------------------------------------------------------------
/src/main/GetGlobalValuesMod.F90:
--------------------------------------------------------------------------------
1 | module GetGlobalValuesMod
2 |
3 | !-----------------------------------------------------------------------
4 | ! Obtain and Write Global Index information
5 | !-----------------------------------------------------------------------
6 | implicit none
7 | private
8 |
9 | ! PUBLIC MEMBER FUNCTIONS:
10 |
11 | public :: GetGlobalIndex
12 | public :: GetGlobalWrite
13 |
14 | character(len=*), parameter, private :: sourcefile = &
15 | __FILE__
16 | !-----------------------------------------------------------------------
17 |
18 | contains
19 |
20 | !-----------------------------------------------------------------------
21 | integer function GetGlobalIndex(decomp_index, clmlevel)
22 |
23 | !----------------------------------------------------------------
24 | ! Description
25 | ! Determine global index space value for target point at given clmlevel
26 | !
27 | ! Uses:
28 | use shr_log_mod, only: errMsg => shr_log_errMsg
29 | use decompMod , only: bounds_type, get_clmlevel_gsmap, get_proc_bounds
30 | use spmdMod , only: iam
31 | use clm_varcon , only: nameg
32 | use clm_varctl , only: iulog
33 | use mct_mod , only: mct_gsMap, mct_gsMap_orderedPoints
34 | use shr_sys_mod, only: shr_sys_abort
35 | !
36 | ! Arguments
37 | integer , intent(in) :: decomp_index
38 | character(len=*) , intent(in) :: clmlevel
39 | !
40 | ! Local Variables:
41 | type(bounds_type) :: bounds_proc ! processor bounds
42 | type(mct_gsMap),pointer :: gsmap ! global seg map
43 | integer, pointer,dimension(:) :: gsmap_ordered ! gsmap ordered points
44 | integer :: beg_index ! beginning proc index for clmlevel
45 | !----------------------------------------------------------------
46 |
47 | call get_proc_bounds(bounds_proc)
48 |
49 | if (trim(clmlevel) == nameg) then
50 | beg_index = bounds_proc%begg
51 | else
52 | call shr_sys_abort('clmlevel of '//trim(clmlevel)//' not supported' // &
53 | errmsg(sourcefile, __LINE__))
54 | end if
55 |
56 | call get_clmlevel_gsmap(clmlevel=trim(clmlevel), gsmap=gsmap)
57 | call mct_gsMap_orderedPoints(gsmap, iam, gsmap_ordered)
58 | GetGlobalIndex = gsmap_ordered(decomp_index - beg_index + 1)
59 | deallocate(gsmap_ordered)
60 |
61 | end function GetGlobalIndex
62 |
63 | !-----------------------------------------------------------------------
64 | subroutine GetGlobalWrite(decomp_index, clmlevel)
65 |
66 | !-----------------------------------------------------------------------
67 | ! Description:
68 | ! Write global index information for input local indices
69 | !
70 | use shr_sys_mod , only : shr_sys_flush
71 | use shr_sys_mod , only : shr_sys_abort
72 | use shr_log_mod , only : errMsg => shr_log_errMsg
73 | use clm_varctl , only : iulog
74 | use clm_varcon , only : nameg
75 | use GridcellType , only : grc
76 | !
77 | ! Arguments:
78 | integer , intent(in) :: decomp_index
79 | character(len=*) , intent(in) :: clmlevel
80 | !
81 | ! Local Variables:
82 | integer :: igrc
83 | !-----------------------------------------------------------------------
84 |
85 | if (trim(clmlevel) == nameg) then
86 |
87 | igrc = decomp_index
88 | write(iulog,*)'local gridcell index = ',igrc
89 | write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg)
90 | write(iulog,*)'gridcell longitude = ',grc%londeg(igrc)
91 | write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc)
92 |
93 | else
94 | call shr_sys_abort('clmlevel '//trim(clmlevel)//'not supported '//errmsg(sourcefile, __LINE__))
95 |
96 | end if
97 |
98 | call shr_sys_flush(iulog)
99 |
100 | end subroutine GetGlobalWrite
101 |
102 | end module GetGlobalValuesMod
103 |
--------------------------------------------------------------------------------
/src/utils/spmdMod.F90:
--------------------------------------------------------------------------------
1 |
2 | module spmdMod
3 |
4 | !-----------------------------------------------------------------------
5 | !BOP
6 | !
7 | ! !MODULE: spmdMod
8 | !
9 | ! !DESCRIPTION:
10 | ! SPMD initialization
11 | !
12 | ! !REVISION HISTORY:
13 | ! Author: Mariana Vertenstein
14 | !
15 | !EOP
16 | !-----------------------------------------------------------------------
17 |
18 | use shr_kind_mod, only: r8 => shr_kind_r8
19 | use clm_varctl , only: iulog
20 | implicit none
21 |
22 | private
23 |
24 | #include
25 |
26 | save
27 |
28 | ! Default settings valid even if there is no spmd
29 |
30 | logical, public :: masterproc ! proc 0 logical for printing msgs
31 | integer, public :: iam ! processor number
32 | integer, public :: npes ! number of processors for clm
33 | integer, public :: mpicom ! communicator group for clm
34 | integer, public :: comp_id ! component id
35 |
36 | !
37 | ! Public methods
38 | !
39 | public :: spmd_init ! Initialization
40 |
41 | !
42 | ! Values from mpif.h that can be used
43 | !
44 | public :: MPI_INTEGER
45 | public :: MPI_REAL8
46 | public :: MPI_LOGICAL
47 | public :: MPI_SUM
48 | public :: MPI_MIN
49 | public :: MPI_MAX
50 | public :: MPI_LOR
51 | public :: MPI_STATUS_SIZE
52 | public :: MPI_ANY_SOURCE
53 | public :: MPI_CHARACTER
54 | public :: MPI_COMM_WORLD
55 | public :: MPI_MAX_PROCESSOR_NAME
56 |
57 | contains
58 |
59 | !-----------------------------------------------------------------------
60 | !BOP
61 | !
62 | ! !IROUTINE: spmd_init( clm_mpicom )
63 | !
64 | ! !INTERFACE:
65 | subroutine spmd_init( clm_mpicom, LNDID )
66 | !
67 | ! !DESCRIPTION:
68 | ! MPI initialization (number of cpus, processes, tids, etc)
69 | !
70 | ! !USES
71 | !
72 | ! !ARGUMENTS:
73 | implicit none
74 | integer, intent(in) :: clm_mpicom
75 | integer, intent(in) :: LNDID
76 | !
77 | ! !REVISION HISTORY:
78 | ! Author: Mariana Vertenstein
79 | !
80 | !
81 | ! !LOCAL VARIABLES:
82 | !EOP
83 | integer :: i,j ! indices
84 | integer :: ier ! return error status
85 | integer :: mylength ! my processor length
86 | logical :: mpi_running ! temporary
87 | integer, allocatable :: length(:)
88 | integer, allocatable :: displ(:)
89 | character*(MPI_MAX_PROCESSOR_NAME), allocatable :: procname(:)
90 | character*(MPI_MAX_PROCESSOR_NAME) :: myprocname
91 | !-----------------------------------------------------------------------
92 |
93 | ! Initialize mpi communicator group
94 |
95 | mpicom = clm_mpicom
96 |
97 | comp_id = LNDID
98 |
99 | ! Get my processor id
100 |
101 | call mpi_comm_rank(mpicom, iam, ier)
102 | if (iam==0) then
103 | masterproc = .true.
104 | else
105 | masterproc = .false.
106 | end if
107 |
108 | ! Get number of processors
109 |
110 | call mpi_comm_size(mpicom, npes, ier)
111 |
112 | ! Get my processor names
113 |
114 | allocate (length(0:npes-1), displ(0:npes-1), procname(0:npes-1))
115 |
116 | call mpi_get_processor_name (myprocname, mylength, ier)
117 | call mpi_allgather(mylength,1,MPI_INTEGER,length,1,MPI_INTEGER,mpicom,ier)
118 |
119 | do i = 0,npes-1
120 | displ(i)=i*MPI_MAX_PROCESSOR_NAME
121 | end do
122 | call mpi_gatherv (myprocname,mylength,MPI_CHARACTER, &
123 | procname,length,displ,MPI_CHARACTER,0,mpicom,ier)
124 | if (masterproc) then
125 | write(iulog,100)npes
126 | write(iulog,200)
127 | write(iulog,220)
128 | do i=0,npes-1
129 | write(iulog,250)i,(procname((i))(j:j),j=1,length(i))
130 | end do
131 | endif
132 |
133 | deallocate (length, displ, procname)
134 |
135 | 100 format(//,i3," pes participating in computation for CLM")
136 | 200 format(/,35('-'))
137 | 220 format(/,"NODE#",2x,"NAME")
138 | 250 format("(",i5,")",2x,100a1,//)
139 |
140 | end subroutine spmd_init
141 |
142 | end module spmdMod
143 |
--------------------------------------------------------------------------------
/README_EXTERNALS.rst:
--------------------------------------------------------------------------------
1 | Obtaining the full model code and associated scripting infrastructure
2 | =====================================================================
3 |
4 | #. Clone the repository. ::
5 |
6 |
7 | #. Run the script **manage_externals/checkout_externals**. ::
8 |
9 | ./manage_externals/checkout_externals
10 |
11 | The **checkout_externals** script is a package manager that will
12 | populate the directory with the relevant versions of each of the
13 | components along with the CIME infrastructure code.
14 |
15 | At this point you have a working version.
16 |
17 | To see full details of how to set up a case, compile and run, see the CIME documentation at http://esmci.github.io/cime/ .
18 |
19 | More details on checkout_externals
20 | ----------------------------------
21 |
22 | The file **Externals.cfg** in your top-level directory tells
23 | **checkout_externals** which tag/branch of each component should be
24 | brought in to generate your sandbox.
25 |
26 | **You need to rerun checkout_externals whenever Externals.cfg has
27 | changed** (unless you have already manually updated the relevant
28 | external(s) to have the correct branch/tag checked out). Common times
29 | when this is needed are:
30 |
31 | * After checking out a new branch/tag
32 |
33 | * After merging some other branch/tag into your currently
34 | checked-out branch
35 |
36 | **checkout_externals** must be run from the root of the source
37 | tree. For example, if you cloned with::
38 |
39 | git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox
40 |
41 | then you must run **checkout_externals** from
42 | ``/path/to/my_ctsm_sandbox``.
43 |
44 | To see more details of **checkout_externals**, issue ::
45 |
46 | ./manage_externals/checkout_externals --help
47 |
48 | Customizing your sandbox
49 | =============================
50 |
51 | There are several use cases to consider when you want to customize or modify your sandbox.
52 |
53 | Switching to a different branch or tag
54 | -------------------------------------------
55 |
56 | If you have already checked out a branch or tag and **HAVE NOT MADE ANY
57 | MODIFICATIONS** it is simple to change your sandbox. Say that you
58 | checked out ctsm1.0.0 but really wanted to have ctsm1.1.0;
59 | you would simply do the following::
60 |
61 | git checkout ctsm1.1.0
62 | ./manage_externals/checkout_externals
63 |
64 | You should **not** use this method if you have made any source code
65 | changes, or if you have any ongoing cases that were created from
66 | this sandbox. In these cases, it is often easiest to do a second **git
67 | clone**.
68 |
69 | Pointing to a different version of a component
70 | ----------------------------------------------
71 |
72 | Each entry in **Externals.cfg** has the following form (we use CIME as an
73 | example below)::
74 |
75 | [cime]
76 | local_path = cime
77 | protocol = git
78 | repo_url = https://github.com/CESM-Development/cime
79 | tag = cime5.4.0-alpha.20
80 | required = True
81 |
82 | Each entry specifies either a tag or a branch. To point to a new tag:
83 |
84 | #. Modify the relevant entry/entries in **Externals.cfg** (e.g., changing
85 | ``cime5.4.0-alpha.20`` to ``cime5.4.0-alpha.21`` above)
86 |
87 | #. Checkout the new component(s)::
88 |
89 | ./manage_externals/checkout_externals
90 |
91 | Keep in mind that changing individual components from a tag may result
92 | in an invalid model (won't compile, won't run, not scientifically
93 | meaningful) and is unsupported.
94 |
95 | Committing your change to Externals.cfg
96 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97 |
98 | After making this change, it's a good idea to commit the change in your
99 | local git repository. First create a branch in your local
100 | repository, then commit it. (Unlike with subversion, branches are stored
101 | locally unless you explicitly push them up to github. Feel free to
102 | create whatever local branches you'd like.) For example::
103 |
104 | git checkout -b my_ctsm_branch
105 | git add Externals.cfg
106 | git commit -m "Update CIME to cime5.4.0-alpha.20"
107 |
108 |
--------------------------------------------------------------------------------
/manage_externals/test/doc/testing.rst:
--------------------------------------------------------------------------------
1 | Testing
2 | =======
3 |
4 | The manage_externals package has an automated test suite. All pull
5 | requests are expected to pass 100% of the automated tests, as well as
6 | be pep8 and lint 'clean' and maintain approximately constant (at a
7 | minimum) level of code coverage.
8 |
9 | Quick Start
10 | -----------
11 |
12 | Do nothing approach
13 | ~~~~~~~~~~~~~~~~~~~
14 |
15 | When you create a pull request on GitHub, Travis-CI continuous
16 | integration testing will run the test suite in both python2 and
17 | python3. Test results, lint results, and code coverage results are
18 | available online.
19 |
20 | Do something approach
21 | ~~~~~~~~~~~~~~~~~~~~~
22 |
23 | In the test directory, run:
24 |
25 | .. code-block:: shell
26 |
27 | make env
28 | make lint
29 | make test
30 | make coverage
31 |
32 |
33 | Automated Testing
34 | -----------------
35 |
36 | The manage_externals manic library and executables are developed to be
37 | python2 and python3 compatible using only the standard library. The
38 | test suites meet the same requirements. But additional tools are
39 | required to provide lint and code coverage metrics and generate
40 | documentation. The requirements are maintained in the requirements.txt
41 | file, and can be automatically installed into an isolated environment
42 | via Makefile.
43 |
44 | Bootstrap requirements:
45 |
46 | * python2 - version 2.7.x or later
47 |
48 | * python3 - version 3.6 tested other versions may work
49 |
50 | * pip and virtualenv for python2 and python3
51 |
52 | Note: all make rules can be of the form ``make python=pythonX rule``
53 | or ``make rule`` depending if you want to use the default system
54 | python or specify a specific version.
55 |
56 | The Makefile in the test directory has the following rules:
57 |
58 | * ``make python=pythonX env`` - create a python virtual environment
59 | for python2 or python3 and install all required packages. These
60 | packages are required to run lint or coverage.
61 |
62 | * ``make style`` - runs autopep8
63 |
64 | * ``make lint`` - runs autopep8 and pylint
65 |
66 | * ``make test`` - run the full test suite
67 |
68 | * ``make utest`` - run jus the unit tests
69 |
70 | * ``make stest`` - run jus the system integration tests
71 |
72 | * ``make coverage`` - run the full test suite through the code
73 | coverage tool and generate an html report.
74 |
75 | * ``make readme`` - automatically generate the README files.
76 |
77 | * ``make clean`` - remove editor and pyc files
78 |
79 | * ``make clobber`` - remove all generated test files, including
80 | virtual environments, coverage reports, and temporary test
81 | repository directories.
82 |
83 | Unit Tests
84 | ----------
85 |
86 | Unit tests are probably not 'true unit tests' for the pedantic, but
87 | are pragmatic unit tests. They cover small practicle code blocks:
88 | functions, class methods, and groups of functions and class methods.
89 |
90 | System Integration Tests
91 | ------------------------
92 |
93 | NOTE(bja, 2017-11) The systems integration tests currently do not include svn repositories.
94 |
95 | The manage_externals package is extremely tedious and error prone to test manually.
96 |
97 | Combinations that must be tested to ensure basic functionality are:
98 |
99 | * container repository pulling in simple externals
100 |
101 | * container repository pulling in mixed externals with sub-externals.
102 |
103 | * mixed repository acting as a container, pulling in simple externals and sub-externals
104 |
105 | Automatic system tests are handled the same way manual testing is done:
106 |
107 | * clone a test repository
108 |
109 | * create an externals description file for the test
110 |
111 | * run the executable with the desired args
112 |
113 | * check the results
114 |
115 | * potentially modify the repo (checkout a different branch)
116 |
117 | * rerun and test
118 |
119 | * etc
120 |
121 | The automated system stores small test repositories in the main repo
122 | by adding them as bare repositories. These repos are cloned via a
123 | subprocess call to git and manipulated during the tests.
124 |
--------------------------------------------------------------------------------
/tools/modify_input_files/modify_surdat_template.cfg:
--------------------------------------------------------------------------------
1 | [modify_input]
2 |
3 | # ------------------------------------------------------------------------
4 | # .cfg file with inputs for surdat_modifier.
5 | #
6 | # We advise users to make a copy of this file that they can change freely,
7 | # rather than changing this "template" file.
8 | #
9 | # Variables with FILL_THIS_IN must be specified.
10 | # Variables with UNSET may be specified; if not and
11 | # - defaults = False, they will remain unused
12 | # - defaults = True, they will take on default values hardwired in the
13 | # code. Details in comments below.
14 | # Variables with values already set, may be changed to other values. If
15 | # they get omitted, they will obtain the same default values found here.
16 | # ------------------------------------------------------------------------
17 |
18 | # Path and name of input surface dataset (str)
19 | surdat_in = FILL_THIS_IN
20 |
21 | # Path and name of output surface dataset (str)
22 | surdat_out = FILL_THIS_IN
23 |
24 | # defaults (bool)
25 | # When user wants existing values in surdat to persist in all except the
26 | # variables that they explicitly request to change, then set this to False.
27 | # When user wants default representation of the land by resetting all
28 | # surdat variables, some through this file and others by using hardwired
29 | # defaults, then set this to True. Hardwired values are as follows:
30 | # glc_mask = [0] * self.months
31 | # alb_gvd = [0.2] * self.months
32 | # alb_svd = [0.8] * self.months
33 | # alb_gnd = [0.3] * self.months
34 | # alb_snd = [0.6] * self.months
35 | # alb_gvf = [0.2] * self.months
36 | # alb_svf = [0.8] * self.months
37 | # alb_gnf = [0.3] * self.months
38 | # alb_snf = [0.6] * self.months
39 | # bucketdepth = [200] * self.months
40 | # emissivity = [1] * self.months
41 | # snowmask = [50] * self.months
42 | # roughness = [0.1] * self.months
43 | # evap_res = [100] * self.months
44 | # soil_type = [0] * self.months
45 | # soil_tk_1d = [1.5] * self.months
46 | # soil_cv_1d = [2e6] * self.months
47 | # glc_tk_1d = [2.4] * self.months
48 | # glc_cv_1d = [1.9e6] * self.months
49 | defaults = False
50 |
51 | # Boundaries of user-defined rectangle (float)
52 | # If lat_1 > lat_2, the code creates two rectangles, one in the north and
53 | # one in the south.
54 | # If lon_1 > lon_2, the rectangle wraps around the 0-degree meridian.
55 | # Alternatively, user may specify a custom area in a .nc landmask_file
56 | # below. If set, this will override the lat/lon settings.
57 | # -----------------------------------
58 | # southernmost latitude for rectangle
59 | lnd_lat_1 = -90
60 | # northernmost latitude for rectangle
61 | lnd_lat_2 = 90
62 | # westernmost longitude for rectangle
63 | lnd_lon_1 = 0
64 | # easternmost longitude for rectangle
65 | lnd_lon_2 = 360
66 | # User-defined mask in a file, as alternative to setting lat/lon values.
67 | # If set, lat_dimname and lon_dimname should likely also be set. IMPORTANT:
68 | # - lat_dimname and lon_dimname may be left UNSET if they match the expected
69 | # default values 'lsmlat' and 'lsmlon'
70 | landmask_file = UNSET
71 | lat_dimname = UNSET
72 | lon_dimname = UNSET
73 |
74 | # Monthly values over the user-defined mask.
75 | # Space-delimited list of 12 floats or int without brackets
76 | # e.g., glc_mask = 1 1 1 1 1 1 1 1 1 1 1 1
77 | # Any of the variables updated below by the user will be
78 | # updated in the surdat_out file in the user-defined mask.
79 | # if defaults = True and some of the following variables are UNSET, then they
80 | # will default to the corresponding values listed above in the "defaults"
81 | # comments, again only in the user-defined mask.
82 | # if defaults = False and some of the following variables are UNSET, then they
83 | # will remain unchanged from the surdat_in file.
84 | # SOIL_TYPE accepts integer values from ? to ?.
85 | glc_mask = UNSET
86 | alb_gvd = UNSET
87 | alb_svd = UNSET
88 | alb_gnd = UNSET
89 | alb_snd = UNSET
90 | alb_gvf = UNSET
91 | alb_svf = UNSET
92 | alb_gnf = UNSET
93 | alb_snf = UNSET
94 | bucketdepth = UNSET
95 | emissivity = UNSET
96 | snowmask = UNSET
97 | roughness = UNSET
98 | evap_res = UNSET
99 | soil_type = UNSET
100 | soil_tk_1d = UNSET
101 | soil_cv_1d = UNSET
102 | glc_tk_1d = UNSET
103 | glc_cv_1d = UNSET
104 |
--------------------------------------------------------------------------------
/src/init_interp/initInterpBounds.F90:
--------------------------------------------------------------------------------
1 | module initInterpBounds
2 |
3 | ! ------------------------------------------------------------------------
4 | ! !DESCRIPTION:
5 | ! This module defines a class for storing and querying bounds information for initInterp
6 | !
7 | ! !USES:
8 | use shr_log_mod , only : errMsg => shr_log_errMsg
9 | use abortutils , only : endrun
10 |
11 | implicit none
12 | private
13 | save
14 |
15 | ! Public types
16 |
17 | public :: interp_bounds_type
18 |
19 | type :: interp_bounds_type
20 | private
21 | integer :: begg ! beginning gridcell-level index
22 | integer :: endg ! ending gridcell-level index
23 | contains
24 | procedure :: get_begg
25 | procedure :: get_endg
26 | procedure :: get_beg ! get beginning index for a given subgrid level
27 | procedure :: get_end ! get ending index for a given subgrid level
28 | end type interp_bounds_type
29 |
30 | interface interp_bounds_type
31 | module procedure constructor
32 | end interface interp_bounds_type
33 |
34 | character(len=*), parameter, private :: sourcefile = &
35 | __FILE__
36 |
37 | contains
38 |
39 | ! ========================================================================
40 | ! Constructors
41 | ! ========================================================================
42 |
43 | !-----------------------------------------------------------------------
44 | function constructor(begg, endg) result(this)
45 | !
46 | ! !DESCRIPTION:
47 | ! Create an interp_bounds_type instance
48 | !
49 | ! !USES:
50 | !
51 | ! !ARGUMENTS:
52 | type(interp_bounds_type) :: this ! function result
53 | integer, intent(in) :: begg, endg
54 | !
55 | ! !LOCAL VARIABLES:
56 |
57 | character(len=*), parameter :: subname = 'constructor'
58 | !-----------------------------------------------------------------------
59 |
60 | this%begg = begg
61 | this%endg = endg
62 |
63 | end function constructor
64 |
65 | ! ========================================================================
66 | ! Public methods
67 | ! ========================================================================
68 |
69 | integer function get_begg(this)
70 | class(interp_bounds_type), intent(in) :: this
71 | get_begg = this%begg
72 | end function get_begg
73 |
74 | integer function get_endg(this)
75 | class(interp_bounds_type), intent(in) :: this
76 | get_endg = this%endg
77 | end function get_endg
78 |
79 | !-----------------------------------------------------------------------
80 | function get_beg(this, subgrid_level) result(beg_index)
81 | !
82 | ! !DESCRIPTION:
83 | ! Get beginning index for a given subgrid level
84 | !
85 | ! !USES:
86 | !
87 | ! !ARGUMENTS:
88 | integer :: beg_index ! function result
89 | class(interp_bounds_type), intent(in) :: this
90 | character(len=*), intent(in) :: subgrid_level ! 'gridcell'
91 | !
92 | ! !LOCAL VARIABLES:
93 |
94 | character(len=*), parameter :: subname = 'get_beg'
95 | !-----------------------------------------------------------------------
96 |
97 | select case (subgrid_level)
98 | case('gridcell')
99 | beg_index = this%begg
100 | case default
101 | call endrun(msg=subname//' ERROR: Unknown subgrid level: '//trim(subgrid_level)// &
102 | errMsg(sourcefile, __LINE__))
103 | end select
104 |
105 | end function get_beg
106 |
107 | !-----------------------------------------------------------------------
108 | function get_end(this, subgrid_level) result(end_index)
109 | !
110 | ! !DESCRIPTION:
111 | ! Get ending index for a given subgrid level
112 | !
113 | ! !USES:
114 | !
115 | ! !ARGUMENTS:
116 | integer :: end_index ! function result
117 | class(interp_bounds_type), intent(in) :: this
118 | character(len=*), intent(in) :: subgrid_level ! 'gridcell'
119 | !
120 | ! !LOCAL VARIABLES:
121 |
122 | character(len=*), parameter :: subname = 'get_end'
123 | !-----------------------------------------------------------------------
124 |
125 | select case (subgrid_level)
126 | case('gridcell')
127 | end_index = this%endg
128 | case default
129 | call endrun(msg=subname//' ERROR: Unknown subgrid level: '//trim(subgrid_level)// &
130 | errMsg(sourcefile, __LINE__))
131 | end select
132 |
133 | end function get_end
134 |
135 | end module initInterpBounds
136 |
--------------------------------------------------------------------------------
/cime_config/config_compsets.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | =========================================
7 | compset naming convention
8 | =========================================
9 | The compset longname below has the specified order
10 | atm, lnd, ice, ocn, river, glc wave cesm-options
11 |
12 | The notation for the compset longname is
13 | TIME_ATM[%phys]_LND[%phys]_ICE[%phys]_OCN[%phys]_ROF[%phys]_GLC[%phys]_WAV[%phys][_BGC%phys]
14 | Where for the CAM specific compsets below the following is supported
15 | TIME = Time period (e.g. 2000, HIST, RCP8...)
16 | ATM = [CAM40, CAM50, CAM60]
17 | LND = [SLIM, SLND]
18 | ICE = [CICE, CICE5, DICE, SICE]
19 | OCN = [DOCN, ,AQUAP, SOCN]
20 | ROF = [RTM, SROF]
21 | GLC = [SGLC]
22 | WAV = [SWAV]
23 | BGC = optional BGC scenario
24 |
25 | The OPTIONAL %phys attributes specify submodes of the given system
26 | For example DOCN%DOM is the data ocean model for DOCN
27 | ALL the possible %phys choices for each component are listed
28 | with the -list command for create_newcase
29 | ALL data models must have a %phys option that corresponds to the data model mode
30 |
31 | Each compset node is associated with the following elements
32 | - lname
33 | - alias
34 | - science_support (if this compset is supported scientifically with control simulations)
35 |
36 |
37 |
40 |
41 |
42 |
43 | ELT2000ClimoTESTC6I5Slim
44 | 2000_CAM60_SLIM_CICE5_DOCN%SOM_SROF_SGLC_SWAV
45 |
46 |
47 |
48 | ELT2000ClimoTESTC6I6Slim
49 | 2000_CAM60_SLIM_CICE_DOCN%SOM_SROF_SGLC_SWAV
50 |
51 |
52 |
53 |
54 |
55 | ELT1850TESTC6I5Slim
56 | 1850_CAM60_SLIM_CICE5_DOCN%SOM_SROF_SGLC_SWAV
57 |
58 |
59 | ELT1850TESTC6I6Slim
60 | 1850_CAM60_SLIM_CICE_DOCN%SOM_SROF_SGLC_SWAV
61 |
62 |
63 |
64 |
65 | FLT2000ClimoC6I5Slim
66 | 2000_CAM60_SLIM_CICE5%PRES_DOCN%DOM_SROF_SGLC_SWAV
67 |
68 |
69 | FLT2000ClimoC6I6Slim
70 | 2000_CAM60_SLIM_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV
71 |
72 |
73 |
74 |
75 | ELT2000ClimoTESTC5I5Slim
76 | 2000_CAM50_SLIM_CICE5_DOCN%SOM_SROF_SGLC_SWAV
77 |
78 |
79 |
80 |
81 | FLTHISTC5I5Slim
82 | HIST_CAM50_SLIM_CICE5%PRES_DOCN%DOM_SROF_SGLC_SWAV
83 |
84 |
85 |
88 |
89 |
90 |
91 | IHistSlimRsGs
92 | HIST_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV
93 |
94 |
96 |
97 | IHistSlimQianRsGs
98 | HIST_DATM%QIA_SLIM_SICE_SOCN_SROF_SGLC_SWAV
99 |
100 |
101 |
102 | I2000SlimRsGs
103 | 2000_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV
104 |
105 |
106 |
107 |
108 | I1850SlimRsGs
109 | 1850_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV
110 |
111 |
112 |
113 |
114 | I1850SlimCruRsGs
115 | 1850_DATM%CRUv7_SLIM_SICE_SOCN_SROF_SGLC_SWAV
116 |
117 |
118 |
119 |
120 | I1850SlimCplhistRsGs
121 | 1850_DATM%CPLHIST_SLIM_SICE_SOCN_SROF_SGLC_SWAV
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 | 1850-01-01
131 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/py_env_create:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # py_env_create -- setup the python environment in order to use SLIM python tools
4 | #
5 | # Simple bash script to setup the python environment for the user so they can run the SLIM
6 | # python tools using "conda".
7 | #
8 | dir=${0%/*}
9 | if [ "$dir" = "$0" ];then
10 | dir="."
11 | fi
12 |
13 | # Check if conda is in your path
14 | conda --help >& condahelp.txt
15 | error=$?
16 | if [ $error != 0 ]; then
17 | echo "conda is NOT in your path for the bash shell add it with modules or whatever is required on your system to get it in your path"
18 | echo "on cheyenne/capser/etc use -- module load conda"
19 | echo "on izumi/CGD systems use -- module load lang/python"
20 | echo "For notes on installing on a user system see: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html"
21 | echo "Error code was $error"
22 | cat condahelp.txt
23 | exit -1
24 | fi
25 | rm condahelp.txt
26 | python_env=slim_pylib
27 |
28 |
29 | condadir="$dir/python"
30 |
31 | domain=`domainname`
32 | if [[ $domain =~ cgd.* ]]; then
33 | condafile="conda_env_slim_py_cgd.txt"
34 | else
35 | condafile="conda_env_slim_py.txt"
36 | fi
37 | #----------------------------------------------------------------------
38 | # Usage subroutine
39 | usage() {
40 | echo ""
41 | echo "***********************************************************************"
42 | echo "usage:"
43 | echo "./py_env_create"
44 | echo ""
45 | echo "valid arguments: "
46 | echo "[-h|--help] "
47 | echo " Displays this help message"
48 | echo "[-v|--verbose] "
49 | echo " Run with verbose mode for the install so you see the progress bar"
50 | echo "[-f|--file ] "
51 | echo " Conda environment file to use (can be a text format or YAML format)"
52 | echo " Assumed to be under the directory: $condadir"
53 | echo " Default is: $condafile"
54 | echo "[--option