Setting up a Case
Configuration
After creating a case, some aspects of the configuration are fixed (any variables in env_case.xml
). But many can be changed before calling case.setup
, which generates the files required to build and run the case. CIME provides xmlquery
to view and xmlchange
to modify the variables used in this process.
Querying
CIME provides the xmlquery
command to view the configuration of a case. The configuration is a collection of variables stored in XML files. These variables are grouped together when defined in the model’s configuration.
The following will list all of the current configuration.
./xmlquery --listall
To view a specific group, replace <group>
with the desired group name.
./xmlquery --subgroup <group> --listall
Modifying
The xmlchange
command is used to modify the configuration of a case. The following will change the value of a variable.
./xmlchange <variable>=<value>
Some variables can exist in multiple groups. To change a variable in a specific group, use the --subgroup
option.
./xmlchange JOB_WALLCLOCK_TIME=0:30 --subgroup case.run
Setting up the Case
Once all the configuration is done, it’s time to call case.setup
from $CASEROOT
. This will generate the files required to build and run the case.
Warning
If xmlchange
is called after case.setup
, the changes will not be reflected in the generated files. To update the files, call case.setup --reset
.
Tracking changes with Git
When you set up a case, a new Git repository will be created within the $CASEROOT
directory if a recent version of Git is installed. The repository will have a branch named after the case.
Warning
If you are using a version of Git older than 2.28, the repository will not be created automatically. In this case, you can create a repository manually and push the case to it.
Each time you run case.setup
, case.build
, case.submit
, or xmlchange
, a new commit is created. This allows you to track changes to the case over time.
If you set the CASE_GIT_REPOSITORY
variable to a valid Git repository URL, the case will be pushed to that repository.
./xmlchange CASE_GIT_REPOSITORY=<repository>
Note
To disable this feature, call case.setup --disable-git
.
Generated files
The following files and directories are generated in $CASEROOT
:
.case.run |
A (hidden) file with the commands that will be used to run the model (such as “mpirun”) and any batch directives needed. The directive values are generated using the contents of env_mach_pes.xml. Running |
.env_mach_specific.* |
Files summarizing the module load commands and environment variables that are set when the scripts in |
CaseDocs/ |
Directory that contains all the component namelists for the run. This is for reference only and files in this directory SHOULD NOT BE EDITED since they will be overwritten at build time and runtime. |
CaseStatus |
File containing a list of operations done in the current case. |
Depends.* |
Lists of source code files that need special build options. |
Macros.cmake |
File containing machine-specific makefile directives for your target platform/compiler. This file is created if it does not already exist. The user can modify the file to change certain aspects of the build, such as compiler flags. Running |
case.st_archive |
Script to perform short-term archiving to disk for your case output. Note that this script is run automatically by the normal CIME workflow. |
cmake_macros/ |
Directory containing any CMake macros required for the machine/compiler combination. |
user_nl_xxx[_NNNN] |
Files where all user modifications to component namelists are made. xxx is any one of the set of components targeted for the case. For example, for a full active CESM compset, xxx is cam, clm, or rtm, and so on. NNNN goes from 0001 to the number of instances of that component. (See multiple instances) For a case with 1 instance of each component (default), NNNN will not appear in the user_nl file names. A user_nl file of a given name is created only once. Calling |
software_environment.txt |
This file records some aspects of the computing system on which the case is built, such as the shell environment. |