CESM Research Tools: CLM4 in CESM1.0.4 User's Guide Documentation | ||
---|---|---|
Prev | Appendix A. Editing Template Files Before Configure | Next |
The steps to adding a new DATM_MODE
Add a new "if" block to the DATM template
As you can see from the Section called Outline of the DATM template above there are major "if" blocks for the different DATM_MODE's. So adding a new DATM_MODE means adding a new "if" block. The two major parts of each DATM_MODE block are:
Setup datm_atm_in namelist |
Setup options to build_streams |
In the "if" block create the datm_atm_in namelist
See the Section called Customizing the DATM Namelist and Streams files in Chapter 1 for some notes about the DATM namelist and streams files. That and the DATM User's Guide should give you guidance on how to setup the namelist for your case.
In the "if" block create options to and call build_streams
The next part of the "if" block in the DATM template file to work with is the call to build_streams. You may need to add additional options to it. You may also need to call it multiple times for multiple streams. You will also likely need to add a new source option to it with the "-s" option. For more information on build_streams do the following.
Example A-1. Getting help with build_streams for DATM
> scripts/ccsm_utils/Tools/build_streams -help |
The output of the above command is:
SYNOPSIS build_streams [options] REQUIRED OPTIONS: -datasource "source" [or -s] Use given data source type. AND Either -model "name" [or -m] Give the model type name (cice datm dlnd dice docn) and \ use the appropriate model template file. use the template file named (../../../../../scripts/ccsm_utils/Tools/../Components/ \ name.template.streams.xml) Or -template "filename" [or -t] Full pathname to the input streams template file to use. OPTIONS THAT MAY BE REQUIRED (depending on input template and datasource) -case "casename" [or -c] Replace any template case indicators (%c see below) with this \ casename. -domain "filename" [or -do] Use given domain filename for domain (required when template uses %do). -dompath "directory" [or -dp] Use given domain filepath for domain files. (required when template uses %dp). -filepath "directory" [or -p] Full path to where datafiles are (required when template uses \ %p). (Default use path in template file relative to -csmdata \ option) -res "resolution" [or -r] Resolution for filenames if source in template is resolution \ dependent. -yearfirst "year" [or -b] The first year to cycle input datasets over. (required input if input template has year-month indicators \ (%y or %ym) ) -yearlast "year" [or -e] The last year to cycle input datasets over. (required input if input template has year-month indicators \ (%y or %ym) ) OPTIONS -csmdata "directory" Give input ccsm inputdata directory. (replaces %d used in \ template) (default $DIN_LOC_ROOT) -fexists Check that the domain and filenames indicated by the output \ streams file actually exist. -filenames "file_or_indicator" Use input fileNames string for filenames. (Replace following strings appropriately: ) %c = Case (from above -case command line option) %do = Use domain file %y = Year (through range given from begyear to endyear) \ %ym = Year-Month (all 12 months through year range) %6ym = Like %ym but 6 digit year (ie. YYYYYY-MM). (can replace the 6 with any digit 1-9) -help [or -h] Print this usage of build_streams to STDERR. -lastmonth Include the last month of the previous year for %ym. -outfile "filename" [or -o] Output streams file to create. (default send to stdout) -verbose [or -v] Turns on verbose printing mode. |
Add new streams templates to the DATM datm.template.streams.xml file
As part of modifying the behavior of build_streams you will also have to edit the models/atm/datm7/bld/datm.template.streams.xml file as well (or the local version in your $CASENAME/Tools/Templates directory for a particular case). The template is an XML file much like the output streams file, but there are attributes to distinguish which fields will be used based on things like: RESOLUTION or datasource. And there are filename indicators (starting with a "%") that get translated into various things such as:
%c = Case (from above -case command line option) %do = Use domain file %y = Year (through range given from begyear to endyear) %ym = Year-Month (all 12 months through year range) %6ym = Like %ym but 6 digit year (ie. %YYYYYY-MM). (can replace the 6 with any digit 1-9) |
Add a new valid_value to the config_definition.xml file in scripts.
Adding a new DATM_MODE also requires adding a new valid_value to scripts/ccsm_utils/Case.template/config_definition.xml. This enables the scripts to recognize the new value as a valid option to DATM_MODE in the env_conf.xml file.