11---
22title : " Configuration"
3- teaching : 0
4- exercises : 0
3+ teaching : 10
4+ exercises : 10
55questions :
66- What is the user configuration file and how should I use it?
77
@@ -20,42 +20,36 @@ keypoints:
2020## The configuration file
2121
2222The `` config-user.yml `` configuration file contains all the global level
23- information needed by ESMValTool to run. This is an [ YAML
24- file] ( https://yaml.org/spec/1.2/spec.html ) . An example configuration file can be
25- found in the root directory of the ESMValTool repository:
26- [ config-user-example.yml] ( https://github.com/ESMValGroup/ESMValTool /blob/master/config-user-example .yml ) .
23+ information needed by ESMValTool to run.
24+ This is a [ YAML file] ( https://yaml.org/spec/1.2/spec.html ) .
25+ An example configuration file can be found in the ESMValCore repository:
26+ [ config-user-example.yml] ( https://github.com/ESMValGroup/ESMValCore /blob/master/esmvalcore/ config-user.yml ) .
2727
28- First, we make a working directory `` esmvaltool_tutorial `` .
29- In a new terminal, run:
28+ You can generate the default configuration file by running:
3029
3130~~~ bash
32- mkdir esmvaltool_tutorial
33- cd esmvaltool_tutorial
31+ esmvaltool config get_config_user
3432~~~
3533
36- Now, we download the configuration file to our working directory. To do that,
37- click on [ this
38- link] ( https://raw.githubusercontent.com/ESMValGroup/ESMValTool/master/config-user-example.yml )
39- to see a raw version of the file, right-click and press `` save as `` , then you
40- can rename it to `` config-user.yml `` and save it into the working directory
41- `` esmvaltool_tutorial `` .
34+ It will save the file to: ` ~/.esmvaltool/config-user.yml ` , where ` ~ ` is the
35+ path to your home directory. Note that files and directories starting with a
36+ period are "hidden", to see the ` .esmvaltool ` directory in the terminal use
37+ ` ls -la ~ ` .
4238
43- Now, let's change our working directory in a terminal window to
44- `` esmvaltool_tutorial `` . Then, we run a text editor called Nano to have a look
45- inside the configuration file:
39+ We run a text editor called `` nano `` to have a look inside the configuration file:
4640
4741~~~ bash
48- nano config-user.yml
42+ nano ~ /.esmvaltool/ config-user.yml
4943~~~
5044
5145This file contains the information for:
5246
53- - Rootpath to input data
54- - Directory structure for the data from different projects
55- - Number of tasks that can be run in parallel
47+ - Output settings
5648- Destination directory
5749- Auxiliary data directory
58- - Output settings
50+ - Number of tasks that can be run in parallel
51+ - Rootpath to input data
52+ - Directory structure for the data from different projects
5953
6054> ## Text editor side note
6155>
@@ -67,94 +61,48 @@ This file contains the information for:
6761> and then <kbd >ctrl</kbd > + <kbd >X</kbd > to exit `` nano `` .
6862 {: .callout}
6963
70- ## Rootpath to input data
71-
72- ESMValTool uses several categories (in ESMValTool, this is referred to as projects)
73- for input data based on their source. The current categories in the configuration
74- file are mentioned below. For example, CMIP is used for a dataset from
75- the climate model intercomparison project whereas OBS is used for an observational dataset.
76- We can find more information about the projects in the ESMValTool
77- [ documentation] ( https://docs.esmvaltool.org/en/latest/input.html ) .
78- The `` rootpath `` specifies the directories where ESMValTool will look for input data.
79- For each category, you can define either one path or several paths as a list.
80-
81- ``` yaml
82- rootpath :
83- CMIP3 : [~/cmip3_inputpath1, ~/cmip3_inputpath2]
84- CMIP5 : [~/cmip5_inputpath1, ~/cmip5_inputpath2]
85- CMIP6 : [~/cmip6_inputpath1, ~/cmip6_inputpath2]
86- OBS : ~/obs_inputpath
87- OBS6 : ~/obs6_inputpath
88- obs4mips : ~/obs4mips_inputpath
89- ana4mips : ~/ana4mips_inputpath
90- native6 : ~/native6_inputpath
91- RAWOBS : ~/rawobs_inputpath
92- default : ~/default_inputpath
93- ` ` `
94-
95- In this lesson, we will work with data from
96- [CMIP5](https://esgf-node.llnl.gov/projects/cmip5/).
97- We add the root path of the folder where our/your data is available.
98-
99- ` ` ` yaml
100- rootpath :
101- ...
102- CMIP5 : [~/cmip5_inputpath1, ~/cmip5_inputpath2, ~/esmvaltool_tutorial/data]
103- ` ` `
104-
105- > ## Setting the correct rootpath
106- >
107- > - To get the data (or its correct rootpath), check instruction in [Setup]({{
108- > page.root }}{% link setup.md %}).
109- > - For more information about setting the rootpath, see also the ESMValTool
110- > [documentation](https://esmvaltool.readthedocs.io/projects/esmvalcore/en/latest/esmvalcore/datafinder.html).
111- {: .callout}
112-
113- ## Directory structure for the data from different projects
64+ ## Output settings
11465
115- Input data can be from various models, observations and reanalysis data that
116- adhere to the [CF/CMOR standard](https://cmor.llnl.gov/). The ` ` drs` ` setting
117- describes the file structure. Let's use ` ` default` ` for ` ` CMIP5` ` in our example
118- here:
66+ These settings are used to inform ESMValTool about your preference about
67+ specific actions. You can turn on or off the setting by `` true `` or `` false ``
68+ values. Most of these settings are fairly self-explanatory, ie:
11969
12070``` yaml
121- drs :
122- CMIP5 : default
123- ` ` `
124-
125- > ## Available drs
126- >
127- > The ` ` drs` ` setting describes the file structure for several projects (e.g.
128- > ` ` CMIP6` ` , ` ` CMIP5` ` , ` ` obs4mips` ` , ` ` OBS6` ` , ` ` OBS` ` ) on several key machines
129- > (e.g. ` ` BADC` ` , ` ` CP4CDS` ` , ` ` DKRZ` ` , ` ` ETHZ` ` , ` ` SMHI` ` , ` ` BSC` ` ). For more
130- > information about ` ` drs` ` , you can visit the ESMValTool
131- > [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/quickstart/find_data.html#cmor-drs).
132- {: .callout}
71+ # Diagnostics create plots? [true]/false
72+ write_plots : true
73+ # Diagnositcs write NetCDF files? [true]/false
74+ write_netcdf : true
75+ # Set the console log level debug, [info], warning, error
76+ log_level : info
77+ # Exit on warning (only for NCL diagnostic scripts)? true/[false]
78+ exit_on_warning : false
79+ # Plot file format? [png]/pdf/ps/eps/epsi
80+ output_file_type : png
13381
134- ## Number of parallel tasks
82+ ...
13583
136- This option enables you to perform parallel processing.
137- You can choose the number of tasks in parallel as
138- 1/2/3/4/... or you can set it to ` ` null` ` . That tells
139- ESMValTool to use the maximum number of available CPUs:
84+ # Use netCDF compression true/[false]
85+ compress_netcdf : false
86+ # Save intermediary cubes in the preprocessor true/[false]
87+ save_intermediary_cubes : false
88+ # Remove the preproc dir if all fine
89+ remove_preproc_dir : true
14090
141- ` ` ` yaml
91+ ...
14292
143- max_parallel_tasks : null
93+ # Path to custom config-developer file, to customise project configurations.
94+ # See config-developer.yml for an example. Set to [null] to use the default
95+ config_developer_file : null
96+ # Get profiling information for diagnostics
97+ # Only available for Python diagnostics
98+ profile_diagnostic : false
14499` ` `
145100
146- > ## Set the number of tasks
147- >
148- > If you run out of memory, try setting ` ` max_parallel_tasks` ` to 1.
149- Then, check the amount of memory you need for that by inspecting
150- the file ` ` run/resource_usage.txt` ` in the output directory.
151- Using the number there you can increase the number of parallel tasks
152- again to a reasonable number for the amount of memory available in your system.
153- {: .callout}
101+ In general there is no need to change the settings listed above.
154102
155103## Destination directory
156104
157- The destination directory is the rootpath where ESMValTool will store its output,
105+ The destination directory is the rootpath where ESMValTool will store its output folders containing
158106i.e. figures, data, logs, etc. With every run, ESMValTool automatically generates
159107a new output folder determined by recipe name, and date and time using
160108the format: YYYYMMDD_HHMMSS.
@@ -195,55 +143,109 @@ on.
195143auxiliary_data_dir : ~/auxiliary_data
196144` ` `
197145
198- ## Output settings
146+ ## Number of parallel tasks
199147
200- These settings are used to inform ESMValTool about your preference about
201- specific actions. You can turn on or off the setting by ` ` true` ` or ` ` false` `
202- values. Most of these settings are fairly self-explanatory, ie:
148+ This option enables you to perform parallel processing.
149+ You can choose the number of tasks in parallel as
150+ 1/2/3/4/... or you can set it to ` ` null` ` . That tells
151+ ESMValTool to use the maximum number of available CPUs:
203152
204153` ` ` yaml
205- # Diagnostics create plots? [true]/false
206- write_plots : true
207- # Diagnositcs write NetCDF files? [true]/false
208- write_netcdf : true
209- # Set the console log level debug, [info], warning, error
210- log_level : info
211- # Exit on warning (only for NCL diagnostic scripts)? true/[false]
212- exit_on_warning : false
213- # Plot file format? [png]/pdf/ps/eps/epsi
214- output_file_type : png
215- # Use netCDF compression true/[false]
216- compress_netcdf : false
217- # Save intermediary cubes in the preprocessor true/[false]
218- save_intermediary_cubes : false
219- # Remove the preproc dir if all fine
220- remove_preproc_dir : true
221- # Path to custom config-developer file, to customise project configurations.
222- # See config-developer.yml for an example. Set to [null] to use the default
223- # config_developer_file: null
224- # Get profiling information for diagnostics
225- # Only available for Python diagnostics
226- profile_diagnostic : false
154+
155+ max_parallel_tasks : null
156+ ` ` `
157+
158+ > ## Set the number of tasks
159+ >
160+ > If you run out of memory, try setting ` ` max_parallel_tasks` ` to 1.
161+ Then, check the amount of memory you need for that by inspecting
162+ the file ` ` run/resource_usage.txt` ` in the output directory.
163+ Using the number there you can increase the number of parallel tasks
164+ again to a reasonable number for the amount of memory available in your system.
165+ {: .callout}
166+
167+
168+ ## Rootpath to input data
169+
170+ ESMValTool uses several categories (in ESMValTool, this is referred to as projects)
171+ for input data based on their source. The current categories in the configuration
172+ file are mentioned below. For example, CMIP is used for a dataset from
173+ the climate model intercomparison project whereas OBS is used for an observational dataset.
174+ We can find more information about the projects in the ESMValTool
175+ [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/quickstart/find_data.html).
176+ The ` ` rootpath` ` specifies the directories where ESMValTool will look for input data.
177+ For each category, you can define either one path or several paths as a list.
178+
179+ ` ` ` yaml
180+ rootpath :
181+ CMIP5 : [~/cmip5_inputpath1, ~/cmip5_inputpath2]
182+ OBS : ~/obs_inputpath
183+ RAWOBS : ~/rawobs_inputpath
184+ default : ~/default_inputpath
185+ CORDEX : ~/default_inputpath
227186` ` `
187+ Site-specific entries for Jasmin, DKRZ and ETHZ are listed at the end of the
188+ example configuration file.
189+
190+ In this lesson, we will work with data from
191+ [CMIP5](https://esgf-node.llnl.gov/projects/cmip5/).
192+ We add the root path of the folder where our/your data is available.
193+
194+ ` ` ` yaml
195+ rootpath :
196+ ...
197+ CMIP5 : [~/cmip5_inputpath1, ~/cmip5_inputpath2, ~/esmvaltool_tutorial/data]
198+ ` ` `
199+
200+ > ## Setting the correct rootpath
201+ >
202+ > - To get the data (or its correct rootpath), check instruction in
203+ > [Setup]({{ page.root }}{% link setup.md %}).
204+ > - For more information about setting the rootpath, see also the ESMValTool
205+ > [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/esmvalcore/datafinder.html).
206+ {: .callout}
207+
208+ ## Directory structure for the data from different projects
209+
210+ Input data can be from various models, observations and reanalysis data that
211+ adhere to the [CF/CMOR standard](https://cmor.llnl.gov/). The ` ` drs` ` setting
212+ describes the file structure. Let's use ` ` default` ` for ` ` CMIP5` ` in our example
213+ here:
214+
215+ ` ` ` yaml
216+ drs :
217+ CMIP5 : default
218+ ` ` `
219+
220+ > ## Available drs
221+ >
222+ > The ` ` drs` ` setting describes the file structure for several projects (e.g.
223+ > ` ` CMIP6` ` , ` ` CMIP5` ` , ` ` obs4mips` ` , ` ` OBS6` ` , ` ` OBS` ` ) on several key machines
224+ > (e.g. ` ` BADC` ` , ` ` CP4CDS` ` , ` ` DKRZ` ` , ` ` ETHZ` ` , ` ` SMHI` ` , ` ` BSC` ` ). For more
225+ > information about ` ` drs` ` , you can visit the ESMValTool
226+ > [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/quickstart/find_data.html#cmor-drs).
227+ {: .callout}
228228
229229> ## Make your own configuration file
230230>
231231> It is possible to have several configuration files with different purposes,
232- > for example: config-user_formalised_runs.yml, config-user_debugging.yml {:
233- > .callout}
234- >
232+ > for example: config-user_formalised_runs.yml, config-user_debugging.yml
233+ {: .callout}
234+
235235> ## Saving preprocessed data
236236>
237237> In the configuration file, which settings are useful to make sure preprocessed
238238> data is stored when ESMValTool is run?
239239>
240240>> ## Solution
241241>>
242- > > If the option ` ` save_intermediary_cubes` ` is set to true in the
243- > > config-user.yml file, then the intermediary cubes will also be saved in the
244- > > folder ` ` preproc` ` . Also, if the option ` ` remove_preproc_dir` ` is set to
245- > > ` ` false` ` , then the ` ` preproc/` ` directory contains all the preprocessed
246- > > data and the metadata interface files.
242+ > > If the option ` ` remove_preproc_dir` ` is set to ` ` false` ` , then the
243+ > > ` ` preproc/` ` directory contains all the pre-processed data and the
244+ > > metadata interface files.
245+ > > If the option ` ` save_intermediary_cubes` ` is set to ` ` true` `
246+ > > then data will also be saved after each preprocessor step in the folder
247+ > > ` ` preproc` ` . Note that saving all intermediate results to file will result
248+ > > in a considerable slowdown.
247249> {: .solution}
248250{: .challenge}
249251
0 commit comments