@@ -75,7 +75,7 @@ with common errors as they occur throughout the development.
7575Remember the basic structure of a recipe, and notice that each of them is
7676extensively described in the documentation under the header
7777 [ "The recipe
78- format"] ( https://docs.esmvaltool.org/projects/esmvalcore/en/latest/ recipe/ overview.html ) {: target ="_ blank"}:
78+ format"] [ recipe- overview ] {: target ="_ blank"}:
7979
8080- [ documentation] (https://docs.esmvaltool.org/projects/esmvalcore/en/latest/
8181recipe/overview.html#recipe-section-documentation){: target ="_ blank"}
@@ -276,6 +276,26 @@ us to reuse this dataset entry with different variable names later on.
276276This is not really necessary for our simple use case, but it is common practice
277277in ESMValTool.
278278
279+
280+ > ## Pro-tip: Automatically populating a recipe with all available datasets
281+ >
282+ > You can select all available models for processing using
283+ > ` glob ` patterns or wildcards. An example ` datasets ` section that uses all
284+ > available CMIP6 models and ensemble members for the ` historical ` experiment
285+ > will look like this:
286+ > ``` yaml ```
287+ > datasets:
288+ > - project: CMIP6
289+ > exp: historical
290+ > dataset: '* '
291+ > institute: '* '
292+ > ensemble: '* '
293+ > grid: '* '
294+ > Note that you will have to set the ` search_esgf ` option in the `config_file to
295+ > ` always ` so that you can download data from ESGF nodes as needed.
296+ {: .callout}
297+
298+
279299## Adding the preprocessor section
280300
281301Above, we already described the preprocessing task that needs to convert the
@@ -311,7 +331,8 @@ esmvalcore.preprocessor.html#preprocessor-functions):
311331> {: .solution}
312332 {: .challenge}
313333
314- Add the following block to your recipe file:
334+ Add the following block to your recipe file between the ` datasets ` and ` diagnostics `
335+ block:
315336
316337``` yaml
317338preprocessors :
@@ -332,8 +353,8 @@ preprocessors:
332353
333354## Completing the diagnostics section
334355
335- Now we are ready to finish our diagnostics section. Remember that we want to
336- make two tasks: a preprocessor task, and a diagnostic task. To illustrate that
356+ We are now ready to finish our diagnostics section. Remember that we want to
357+ create two tasks: a preprocessor task, and a diagnostic task. To illustrate that
337358we can also pass settings to the diagnostic script, we add the option to specify
338359a custom colormap.
339360
@@ -374,30 +395,64 @@ a custom colormap.
374395> {: .solution}
375396{: .challenge}
376397
377- Now you should be able to run the recipe to get your own warming stripes.
398+ You should now be able to run the recipe to get your own warming stripes.
378399
379400Note : for the purpose of simplicity in this episode, we have not added logging
380401or provenance tracking in the diagnostic script. Once you start to develop your
381402own diagnostic scripts and want to add them to the ESMValTool repositories, this
382- will be required. However, writing your own diagnostic script is beyond the
383- scope of the basic tutorial .
403+ will be required. Writing your own diagnostic script is discussed in a
404+ [later episode]({{ page.root }}{% link _episodes/08-diagnostics.md %}) .
384405
385406# # Bonus exercises
386407
387- Below are a couple of exercise to practice modifying the recipe. For your
408+ Below are a few exercises to practice modifying an ESMValTool recipe. For your
388409reference, here's a copy of the [recipe at this
389410point](../files/recipe_warming_stripes.yml). This will be the point of departure
390411for each of the modifications we'll make below.
391412
392- > # # Specific location
413+ > # # Multiple ensemble members
414+ >
415+ > You can choose data from multiple ensemble members for a model in a single line
416+ >
417+ >> # # Solution
418+ >>
419+ >> The `dataset` section allows you to choose more than one ensemble member
420+ >> Here's a copy of the changed
421+ >> [recipe](../files/recipe_warming_stripes_multiple_ensemble_members.yml)
422+ >>to do that.
423+ >> Changes made are shown in the diff output below:
424+ >>
425+ >> --- recipe_warming_stripes.yml
426+ >> +++ recipe_warming_stripes_multiple_ensemble_members.yml
427+ >> @@ -8,7 +8,7 @@
428+ >> - righi_mattia
429+ >>
430+ >> datasets:
431+ >> - - {dataset: BCC-ESM1, project: CMIP6, mip: Amon, exp: historical, ensemble: r1i1p1f1, grid: gn, start_year: 1850, end_year: 2014}
432+ >> + - {dataset: BCC-ESM1, project: CMIP6, mip: Amon, exp: historical, ensemble: "r(1:2)i1p1f1", grid: gn, start_year: 1850, end_year: 2014}
433+ >>
434+ >> preprocessors:
435+ >> global_anomalies:
436+ >>
437+ >>
438+ >> Pro-tip: Check out the section on a different way to use multiple ensemble
439+ >> members or even multiple experiments at
440+ >> [Concatenating data corresponding to multiple facets][datasets-overview].
441+ >>
442+ > {: .solution}
443+ {:.challenge}
444+
445+
446+ > # # Specific location selection
393447>
394- > On showyourstripes.org, you can download stripes for specific locations. We
395- > will reproduce this possibility. Look at the available preprocessors in the
396- > documentation, and replace the global mean with a suitable alternative.
448+ > On showyourstripes.org, you can download stripes for specific locations. Here we
449+ > show how this can be done with ESMValTool.
450+ > Instead of the global mean, we can pick a location to plot the stripes for.
451+ > Can you find a suitable preprocessor to do this?
397452>
398453> > # # Solution
399454> >
400- > > You could have used `extract_point` or `extract_region`. We used
455+ > > You can use `extract_point` or `extract_region` to select a location . We used
401456> > `extract_point`. Here's a copy of the [recipe at this
402457> > point](../files/recipe_warming_stripes_local.yml) and this is the difference
403458> > from the previous recipe:
@@ -576,3 +631,5 @@ for each of the modifications we'll make below.
576631> >
577632> {: .solution}
578633{:.challenge}
634+
635+ {% include links.md %}
0 commit comments