Skip to content

Commit a5d5b6b

Browse files
author
BenMGeo
committed
update current edits
1 parent e797318 commit a5d5b6b

File tree

1 file changed

+80
-56
lines changed

1 file changed

+80
-56
lines changed

_episodes/first_example_recipe.md

Lines changed: 80 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
File name : first_example_recipe.md
2+
Episode 4.
3+
14
---
25
title: "Running a recipe (First example)"
36
teaching: 10
@@ -8,42 +11,50 @@ questions:
811
- "What are the files and directories after running a recipe?"
912
- "What happens when I run a recipe?"
1013
objectives:
11-
- "Run an ESMValTool recipe"
14+
- "Run an ESMValTool recipe
1215
- "Understand the purpose of different settings in the recipe"
1316
- "Inspect the output directories"
1417
- "Examine the log information"
1518
keypoints:
1619
- "A recipe does not break by fiddling with it"
17-
- "Log information is useful to How to interpret the first warnings/errors"
20+
- "Log information is useful when interpreting the first warnings/errors"
1821
- "The dataset section in the recipe relates to Understanding the directory structure of CMIP data on your server/disk and knowing how to use data from different experiments such as CMIP/ScenarioMIP."
1922
---
2023

2124
This episode describes how ESMValTool recipes work, how to run a recipe and how to explore the recipe output. By the end of this episode, you should be able to run your first recipe, look at the recipe output, modify a recipe, explore and run some basic recipe debugging.
2225

2326
## Introduction to Recipes
2427

25-
Recipes are the instructions that you give to ESMValTool that tell it what you want to do. This includes four main section:
26-
- datasets: what datasets you want to use
28+
Recipes are the instructions that you give to ESMValTool that tell it what you want to do. This includes four main sections: datasets, preprocessors, diagnostics and description.
29+
30+
- datasets: what datasets you want to use, including
2731
- the time range and time resolution,
2832
- the MIP, ensemble member,
29-
- the experiment (ie historical, ssp125 etc...)
30-
- the grid type (CMIP6 only)
31-
- This section can also be optional, as datasets can no preprocessing is needed.
33+
- the experiment (i.e. historical, ssp125 etc...),
34+
- and the grid type (CMIP6 only)
35+
36+
This section can also be optional, as datasets can no preprocessing is needed.
37+
38+
- preprocessors: general operations applied to a dataset before handling it in a diagnostic, listing
39+
- which preprocessor modules to apply,
40+
- the order to apply them,
41+
- and the preprocessor arguments.
42+
43+
This section can also be optional, if no preprocessing is needed.
3244

33-
- proprocessors: one or preprocessors
34-
- which preprocessor modules to apply
35-
- the order to apply them
36-
- and the preprocesor arguments.
37-
- This section can also be optional, if no preprocessing is needed.
45+
- diagnostics: all the information about the diagnostic, including
46+
- list of variables to evaluate (with their respective configurations),
47+
- the desired diagnostic script to use,
48+
- and additional diagnostic script options or arguments, if needed.
3849

39-
- diagnostics: All the information about diagnostic
40-
-
50+
Also Include additional datasets beyond those included in the datasets section mentioned above, for instance variable specific observational data.
4151

42-
- description: a brief description of the recipe
43-
- who wrote the recipe, and who maintains it
44-
- which project is responsible for it
45-
- which publications, reference are linked with the recipe
46-
- Note that the authors, publications and references and named in the config-references.yml
52+
- description: a brief description of the recipe, including
53+
- who wrote the recipe and who maintains it,
54+
- which project is responsible for it,
55+
- and which publications, references are linked with the recipe.
56+
57+
Note that the authors, publications and references are to be named in the config-references.yml
4758

4859
This information
4960

@@ -53,6 +64,7 @@ Once you’ve set up your conda environment and installed ESMValTool (See episod
5364
~~~
5465
esmvaltool -c configuration recipe
5566
~~~
67+
{: .source}
5668

5769
To try your hand with a basic recipe, please work through this episode.
5870

@@ -70,8 +82,8 @@ Please copy and paste the following recipe into your ESMValTool working area wit
7082

7183
authors:
7284
- demora_lee
73-
- Ben
74-
- Ranjini
85+
- mueller_benjamin
86+
- swaminathan_ranjini
7587

7688
maintainer:
7789
- demora_lee
@@ -83,44 +95,35 @@ Please copy and paste the following recipe into your ESMValTool working area wit
8395
projects:
8496
- ukesm
8597

98+
datasets:
99+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005, }
86100

87101
preprocessors:
88-
# --------------------------------------------------
89-
# Time series preprocessors
90-
# --------------------------------------------------
91-
prep_timeseries: # For 0D fields
92-
multi_model_statistics:
93-
span: full
94-
statistics: [mean ]
95-
102+
prep_timeseries: # For 0D fields
103+
annual_statistics:
104+
operator: mean
96105

97106
diagnostics:
98107
# --------------------------------------------------
99108
# Time series diagnostics
100109
# --------------------------------------------------
101110
diag_timeseries_temperature:
102111
variables:
103-
thetaoga:
104-
preprocessor: prep_timeseries
105-
additional_datasets:
106-
- {dataset: CESM1-BGC, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
107-
- {dataset: CNRM-CM5, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
108-
- {dataset: CSIRO-Mk3-6-0, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
109-
- {dataset: CanESM2, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
110-
- {dataset: GFDL-ESM2M, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1861, end_year: 2005, }
111-
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005, }
112-
- {dataset: IPSL-CM5A-LR, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
113-
- {dataset: MIROC-ESM, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
114-
- {dataset: MPI-ESM-LR, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
115-
- {dataset: NorESM1-M, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
112+
timeseries_variable:
113+
short_name: thetaoga
114+
preprocessor: prep_timeseries
116115
scripts:
117116
timeseries_diag:
118117
script: ocean/diagnostic_timeseries.py
119118

119+
120120
> ## Explore the recipe
121121
>
122122
> Use the command and investigate the sample recipe.
123+
> ~~~
123124
> vim recipe.yml
125+
> ~~~
126+
> {: .source}
124127
>
125128
> Please note the datasets, preprocessors, diagnostic sections.
126129
> What is the short_name of the variable being analysed?
@@ -136,23 +139,24 @@ Please copy and paste the following recipe into your ESMValTool working area wit
136139
> ## Running ESMValTool
137140
>
138141
> Use the command:
142+
> ~~~
139143
> esmvaltool -c user-config.yml recipe_example.yml
144+
> ~~~
140145
>
146+
> {: .source}
141147
> What
142148
{: .challenge}
143149
144150
145151
> ## Inspect the output:
146152
> Now that you have run the esmvaltool command for the first time, please locate your output directory.
147-
> Each time you run ESMValTool, it will produce a new output directory with the format:
153+
> Each time you run ESMValTool, it will produce a new output directory with the following format:
148154
> This directory should contain four folders:
149155
> run work preproc plots
150-
> If you’re missing the preproc directory, then your config-user.yml file has the value remove_preproc_dir set to true.
151-
152-
156+
> If you’re missing the preproc directory, then your config-user.yml file has the value remove_preproc_dir set to true (this is used to save disk space). Please set this value to false and run the recipe again.
153157
>
154158
> Please locate and inspect the following files:
155-
> You output plot(s).
159+
> Your output plot(s).
156160
> Your main output log file
157161
> Your settings.yml file
158162
> A metadata.yml file
@@ -161,29 +165,49 @@ Please copy and paste the following recipe into your ESMValTool working area wit
161165
162166
> ## Edit the recipe and run
163167
> So far, the example recipe has used global volume-weighted ocean temperature. Please edit this recipe to investigate one of the following fields:
164-
> Land surface temperature
165-
> Atmospheric surface temperature
166-
> Ocean surface temperature (tos)
167-
> You will need to edit the dataset request, c
168+
> - Land surface average temperature (tsland)
169+
> - Atmospheric surface average temperature (tas)
170+
> - Ocean surface average temperature (tos)
171+
>
172+
> You will need to edit:
173+
> - the dataset:
174+
> - mip, start_year, end_year
175+
> - the preprocessor:
176+
> - These fields are all 2D fields, but thetaga was a 0D field. This means that we need to take the average over the latitude and longitude dimensions. To do this, add the area_statistics to the preprocessor.
177+
> - the diagnostic
178+
> - change the short_name value (thetaoga) for another:
179+
> - Land surface average temperature (tsland)
180+
> - Atmospheric surface average temperature (tas)
181+
> - Ocean surface average temperature (tos)
182+
> ### Advanced:
183+
> If you want to add a different field, please have a look here:
184+
> http://clipc-services.ceda.ac.uk/dreq/index/CMORvar.html
168185
{: .challenge}
169186
170187
171188
> ## Common issues & tips
172189
>
190+
> ### Esmvaltool not found
191+
> Can you run the command “esmvaltool -h”. If no, then it’s possible that the conda environment isn’t activated. Please return to the installation section, epside [2] LINK.
192+
>
173193
> ### ESMValTool can’t locate the data
174-
> User didn’t correctly edit user-config.yml
194+
> The error message is “esmvalcore._recipe_checks.RecipeError: Missing data”
195+
> Which computing machine are you using? Does your user-config.yml file reflect your machine's settings? Is the dataset’s name in the correct order?
175196
>
176-
> ### Esmvaltool not found
177-
> User didn’t active or correctly install conda
178197
>
179198
> ### Diagnostic path problems
180-
> explain ESMValTool’s methods to determine diagnostic path, and how it should appear in the recipe
199+
> The directory path to your diagnostics code is set relative to the esmvaltool/diag_scripts subdirectory. Is the code placed in this subdirectory? Is it spelled correctly?
200+
>
181201
>
182202
> ### FX files not found.
183203
>
204+
>
184205
> ### The preprocessor works but the diagnostic fails:
185-
> How to tell them appart and how to re-run a failed diagnostic (but not the preprocessor)
206+
> If your preprocessor works fine but your diagnostic script fails, congratulations! A failed diagnostic means that you won’t need to re-run the preprocessor. In your “run/main_log.txt” run output, you should see a line that reads: “To re-run this diagnostic script, run:”, followed by a line with a command that will allow you to re-run your diagnostic script only. Append this line with the “-i” option after the python script you call to re-run your diagnostic.
207+
>
186208
>
187209
> ### Your recipe’s name/project/reference isn’t recognised by ESMValTool.
210+
> Error message is “ValueError: Tag 'NAME' does not exist in section 'authors' of path/esmvaltool/config-references.yml”
211+
> Most likely, you added your own name to the recipe in the description section, but didn’t add it to the esmvaltool/config-references.yml file, where the names are linked to an email address, institute, and ORCID Identity.
188212
>
189213
{: .callout}

0 commit comments

Comments
 (0)