Skip to content

Commit 6fb4f99

Browse files
Refactor episode 4 and 5 (#154)
* Start refactoring episode 4 * Complete rewrite of episode 4; move explanation of output folders from episode 3 to 4 * Add new content to episode 5 * Add python diagnostic for episode 5 * Remove old stuff * Add (modified) recipe files; remove old ones * Apply suggestions from code review Co-authored-by: Stef Smeets <[email protected]> * Finish rewrite of episode 5 * resolve merge conflict * Finetune episode 4 * Update config episode to set different roothpaths and max_parallel_tasks * Fix solution boxes in episode 5 * update setup instructions and dataset urls * update link to example recipe documentation * Apply suggestions from code review Co-authored-by: Stef Smeets <[email protected]> * Fix issues with modified recipes * Trying to update gh workflow to run all recipes * Revert "Trying to update gh workflow to run all recipes" This reverts commit ea6ab3c. * Second attempt on gh workflow to run all recipes * Add indentation * Make sure gh action finds diagnostic script Co-authored-by: Stef Smeets <[email protected]>
1 parent 52558f2 commit 6fb4f99

26 files changed

+1256
-1655
lines changed

.github/workflows/recipes.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ jobs:
4141
with:
4242
path: ~/default_inputpath
4343
key: ${{ runner.os }}-datasets-${{ env.CACHE_NUMBER }}-${{ hashFiles('data/dataset.urls') }}
44-
- name: Download dataset files for files/recipe_example.yml
44+
- name: Download dataset files for episodes 4 and 5
4545
run: |
4646
head -4 data/dataset.urls | grep -v '#' | wget --input-file - --no-clobber --directory-prefix $HOME/default_inputpath/
47-
- name: Run files/recipe_example.yml
48-
run: $CONDA/envs/test/bin/esmvaltool run $PWD/files/recipe_example.yml
47+
- name: Run all recipes in files/
48+
run: |
49+
mkdir ~/esmvaltool_tutorial
50+
cp files/warming_stripes.py ~/esmvaltool_tutorial/
51+
for file in files/recipe*.yml; do $CONDA/envs/test/bin/esmvaltool run $PWD/$file; done

_episodes/03-configuration.md

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,6 @@ The destination directory is the rootpath where ESMValTool will store its output
9393
e.g. figures, data, logs, etc. With every run, ESMValTool automatically generates
9494
a new output folder determined by recipe name, and date and time using
9595
the format: YYYYMMDD_HHMMSS.
96-
This folder contains four further subfolders: ``plots``, ``preproc``, ``run``, ``work``.
97-
98-
> ## Content of subfolders
99-
>
100-
> - ``plots``: the location for all plots, split by individual diagnostics and fields.
101-
> - ``preproc``: this folder contains all the preprocessed data and metadata.yml
102-
interface files. Note that by default this directory will be deleted after
103-
each run because most users will only need the results from the diagnostic scripts.
104-
> - ``run``: this folder includes all log files, a copy of the recipe,
105-
a summary of the resource usage, and the settings.yml interface files,
106-
resource_usage.txt and temporary files created by the diagnostic scripts.
107-
> - ``work``: this folder is a place for any diagnostic script results that
108-
are not plots, e.g. files in NetCDF format (depends on the diagnostic script).
109-
>
110-
> We explain more about output in the next
111-
[lesson]({{ page.root }}{% link _episodes/04-recipe.md %})
112-
{: .callout}
11396

11497
> ## Set the destination directory
11598
>
@@ -156,7 +139,7 @@ example configuration file.
156139
>
157140
> In this tutorial, we will work with data from
158141
> [CMIP5](https://esgf-node.llnl.gov/projects/cmip5/)
159-
> and [obs4mips](https://esgf-node.llnl.gov/projects/obs4mips/).
142+
> and [CMIP6](https://esgf-node.llnl.gov/projects/cmip6).
160143
> How can we moodify the `rootpath` to make sure the data path is set correctly
161144
> for both CMIP5 and obs4mips.
162145
>
@@ -173,7 +156,7 @@ example configuration file.
173156
>> rootpath:
174157
>> ...
175158
>> CMIP5: ~/esmvaltool_tutorial/data
176-
>> obs4mips: ~/esmvaltool_tutorial/data
159+
>> CMIP6: ~/esmvaltool_tutorial/data
177160
>>```
178161
>>
179162
>> - Are you working with on a computer cluster like Jasmin or DKRZ?
@@ -184,12 +167,12 @@ example configuration file.
184167
>> # Site-specific entries: Jasmin
185168
>> # Uncomment the lines below to locate data on JASMIN
186169
>> rootpath:
187-
>> # CMIP6: /badc/cmip6/data/CMIP6
170+
>> CMIP6: /badc/cmip6/data/CMIP6
188171
>> CMIP5: /badc/cmip5/data/cmip5/output1
189172
>> # CMIP3: /badc/cmip3_drs/data/cmip3/output
190173
>> # OBS: /group_workspaces/jasmin4/esmeval/obsdata-v2
191174
>> # OBS6: /group_workspaces/jasmin4/esmeval/obsdata-v2
192-
>> obs4mips: /group_workspaces/jasmin4/esmeval/obsdata-v2
175+
>> # obs4mips: /group_workspaces/jasmin4/esmeval/obsdata-v2
193176
>> # ana4mips: /group_workspaces/jasmin4/esmeval/obsdata-v2
194177
>> # CORDEX: /badc/cordex/data/CORDEX/output
195178
>>```
@@ -260,12 +243,14 @@ information about ``drs``, you can visit the ESMValTool documentation on
260243
>
261244
>> ## Solution
262245
>>
263-
>> 1. `drs: default` is one way to retrieve data from a ROOT directory that has no DRS-like structure.
264-
>> ``default`` indicates that all the files are in a folder without any structure.
246+
>> 1. `drs: default` is one way to retrieve data from a ROOT directory that has
247+
>> no DRS-like structure. ``default`` indicates that all the files are in a
248+
>> folder without any structure.
265249
>>
266-
>> 2. Observational data are organized in Tiers depending on their level of public availability.
267-
>> Therefore the default directory must be structured accordingly with sub-directories
268-
>> `TierX` e.g. Tier1, Tier2 or Tier3, even when `drs: default`.
250+
>> 2. Observational data are organized in Tiers depending on their level of
251+
>> public availability. Therefore the default directory must be structured
252+
>> accordingly with sub-directories `TierX` e.g. Tier1, Tier2 or Tier3, even
253+
>> when `drs: default`.
269254
>>
270255
> {: .solution}
271256
{: .challenge}
@@ -290,21 +275,20 @@ if you want to feed some additional data (e.g. shape files) to your recipe.
290275
291276
> ## Number of parallel tasks
292277
>
293-
> This option enables you to perform parallel processing.
294-
You can choose the number of tasks in parallel as
295-
1/2/3/4/... or you can set it to ``null``. That tells
296-
ESMValTool to use the maximum number of available CPUs:
278+
> This option enables you to perform parallel processing. You can choose the
279+
number of tasks in parallel as 1/2/3/4/... or you can set it to ``null``. That
280+
tells ESMValTool to use the maximum number of available CPUs. For the purpose of
281+
the tutorial, please set ESMValTool use only 1 cpu:
297282
>
298283
>```yaml
299-
> max_parallel_tasks: null
284+
> max_parallel_tasks: 1
300285
> ```
301286
>
302-
> If you run out of memory, try setting ``max_parallel_tasks`` to 1.
303-
Then, check the amount of memory you need for that by inspecting
304-
the file ``run/resource_usage.txt`` in the output directory.
305-
Using the number there you can increase the number of parallel tasks
306-
again to a reasonable number for the amount of memory available in your system.
307-
{: .callout}
287+
> In general, if you run out of memory, try setting ``max_parallel_tasks`` to 1.
288+
Then, check the amount of memory you need for that by inspecting the file
289+
``run/resource_usage.txt`` in the output directory. Using the number there you
290+
can increase the number of parallel tasks again to a reasonable number for the
291+
amount of memory available in your system. {: .callout}
308292
309293
> ## Make your own configuration file
310294
>

0 commit comments

Comments
 (0)