Skip to content

Commit d5c7606

Browse files
committed
adapt episode 3 to new CLI
1 parent c64553d commit d5c7606

File tree

1 file changed

+113
-119
lines changed

1 file changed

+113
-119
lines changed

_episodes/03-configuration.md

Lines changed: 113 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,17 @@ keypoints:
2222
The ``config-user.yml`` configuration file contains all the global level
2323
information needed by ESMValTool to run. This is an [YAML
2424
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).
27-
28-
First, we make a working directory ``esmvaltool_tutorial``.
29-
In a new terminal, run:
25+
found in the ESMValCore repository:
26+
[config-user-example.yml](https://github.com/ESMValGroup/ESMValCore/blob/master/esmvalcore/config-user.yml). You could download it by typing:
3027

3128
~~~bash
32-
mkdir esmvaltool_tutorial
33-
cd esmvaltool_tutorial
29+
esmvaltool config get_config_user
3430
~~~
3531

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``.
32+
It will save the file to: ``{HOME}/.esmvaltool/config-user.yml``.
4233

4334
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
35+
``{HOME}/.esmvaltool``. Then, we run a text editor called Nano to have a look
4536
inside the configuration file:
4637

4738
~~~bash
@@ -50,12 +41,12 @@ inside the configuration file:
5041

5142
This file contains the information for:
5243

53-
- Rootpath to input data
54-
- Directory structure for the data from different projects
55-
- Number of tasks that can be run in parallel
44+
- Output settings
5645
- Destination directory
5746
- Auxiliary data directory
58-
- Output settings
47+
- Number of tasks that can be run in parallel
48+
- Rootpath to input data
49+
- Directory structure for the data from different projects
5950

6051
> ## Text editor side note
6152
>
@@ -67,6 +58,108 @@ This file contains the information for:
6758
> and then <kbd>ctrl</kbd> + <kbd>X</kbd> to exit ``nano``.
6859
{: .callout}
6960

61+
## Output settings
62+
63+
These settings are used to inform ESMValTool about your preference about
64+
specific actions. You can turn on or off the setting by ``true`` or ``false``
65+
values. Most of these settings are fairly self-explanatory, ie:
66+
67+
```yaml
68+
# Diagnostics create plots? [true]/false
69+
write_plots: true
70+
# Diagnositcs write NetCDF files? [true]/false
71+
write_netcdf: true
72+
# Set the console log level debug, [info], warning, error
73+
log_level: info
74+
# Exit on warning (only for NCL diagnostic scripts)? true/[false]
75+
exit_on_warning: false
76+
# Plot file format? [png]/pdf/ps/eps/epsi
77+
output_file_type: png
78+
79+
...
80+
81+
# Use netCDF compression true/[false]
82+
compress_netcdf: false
83+
# Save intermediary cubes in the preprocessor true/[false]
84+
save_intermediary_cubes: false
85+
# Remove the preproc dir if all fine
86+
remove_preproc_dir: true
87+
88+
...
89+
90+
# Path to custom config-developer file, to customise project configurations.
91+
# See config-developer.yml for an example. Set to [null] to use the default
92+
config_developer_file: null
93+
# Get profiling information for diagnostics
94+
# Only available for Python diagnostics
95+
profile_diagnostic: false
96+
```
97+
98+
## Destination directory
99+
100+
The destination directory is the rootpath where ESMValTool will store its output,
101+
i.e. figures, data, logs, etc. With every run, ESMValTool automatically generates
102+
a new output folder determined by recipe name, and date and time using
103+
the format: YYYYMMDD_HHMMSS.
104+
This folder contains four further subfolders: ``plots``, ``preproc``, ``run``, ``work``.
105+
106+
Let's name our destination directory ``esmvaltool_output`` in the working directory:
107+
108+
```yaml
109+
output_dir: ./esmvaltool_output
110+
```
111+
112+
> ## Content of subfolders
113+
>
114+
> - ``plots``: the location for all plots, split by individual diagnostics and fields.
115+
> - ``preproc``: this folder contains all the preprocessed data and metadata.yml
116+
interface files. Note that by default this directory will be deleted after
117+
each run because most users will only need the results from the diagnostic scripts.
118+
> - ``run``: this folder includes all log files, a copy of the recipe,
119+
a summary of the resource usage, and the settings.yml interface files,
120+
resource_usage.txt and temporary files created by the diagnostic scripts.
121+
> - ``work``: this folder is a place for any diagnostic script results that
122+
are not plots, e.g. files in NetCDF format (depends on the diagnostic script).
123+
>
124+
> We explain more about output in the next
125+
[lesson]({{ page.root }}{% link _episodes/04-recipe.md %})
126+
{: .callout}
127+
128+
## Auxiliary data directory
129+
130+
The ``auxiliary_data_dir`` setting is the path where any required additional
131+
auxiliary data files are stored. This location allows us to tell the diagnostic
132+
script where to find the files if they can not be downloaded at runtime. This
133+
option should not be used for model or observational datasets, but for data
134+
files (e.g. shape files) used in plotting such as coastline descriptions and so
135+
on.
136+
137+
```yaml
138+
auxiliary_data_dir: ~/auxiliary_data
139+
```
140+
141+
## Number of parallel tasks
142+
143+
This option enables you to perform parallel processing.
144+
You can choose the number of tasks in parallel as
145+
1/2/3/4/... or you can set it to ``null``. That tells
146+
ESMValTool to use the maximum number of available CPUs:
147+
148+
```yaml
149+
150+
max_parallel_tasks: null
151+
```
152+
153+
> ## Set the number of tasks
154+
>
155+
> If you run out of memory, try setting ``max_parallel_tasks`` to 1.
156+
Then, check the amount of memory you need for that by inspecting
157+
the file ``run/resource_usage.txt`` in the output directory.
158+
Using the number there you can increase the number of parallel tasks
159+
again to a reasonable number for the amount of memory available in your system.
160+
{: .callout}
161+
162+
70163
## Rootpath to input data
71164
72165
ESMValTool uses several categories (in ESMValTool, this is referred to as projects)
@@ -80,17 +173,13 @@ For each category, you can define either one path or several paths as a list.
80173
81174
```yaml
82175
rootpath:
83-
CMIP3: [~/cmip3_inputpath1, ~/cmip3_inputpath2]
84176
CMIP5: [~/cmip5_inputpath1, ~/cmip5_inputpath2]
85-
CMIP6: [~/cmip6_inputpath1, ~/cmip6_inputpath2]
86177
OBS: ~/obs_inputpath
87-
OBS6: ~/obs6_inputpath
88-
obs4mips: ~/obs4mips_inputpath
89-
ana4mips: ~/ana4mips_inputpath
90-
native6: ~/native6_inputpath
91178
RAWOBS: ~/rawobs_inputpath
92179
default: ~/default_inputpath
180+
CORDEX: ~/default_inputpath
93181
```
182+
Site-specific entries for Jasmin, DKRZ and ETHZ are listed at the end of the example configuration file.
94183
95184
In this lesson, we will work with data from
96185
[CMIP5](https://esgf-node.llnl.gov/projects/cmip5/).
@@ -131,101 +220,6 @@ drs:
131220
> [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/quickstart/find_data.html#cmor-drs).
132221
{: .callout}
133222
134-
## Number of parallel tasks
135-
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:
140-
141-
```yaml
142-
143-
max_parallel_tasks: null
144-
```
145-
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}
154-
155-
## Destination directory
156-
157-
The destination directory is the rootpath where ESMValTool will store its output,
158-
i.e. figures, data, logs, etc. With every run, ESMValTool automatically generates
159-
a new output folder determined by recipe name, and date and time using
160-
the format: YYYYMMDD_HHMMSS.
161-
This folder contains four further subfolders: ``plots``, ``preproc``, ``run``, ``work``.
162-
163-
Let's name our destination directory ``esmvaltool_output`` in the working directory:
164-
165-
```yaml
166-
output_dir: ./esmvaltool_output
167-
```
168-
169-
> ## Content of subfolders
170-
>
171-
> - ``plots``: the location for all plots, split by individual diagnostics and fields.
172-
> - ``preproc``: this folder contains all the preprocessed data and metadata.yml
173-
interface files. Note that by default this directory will be deleted after
174-
each run because most users will only need the results from the diagnostic scripts.
175-
> - ``run``: this folder includes all log files, a copy of the recipe,
176-
a summary of the resource usage, and the settings.yml interface files,
177-
resource_usage.txt and temporary files created by the diagnostic scripts.
178-
> - ``work``: this folder is a place for any diagnostic script results that
179-
are not plots, e.g. files in NetCDF format (depends on the diagnostic script).
180-
>
181-
> We explain more about output in the next
182-
[lesson]({{ page.root }}{% link _episodes/04-recipe.md %})
183-
{: .callout}
184-
185-
## Auxiliary data directory
186-
187-
The ``auxiliary_data_dir`` setting is the path where any required additional
188-
auxiliary data files are stored. This location allows us to tell the diagnostic
189-
script where to find the files if they can not be downloaded at runtime. This
190-
option should not be used for model or observational datasets, but for data
191-
files (e.g. shape files) used in plotting such as coastline descriptions and so
192-
on.
193-
194-
```yaml
195-
auxiliary_data_dir: ~/auxiliary_data
196-
```
197-
198-
## Output settings
199-
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:
203-
204-
```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
227-
```
228-
229223
> ## Make your own configuration file
230224
>
231225
> It is possible to have several configuration files with different purposes,

0 commit comments

Comments
 (0)