Skip to content

Commit 828ee02

Browse files
author
BenMGeo
committed
add solutions to most challenges
FIXME is supposed to be done by someone who has access to JASMIN in order to have the correct solutions.
1 parent 5560ad4 commit 828ee02

File tree

1 file changed

+124
-57
lines changed

1 file changed

+124
-57
lines changed

_episodes/first_example_recipe.md

Lines changed: 124 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ For additional reeds, please have a look at the recipe format description in the
5959
## How to run ESMValTool
6060

6161
Once you’ve set up your conda environment and installed ESMValTool (see episode #2 LINK) and set up your config-user.yml file to correctly match you local environment, (see episode #3 LINK), ESMValTool is invoked using a simple command:
62-
~~~
62+
63+
~~~source
6364
esmvaltool -c configuration recipe
6465
~~~
65-
{: .source}
66+
6667

6768
To try your hand with a basic recipe, please work through this episode.
6869

@@ -72,61 +73,60 @@ The recipe presented here is a simple, basic recipe that takes a single dataset
7273

7374
Please download the following recipe into your ESMValTool working area with the name: recipe_example.yml LINK
7475

75-
>## recipe_example.yml
76-
>~~~YAML
77-
> 1 # ESMValTool
78-
> 2 # recipe_example.yml
79-
> 3 ---
80-
> 4 documentation:
81-
> 5 description: Demonstrate basic ESMValTool example
82-
> 6
83-
> 7 authors:
84-
> 8 - demora_lee
85-
> 9 - mueller_benjamin
86-
>10 - swaminathan_ranjini
87-
>11
88-
>12 maintainer:
89-
>13 - demora_lee
90-
>14
91-
>15 references:
92-
>16 - demora2018gmd
93-
>17 # Some plots also appear in ESMValTool paper 2.
94-
>18
95-
>19 projects:
96-
>20 - ukesm
97-
>21
98-
>22 datasets:
99-
>23 - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
100-
>24
101-
>25 preprocessors:
102-
>26 prep_timeseries: # For 0D fields
103-
>27 annual_statistics:
104-
>28 operator: mean
105-
>29
106-
>30 diagnostics:
107-
>31 # --------------------------------------------------
108-
>32 # Time series diagnostics
109-
>33 # --------------------------------------------------
110-
>34 diag_timeseries_temperature:
111-
>35 description: simple_time_series
112-
>36 variables:
113-
>37 timeseries_variable:
114-
>38 short_name: thetaoga
115-
>39 preprocessor: prep_timeseries
116-
>40 scripts:
117-
>41 timeseries_diag:
118-
>42 script: ocean/diagnostic_timeseries.py
119-
>~~~
76+
> ## recipe_example.yml
77+
> ~~~YAML
78+
> 1 # ESMValTool
79+
> 2 # recipe_example.yml
80+
> 3 ---
81+
> 4 documentation:
82+
> 5 description: Demonstrate basic ESMValTool example
83+
> 6
84+
> 7 authors:
85+
> 8 - demora_lee
86+
> 9 - mueller_benjamin
87+
> 10 - swaminathan_ranjini
88+
> 11
89+
> 12 maintainer:
90+
> 13 - demora_lee
91+
> 14
92+
> 15 references:
93+
> 16 - demora2018gmd
94+
> 17 # Some plots also appear in ESMValTool paper 2.
95+
> 18
96+
> 19 projects:
97+
> 20 - ukesm
98+
> 21
99+
> 22 datasets:
100+
> 23 - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
101+
> 24
102+
> 25 preprocessors:
103+
> 26 prep_timeseries: # For 0D fields
104+
> 27 annual_statistics:
105+
> 28 operator: mean
106+
> 29
107+
> 30 diagnostics:
108+
> 31 # --------------------------------------------------
109+
> 32 # Time series diagnostics
110+
> 33 # --------------------------------------------------
111+
> 34 diag_timeseries_temperature:
112+
> 35 description: simple_time_series
113+
> 36 variables:
114+
> 37 timeseries_variable:
115+
> 38 short_name: thetaoga
116+
> 39 preprocessor: prep_timeseries
117+
> 40 scripts:
118+
> 41 timeseries_diag:
119+
> 42 script: ocean/diagnostic_timeseries.py
120+
> ~~~
120121
{: .solution}
121122
122123
123124
> ## Explore the recipe
124125
> Use the command and investigate the sample recipe.
125-
> ~~~
126+
> ~~~bash
126127
> vim recipe_example.yml
127128
> ~~~
128-
> {: .source}
129-
>
129+
{: .challenge}
130130
131131
Please note the following sections:
132132
- documentation: lines 4-20
@@ -174,31 +174,51 @@ Please note the following sections:
174174
- the next indent (here: timeseries_diag) is the scripts’ names (a string without whitespace) for the script to use
175175
- script: a executable script with a directory relative to the `esmvaltool/diag_scripts/` directory
176176
177-
178-
> What is the short_name of the variable being analysed?
177+
> ## Please answer the following questions:
178+
> What is the short_name of the variable being analyzed?
179179
>
180180
> What is the diagnostic script being used?
181181
>
182-
> How many years of data are being analysed?
182+
> How many years of data are being analyzed?
183183
>
184184
> What do you think running this recipe will produce?
185185
{: .challenge}
186186
187+
188+
> ## What is the short_name of the variable being analyzed?
189+
> thetaoga - Global Average Sea Water Potential Temperature
190+
{: .solution}
191+
192+
> ## What is the diagnostic script being used?
193+
> `ocean/diagnostic_timeseries.py`
194+
{: .solution}
195+
196+
> ## How many years of data are being analyzed?
197+
> 1859 to 2005, that is 147 years.
198+
{: .solution}
199+
200+
> ## What do you think running this recipe will produce?
201+
> A time series plot of thetaoga with increements of 1 year.
202+
{: .solution}
203+
187204
> ## Not all parts of the recipe are mandatory
188205
> Some functionalities of the example recipe are mandatory, while others are not. E.g., if you miss any of the documentation information, the call will break.
189206
{: .callout}
190207
191208
> ## Running ESMValTool
192209
>
193210
> Use the command:
194-
> ~~~
211+
> ~~~bash
195212
> esmvaltool -c ./path_to_file/user-config.yml ./path_to_file/recipe_example.yml
196213
> ~~~
197-
> {: .source}
198214
>
199215
> Follow the terminal guiding you through the subprocesses that are running. Can you find where the preprocessor and the diagnostic are starting? Which one took longer to process?
200216
{: .challenge}
201217
218+
> ## Exemplary output
219+
> FIXME
220+
{: .solution}
221+
202222
Each time you run the ESMValTool, it will produce a new output directory within your specified work directory with the name of the recipe and the tagged runtime. This folder should contain four folders:
203223
- run
204224
- work
@@ -218,8 +238,31 @@ Each time you run the ESMValTool, it will produce a new output directory within
218238
> - Your settings.yml file.
219239
> - A metadata.yml file.
220240
> - The diagnostic log file.
221-
{: .discussion}
241+
{: .checklist}
242+
243+
Exemplary output (depending on the directory paths and package versions that are available) can be found below:
244+
245+
> ## Your output plot(s).
246+
> FIXME (include plots)
247+
{: .solution}
248+
249+
> ## Your main output log file.
250+
> FIXME (include example log)
251+
{: .solution}
252+
253+
> ## Your settings.yml file.
254+
> FIXME (include the settings)
255+
{: .solution}
256+
257+
> ## A metadata.yml file.
258+
> FIXME (include the metadata)
259+
{: .solution}
260+
261+
> ## The diagnostic log file.
262+
> FIXME (include the diag log)
263+
{: .solution}
222264
265+
## Do your first edits
223266
224267
> ## Edit the recipe and run again
225268
> So far, the example recipe has used global volume-weighted ocean temperature. Please edit this recipe to investigate one of the following fields:
@@ -239,6 +282,30 @@ Each time you run the ESMValTool, it will produce a new output directory within
239282
> - Ocean surface average temperature (tos)
240283
{: .challenge}
241284
285+
The snippets for the edits can be found below:
286+
287+
> ## Land surface average temperature
288+
> FIXME (include line numbers, see below)
289+
> ~~~YAML
290+
> ...
291+
> 23 - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
292+
> ...
293+
> 27 annual_statistics:
294+
> 28 operator: mean
295+
> ...
296+
> 38 short_name: thetaoga
297+
> 39 preprocessor: prep_timeseries
298+
> ~~~~
299+
{: .solution}
300+
301+
> ## Atmospheric surface average temperature
302+
> FIXME
303+
{: .solution}
304+
305+
> ## Ocean surface average temperature
306+
> FIXME
307+
{: .solution}
308+
242309
> ## Advanced:
243310
> If you want to add a different field, please have a look here:
244311
> http://clipc-services.ceda.ac.uk/dreq/index/CMORvar.html
@@ -247,7 +314,7 @@ Each time you run the ESMValTool, it will produce a new output directory within
247314
248315
## Common issues & tips
249316
250-
> ## Esmvaltool not found
317+
> ## esmvaltool not found
251318
> 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, episode #2 LINK.
252319
{: .solution}
253320

0 commit comments

Comments
 (0)