esm_environment package

Top-level package for ESM Environment.


esm_environment.esm_environment module

Main module for EsmEnvironment.

class esm_environment.esm_environment.EnvironmentInfos(run_or_compile, complete_config=None, model=None)[source]

Bases: object

static add_commands(commands, name)[source]

Writes all commands in a list to a file named <name>, located in the current working directory. The header from this script is read from, also in the current working directory.

  • commands (list of str) – List of the commands to write to the file after the header
  • name (str) – Name of the script, generally something like comp_echam-6.3.05

name + “”

Return type:



Adds the ENVIRONMENT_SET_BY_ESMTOOLS=TRUE to the config, for later dumping to the shell script.

apply_config_changes(run_or_compile, config, model)[source]
apply_model_changes(model, run_or_compile='runtime', modelconfig=None)[source]
static cleanup_dummy_script()[source]

Removes the if it exists.


Gathers module actions and export variables from the config to a list, prepending appropriate shell command words (e.g. module and export)

Return type:list

Replaces any instances of ${model_dir} in the config section “export_vars” with the argument

Parameters:model_dir (str) – The replacement string for ${model_dir}

Writes a dummy script containing only the header information, module commands, and export variables. The actual compile/configure commands are added later.

Parameters:include_set_e (bool) – Default to True, whether or not to include a set -e at the beginning of the script. This causes the shell to stop as soon as an error is encountered.
class esm_environment.esm_environment.environment_infos(*args, **kwargs)[source]

Bases: esm_environment.esm_environment.EnvironmentInfos