22title : " Configuration"
33teaching : 10
44exercises : 10
5- compatibility : ESMValTool v2.10 .0
5+ compatibility : ESMValTool v2.12 .0
66
77questions :
88- What is the user configuration file and how should I use it?
@@ -22,7 +22,7 @@ keypoints:
2222
2323## The configuration file
2424
25- For the purposes of this tutorial, we will create a directory in our home directory
25+ First, for the purposes of this tutorial, we will create a directory in our home directory
2626called ` esmvaltool_tutorial ` and use that as our working directory. The following steps
2727should do that:
2828
@@ -38,29 +38,32 @@ This is a [YAML file](https://yaml.org/spec/1.2/spec.html).
3838You can get the default configuration file by running:
3939
4040~~~ bash
41- esmvaltool config get_config_user --path= < target_dir >
41+ esmvaltool config get_config_user
4242~~~
43- The default configuration file will be downloaded to the directory specified with
44- the ` --path ` variable. For instance, you can provide the path to your working directory
45- as the ` target_dir ` . If this option is not used, the file will be saved to the default
46- location: ` ~/.esmvaltool/config-user.yml ` , where ` ~ ` is the
43+ The default configuration file will be downloaded to the default location:
44+ ` ~/.config/esmvaltool/config-user.yml ` , where ` ~ ` is the
4745path to your home directory. Note that files and directories starting with a
48- period are "hidden", to see the ` .esmvaltool ` directory in the terminal use
49- ` ls -la ~ ` . Note that if a configuration file by that name already exists in the default
46+ period are "hidden", to see the ` .config ` directory in the terminal use
47+ ` ls -la ~ ` .
48+ With the optional `` --path=<target_dir> `` you can specifiy the directory
49+ in which the configuration file can be saved. For instance, you can provide
50+ the path to your working directory as the ` target_dir ` .
51+ Note, if a configuration file by that name already exists in the default
5052location, the ` get_config_user ` command will not update the file as ESMValTool will not
5153overwrite the file. You will have to move the file first if you want an updated copy of the
52- user configuration file.
54+ default user configuration file.
5355
5456
5557
5658We run a text editor called `` nano `` to have a look inside the configuration file
5759and then modify it if needed:
5860
5961~~~ bash
60- nano ~ /.esmvaltool/config-user.yml
62+ nano ~ /.config/ esmvaltool/config-user.yml
6163~~~
6264
63- Any other editor can be used, e.g.vim.
65+ If `` nano `` does not work on your system, or if you prefer a different editor,
66+ any other editor can be used, e.g. `` vim `` .
6467
6568This file contains the information for:
6669
@@ -120,7 +123,7 @@ using the format: YYYYMMDD_HHMMSS.
120123
121124> ## Set the destination directory
122125>
123- > Let's name our destination directory `` esmvaltool_output `` in the working directory.
126+ > Let's name our destination directory `` esmvaltool_output `` in the current directory.
124127> ESMValTool should write the output to this path, so make sure you have the disk space
125128> to write output to this directory.
126129> How do we set this in the ` config-user.yml ` ?
@@ -172,7 +175,7 @@ rootpath:
172175 default: ~/climate_data
173176` ` `
174177These are typically available in the default configuration file you downloaded, so simply
175- removing the machine specific lines should be sufficient to access input data.
178+ uncommenting the machine specific lines should be sufficient to access input data.
176179
177180> # # Set the correct rootpath
178181>
@@ -228,23 +231,21 @@ removing the machine specific lines should be sufficient to access input data.
228231>>```
229232>>
230233>> - For more information about setting the rootpath, see also the ESMValTool
231- >> [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/
232- quickstart/find_data.html).
234+ >> [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/
235+ latest/ quickstart/find_data.html).
233236> {: .solution}
234237{: .challenge}
235238
236239# # Directory structure for the data from different projects
237240
238241Input data can be from various models, observations and reanalysis data that
239- adhere to the [CF/CMOR standard](https://cmor.llnl.gov/). The ``drs`` setting
240- describes the file structure.
241-
242+ adhere to the [CF/CMOR standard](https://cmor.llnl.gov/).
242243The ``drs`` setting describes the file structure for several projects (e.g.
243244CMIP6, CMIP5, obs4mips, OBS6, OBS) on several key machines
244245(e.g. BADC, CP4CDS, DKRZ, ETHZ, SMHI, BSC). For more
245246information about ``drs``, you can visit the ESMValTool documentation on
246- [Data Reference Syntax (DRS)](https://docs.esmvaltool.org/projects/esmvalcore /
247- en/latest/quickstart/find_data.html#cmor -drs).
247+ [Data Reference Syntax (DRS)](https://docs.esmvaltool.org/projects/ESMValCore /
248+ en/latest/quickstart/find_data.html#explaining -drs-cmip5-or-drs-cmip6 ).
248249
249250> # # Set the correct drs
250251>
@@ -293,24 +294,15 @@ en/latest/quickstart/find_data.html#cmor-drs).
293294
294295> # # Explain the default drs (if working on local machine)
295296>
296- > 1. In the previous exercise, we set the `drs` of CMIP5 data to `default`.
297+ > In the previous exercise, we set the `drs` of CMIP5 data to `default`.
297298> Can you explain why?
298- > 2. Have a look at the directory structure of the `OBS` data.
299- > There is a folder called `Tier1`. What does it mean?
300299>
301300>> # # Solution
302301>>
303- >> 1. `drs: default` is one way to retrieve data from a ROOT directory that has
302+ >> `drs: default` is one way to retrieve data from a ROOT directory that has
304303>> no DRS-like structure. ``default`` indicates that all the files are in a
305304>> folder without any structure.
306305>>
307- >> 2. Observational data are organized in Tiers depending on their level of
308- >> public availability. Therefore the default directory must be structured
309- >> accordingly with sub-directories `TierX` e.g. Tier1, Tier2 or Tier3, even
310- >> when `drs: default`. More details can be found in the
311- [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/
312- quickstart/find_data.html#observational-data).
313- >>
314306> {: .solution}
315307{: .challenge}
316308
@@ -329,8 +321,8 @@ if you want to feed some additional data (e.g. shape files) to your recipe.
329321> auxiliary_data_dir: ~/auxiliary_data
330322> ```
331323> See more information in ESMValTool
332- [document ](https://docs.esmvaltool.org/projects/ESMValCore/en/latest/quickstart
333- /configure.html?highlight=auxiliary_data#user- configuration-file ).
324+ [documentation ](https://docs.esmvaltool.org/projects/ESMValCore/en/latest/
325+ > quickstart /configure.html?highlight=auxiliary_data#top-level- configuration-options ).
334326{: .callout}
335327
336328> # # Number of parallel tasks
@@ -353,12 +345,18 @@ amount of memory available in your system.
353345
354346> # # Make your own configuration file
355347>
356- > It is possible to have several configuration files with different purposes,
357- > for example: config-user_formalised_runs.yml, config-user_debugging.yml.
358- > In this case, you have to pass the path of your own configuration file
359- > as a command-line option when running the ESMValTool.
348+ > Configuration files could live in the user configuration directory, which is
349+ > by default ``~/.config/esmvaltool``. The directory could be also specified
350+ > via the command line argument ``--config_dir``.
360351> We will learn how to do this in the
361352> [next lesson]({{ page.root }}{% link _episodes/04-recipe.md %}).
353+ >
354+ > It is possible to have several configuration files with different purposes,
355+ > for example: config-user_formalised_runs.yml, config-user_debugging.yml.
356+ > In this case, ESMValTool searches for all YAML files within each of the
357+ > configuration directories and merges them together. How this is done is
358+ > explained [here](https://docs.esmvaltool.org/projects/ESMValCore/en/
359+ > latest/quickstart/configure.html#yaml-files).
362360{: .callout}
363361
364362{% include links.md %}
0 commit comments