climo (Developer Reference)
Implementation
Python module:
zppy/climo.pyJinja2 template:
zppy/templates/climo.bash
The climo function in climo.py iterates over all [climo]
tasks defined in the configuration file and generates a SLURM bash script
from the climo.bash Jinja2 template for each year-range/subsection
combination.
Key steps in climo.py:
Load the
climo.bashtemplate viainitialize_template().Call
get_tasks(config, "climo")to retrieve all[climo]subsection configurations.For each task:
Call
set_mapping_file(),set_grid(),set_component_and_prc_typ()to resolve path and component inference.Construct the output filename prefix. For EAMxx, the subsection-level
caseis used as the stream ID soncclimocan locate input files.Render the template and write the bash script.
Submit the script via
submit_script(), registering it with any bundle if requested.
Template variables
The climo.bash template receives all configuration parameters as Jinja2
variables. Key template variables:
{{ case }},{{ input }},{{ output }}— from[default]{{ mapping_file }},{{ grid }}— resolved byset_mapping_file()andset_grid(){{ vars }}— variables to process (empty = all){{ parallel }}— ncclimo parallel mode (default:mpi){{ nodes }}— number of nodes (default: 4){{ environment_commands }}— environment setup