Skip to content

Commit 108ed31

Browse files
Merge pull request #130 from ESMValGroup/fix_bugs
fixing missing data and some bugs
2 parents 4e42205 + 00d6c6b commit 108ed31

File tree

9 files changed

+211
-112
lines changed

9 files changed

+211
-112
lines changed

_episodes/02-installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Installation"
33
teaching: 10
4-
exercises: 20
4+
exercises: 10
55
questions:
66
- "What are the prerequisites for installing ESMValTool?"
77
- "How do I confirm that the installation was successful?"

_episodes/03-configuration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,15 @@ Site-specific entries for Jasmin, DKRZ and ETHZ are listed at the end of the
188188
example configuration file.
189189
190190
In this lesson, we will work with data from
191-
[CMIP5](https://esgf-node.llnl.gov/projects/cmip5/).
191+
[CMIP5](https://esgf-node.llnl.gov/projects/cmip5/)
192+
and [obs4mips](https://esgf-node.llnl.gov/projects/obs4mips/).
192193
We add the root path of the folder where our/your data is available.
193194
194195
```yaml
195196
rootpath:
196197
...
197198
CMIP5: [~/cmip5_inputpath1, ~/cmip5_inputpath2, ~/esmvaltool_tutorial/data]
199+
obs4mips: ~/esmvaltool_tutorial/data
198200
```
199201
200202
> ## Setting the correct rootpath

_episodes/04-recipe.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,24 @@ Please note the following sections:
181181
The documentation consists of the following information:
182182
183183
- description: a short description of the recipe
184-
- authors: a list of authors (linked to `esmvaltool/config-references.yml`)
185-
- maintainer: a list of maintainers (linked to
186-
`esmvaltool/config-references.yml`)
187-
- references: a list of references (linked to a bibtexfile in
188-
`esmvaltool/references` with the same name)
189-
- projects: a list of projects (linked to
190-
`esmvaltool/config-references.yml`)
184+
- authors: a list of authors
185+
- maintainer: a list of maintainers
186+
- references: a list of references
187+
- projects: a list of projects
191188
189+
> ## config-references.yml and references
190+
>
191+
> The values for the keys ``author``, ``maintainer``, ``projects`` and
192+
> ``references`` in the recipe should be known by ESMValTool:
193+
>
194+
> - A list of ESMValTool
195+
> author, maintainer, and projects are mentioned in the file ``config-references.yml``
196+
> that can be found in
197+
> [ESMValTool/esmvaltool](https://github.com/ESMValGroup/ESMValTool/blob/master/esmvaltool/config-references.yml).
198+
>
199+
> - ESMValTool references in `BibTeX` format can be found in
200+
> [ESMValTool/esmvaltool/references](https://github.com/ESMValGroup/ESMValTool/tree/master/esmvaltool/references) directory.
201+
{: .callout}
192202
193203
- datasets: lines 22-23
194204
@@ -399,9 +409,9 @@ available) can be found below. Note that the timestamps differ.
399409
400410
> ## Your output plot(s).
401411
> Plots for the dataset(s) are located in `./recipe_example_#_#/plots/timeseries_diag/`
402-
>
412+
>
403413
> For a single dataset:
404-
>
414+
>
405415
> ![single dataset](../fig/diag_CMIP5_HadGEM2-ES_Omon_historical_r1i1p1_thetaoga_prep_timeseries_diag_timeseries_temperature_1859_2005_timeseries_0.png "single dataset")
406416
>
407417
> Or an overlay plot, if multiple datasets are defined:
@@ -410,8 +420,8 @@ available) can be found below. Note that the timestamps differ.
410420
{: .solution}
411421
412422
> ## Your main output log file.
413-
> The main output file is located at `./recipe_example_#_#/run/main_log.txt/`
414-
>
423+
> The main output file is located at `./recipe_example_#_#/run/main_log.txt/`
424+
>
415425
> ~~~bash
416426
> INFO [33433]
417427
> ______________________________________________________________________
@@ -499,7 +509,7 @@ available) can be found below. Note that the timestamps differ.
499509
500510
> ## Your settings.yml file.
501511
> This file is located at `./recipe_example_#_#/run/diag_timeseries_temperature/timeseries_diag/settings.yaml`.
502-
>
512+
>
503513
> ```YAML
504514
> auxiliary_data_dir: /mnt/lustre01/pf/b/b380506/work/auxiliary_data
505515
> input_files:
@@ -519,9 +529,9 @@ available) can be found below. Note that the timestamps differ.
519529
{: .solution}
520530
521531
> ## A metadata.yml file.
522-
>
532+
>
523533
> This file is located at `./recipe_example_#_#/preproc/diag_timeseries_temperature/timeseries_variable/metadata.yml`.
524-
>
534+
>
525535
> ```YAML
526536
> ? /scratch/b/b380506/recipe_example_20200701_082257/preproc/diag_timeseries_temperature/timeseries_variable/CMIP5_HadGEM2-ES_Omon_historical_r1i1p1_thetaoga_1859-2005.nc
527537
> : alias: HadGEM2-ES
@@ -552,7 +562,7 @@ available) can be found below. Note that the timestamps differ.
552562
553563
> ## The diagnostic log file.
554564
> This file is located at `./recipe_example_#_#/run/diag_timeseries_temperature/timeseries_diag/log.txt`
555-
>
565+
>
556566
> ~~~bash
557567
> Starting diagnostic script timeseries_diag with configuration:
558568
> auxiliary_data_dir: /mnt/lustre01/pf/b/b380506/work/auxiliary_data

_episodes/05-preprocessor.md

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,46 @@ file afterwards. These do not need to be explicitly included in recipes.
8888

8989
> ## Exercise: Adding more preprocessor steps
9090
>
91-
> Edit the [example recipe](https://github.com/ESMValGroup/ESMValTool_Tutorial/blob/master/data/recipe_example.yml) to first change the variable
92-
> thetao, then add preprocessors to average over the latitude and longitude
91+
> Edit the [example recipe](https://github.com/ESMValGroup/ESMValTool_Tutorial/blob/master/data/recipe_example.yml) to first change the variable to
92+
> `thetao`, then add preprocessors to average over the latitude and longitude
9393
> dimensions and finally average over the depth. Now run the recipe.
9494
>
9595
>> ## Solution
9696
>>
97-
>>```yaml
98-
>> preprocessors:
99-
>> prep_timeseries:
100-
>> annual_statistics:
101-
>> operator: mean
102-
>> area_statistics:
103-
>> operator: mean
104-
>> depth_integration:
105-
>>```
97+
>> In the `diff` file below you will see the changes we have made to the file. The top 2 lines are the filenames and the lines like @@ -20,12 +20,15 @@ indicate the line numbers in the original and modified file, respectively. For more info on this format, see [here](https://en.wikipedia.org/wiki/Diff#Unified_format).
98+
>>
99+
>>```diff
100+
>> --- data/recipe_example.yml
101+
>> --- data/recipe_example_thetao.yml
102+
>> @@ -20,12 +20,15 @@
103+
>> - ukesm
104+
>>
105+
>> datasets:
106+
>> - - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
107+
>> + - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 2000, end_year: 2005}
108+
>>
109+
>> preprocessors:
110+
>> prep_timeseries: # For 0D fields
111+
>> annual_statistics:
112+
>> operator: mean
113+
>> + area_statistics:
114+
>> + operator: mean
115+
>> + depth_integration:
116+
>>
117+
>> diagnostics:
118+
>> # --------------------------------------------------
119+
>> @@ -35,7 +38,7 @@
120+
>> description: simple_time_series
121+
>> variables:
122+
>> timeseries_variable:
123+
>> - short_name: thetaoga
124+
>> + short_name: thetao
125+
>> preprocessor: prep_timeseries
126+
>> scripts:
127+
>> timeseries_diag:
128+
>> ```
106129
>>
130+
>> Complete recipe can be downloaded as [recipe_example_thetao.yml](https://github.com/ESMValGroup/ESMValTool_Tutorial/blob/master/data/recipe_example_thetao.yml)
107131
>{: .solution}
108132
{: .challenge}
109133

@@ -116,6 +140,9 @@ specific preprocessor which should be applied.
116140
> ## Example
117141
>
118142
> ```yaml
143+
>datasets:
144+
> - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 2000, end_year: 2005}
145+
>
119146
> preprocessors:
120147
> prep_timeseries_1:
121148
> annual_statistics:
@@ -152,6 +179,7 @@ specific preprocessor which should be applied.
152179
> script: ocean/diagnostic_timeseries.py
153180
> ```
154181
>
182+
> Complete recipe can be downloaded as [recipe_example_thetao_thetaoga.yml](https://github.com/ESMValGroup/ESMValTool_Tutorial/blob/master/data/recipe_example_thetao_thetaoga.yml)
155183
{: .solution}
156184

157185
>## Challenge : How to write a recipe with multiple preprocessors
@@ -271,7 +299,7 @@ specific preprocessor which should be applied.
271299
## Adding different datasets for different variables
272300

273301
Sometimes, we may want to include specific datasets only for certain variables.
274-
An example is when we use observations for two different variables in a
302+
An example is when we use observations for variables in a
275303
diagnostic. While the CMIP dataset details for the two variables may be common,
276304
the observations will likely not be so. It would be useful to know how to
277305
include different datasets for different variables. Here is an example of a
@@ -303,9 +331,8 @@ simple preprocessor and diagnostic setup for that:
303331
> preprocessor: prep_regrid
304332
> mip: Amon
305333
> grid: gn # can change for variables from the same model
306-
> start_year: 1970
307-
> end_year: 2000 # start and end years for a 30 year period,
308-
> # we assume this is common and exists for all
334+
> start_year: 1979
335+
> end_year: 2000 # we assume this exists for all
309336
> # model and obs data
310337
> additional_datasets:
311338
> - {dataset: GPCP-SG, project: obs4mips, level: L3,
@@ -314,11 +341,8 @@ simple preprocessor and diagnostic setup for that:
314341
> preprocessor: prep_regrid
315342
> mip: Amon
316343
> grid: gn # can change for variables from the same model
317-
> start_year: 1970 # some 30 year period
344+
> start_year: 1979
318345
> end_year: 2000
319-
> additional_datasets:
320-
> - {dataset: HadCRUT4, project: OBS, type: ground,
321-
> version: 1, tier: 2} # dataset specific to the temperature variable
322346
> scripts: null
323347
> ```
324348
>
@@ -329,7 +353,6 @@ simple preprocessor and diagnostic setup for that:
329353
Variable grouping can be used to preprocess different clusters of data for the
330354
same variable. For instance, the example below illustrates how we can compute
331355
separate multimodel means for CMIP5 and CMIP6 data given the same variable.
332-
Additionally we can also preprocess observed data for evaluation.
333356

334357
> ## Example
335358
>```yaml
@@ -375,12 +398,6 @@ Additionally we can also preprocess observed data for evaluation.
375398
> end_year: 2005
376399
> tag: TAS_CMIP5 # tag is optional if you are using these settings just once
377400
> additional_datasets: *cmip5_datasets
378-
> tas_obs:
379-
> <<: *variable_settings
380-
> preprocessor: prep_obs
381-
> tag: TAS_OBS
382-
> additional_datasets:
383-
> - {dataset: HadCRUT4, project: OBS, type: ground, version: 1, tier: 2}
384401
> tas_cmip6:
385402
> <<: *variable_settings
386403
> tag: TAS_CMIP6
@@ -392,24 +409,9 @@ Additionally we can also preprocess observed data for evaluation.
392409

393410
You should be able to see the variables grouped under different subdirectories
394411
under your output preproc directory. The different groupings can be accessed in
395-
your diagnostic by selecting the key name of the field `variable_group` such as `tas_cmip5`, `tas_cmip6` or `tas_obs`.
412+
your diagnostic by selecting the key name of the field `variable_group` such as `tas_cmip5`, or `tas_cmip6`.
396413

397414
> ## How to find what CMIP data is available?
398415
>
399-
> [CMIP5](https://pcmdi.llnl.gov/mips/cmip5/index.html) and
400-
> [CMIP6](https://pcmdi.llnl.gov/CMIP6/Guide/dataUsers.html) data obey the
401-
> [CF-conventions](http://cfconventions.org/). Available variables can be found
402-
> under the [CMIP5 data
403-
> request](https://pcmdi.llnl.gov/mips/cmip5/docs/standard_output.pdf?id=28) and
404-
> the [CMIP6 Data Request](http://clipc-services.ceda.ac.uk/dreq/index.html).
405-
>
406-
> CMIP data is widely available via the Earth System Grid Federation
407-
> ([ESGF](https://esgf.llnl.gov/)) and is accessible to users either via
408-
> download from the ESGF portal or through the ESGF data nodes hosted by large
409-
> computing facilities (like [CEDA-Jasmin](https://esgf-index1.ceda.ac.uk/),
410-
> [DKRZ](https://esgf-data.dkrz.de/), etc). The ESGF also hosts observations for
411-
> Model Intercomparison Projects (obs4MIPs) and reanalyses data (ana4MIPs).
412-
>
413-
> A full list of all CMIP named variables is available here:
414-
> [http://clipc-services.ceda.ac.uk/dreq/index/CMORvar.html](http://clipc-services.ceda.ac.uk/dreq/index/CMORvar.html).
416+
> Please see section "Access to CMIP and Observational data" in [Setup]({{ page.root }}{% link setup.md %}).
415417
{: .callout}

_episodes/06-debugging.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,19 +214,13 @@ attach the run/recipe_*.yml and run/main_log_debug.txt files from the output dir
214214
{: .error}
215215
216216
The values for the keys ``author``, ``maintainer``, ``projects`` and
217-
``references`` in the recipe should be known by ESMValTool. A list of ESMValTool
218-
author, maintainer, references, and projects can be found in the
219-
``config-references.yml``. You could download this file by typing:
217+
``references`` in the recipe should be known by ESMValTool:
220218
221-
~~~bash
222-
esmvaltool config get_config_reference
223-
~~~
224-
225-
It will be saved to: ``{HOME}/.esmvaltool/config-references.yml``. If you modify this file, please add the directory in the ``config-user.yml``:
226-
227-
```yaml
228-
config_developer_file: {HOME}/.esmvaltool/config_reference.yml
229-
```
219+
- A list of ESMValTool
220+
author, maintainer, and projects can be found in the
221+
[config-references.yml](https://github.com/ESMValGroup/ESMValTool/blob/master/esmvaltool/config-references.yml).
222+
- ESMValTool references in `BibTeX` format can be found in the
223+
[ESMValTool/esmvaltool/references](https://github.com/ESMValGroup/ESMValTool/tree/master/esmvaltool/references) directory.
230224
231225
> ## ESMValTool can’t locate the data
232226
>
@@ -300,7 +294,7 @@ esmvalcore._task.DiagnosticError: Cannot execute script 'diag_scripts/examples/d
300294
301295
The script path should be relative to ``diag_scripts`` directory. It means that
302296
the script ``diagnostic_timeseries.py`` is located in
303-
``<path_to_esmvaltool>/diag_scripts/ocean/``.
297+
``<path_to_esmvaltool>/diag_scripts/ocean/``.
304298
Alternatively, the script path can be an absolute path. To examine this, we can download the script from the ``ESMValTool`` repository:
305299
306300
```bash

data/dataset.urls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ http://esgf-data1.ceda.ac.uk/thredds/fileServer/esg_dataroot/cmip5/output1/MOHC/
2525
http://esgf-data1.ceda.ac.uk/thredds/fileServer/esg_dataroot/cmip5/output1/MOHC/HadGEM2-ES/historical/mon/ocean/Omon/r1i1p1/v20110916/tos/tos_Omon_HadGEM2-ES_historical_r1i1p1_185912-195911.nc
2626
http://esgf-data1.ceda.ac.uk/thredds/fileServer/esg_dataroot/cmip5/output1/MOHC/HadGEM2-ES/historical/mon/ocean/Omon/r1i1p1/v20110916/tos/tos_Omon_HadGEM2-ES_historical_r1i1p1_195912-200512.nc
2727
# For Working with preprocessors episode
28+
# Variable = thetao, model = HadGEM2-ES
29+
http://esgf-data1.ceda.ac.uk/thredds/fileServer/esg_dataroot/cmip5/output1/MOHC/HadGEM2-ES/historical/mon/ocean/Omon/r1i1p1/v20110916/thetao/thetao_Omon_HadGEM2-ES_historical_r1i1p1_199912-200512.nc
2830
# Model = UKESM1-0-LL, project = CMIP6, Experiment = historical, ensemble= r1i1p1f2, variable = thetao, pr and tas, 1970-2000
2931
http://esgf-data3.ceda.ac.uk/thredds/fileServer/esg_cmip6/CMIP6/CMIP/MOHC/UKESM1-0-LL/historical/r1i1p1f2/Omon/thetao/gn/v20190627/thetao_Omon_UKESM1-0-LL_historical_r1i1p1f2_gn_200001-201412.nc
3032
http://esgf-data3.ceda.ac.uk/thredds/fileServer/esg_cmip6/CMIP6/CMIP/MOHC/UKESM1-0-LL/historical/r1i1p1f2/Omon/thetao/gn/v20190627/thetao_Omon_UKESM1-0-LL_historical_r1i1p1f2_gn_195001-199912.nc
@@ -47,3 +49,5 @@ http://crd-esgf-drc.ec.gc.ca/thredds/fileServer/esgC_dataroot/AR6/CMIP6/CMIP/CCC
4749
http://crd-esgf-drc.ec.gc.ca/thredds/fileServer/esgC_dataroot/AR6/CMIP6/CMIP/CCCma/CanESM5/historical/r2i1p2f1/Amon/tas/gn/v20190429/tas_Amon_CanESM5_historical_r2i1p2f1_gn_185001-201412.nc
4850
http://crd-esgf-drc.ec.gc.ca/thredds/fileServer/esgC_dataroot/AR6/CMIP6/CMIP/CCCma/CanESM5/historical/r3i1p2f1/Amon/tas/gn/v20190429/tas_Amon_CanESM5_historical_r3i1p2f1_gn_185001-201412.nc
4951
http://crd-esgf-drc.ec.gc.ca/thredds/fileServer/esgC_dataroot/AR6/CMIP6/CMIP/CCCma/CanESM5/historical/r4i1p2f1/Amon/tas/gn/v20190429/tas_Amon_CanESM5_historical_r4i1p2f1_gn_185001-201412.nc
52+
# Variable = pr, model = GPCP-SG, project= obs4mips
53+
https://dpesgf03.nccs.nasa.gov/thredds/fileServer/obs4MIPs/observations/NASA-GSFC/Obs-GPCP/GPCP/V2.2/atmos/pr/pr_GPCP-SG_L3_v2.2_197901-201312.nc

data/recipe_example_thetao.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ESMValTool
2+
# recipe_example.yml
3+
---
4+
documentation:
5+
description: Demonstrate basic ESMValTool example
6+
7+
authors:
8+
- demora_lee
9+
- mueller_benjamin
10+
- swaminathan_ranjini
11+
12+
maintainer:
13+
- demora_lee
14+
15+
references:
16+
- demora2018gmd
17+
# Some plots also appear in ESMValTool paper 2.
18+
19+
projects:
20+
- ukesm
21+
22+
datasets:
23+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 2000, end_year: 2005}
24+
25+
preprocessors:
26+
prep_timeseries: # For 0D fields
27+
annual_statistics:
28+
operator: mean
29+
area_statistics:
30+
operator: mean
31+
depth_integration:
32+
33+
diagnostics:
34+
# --------------------------------------------------
35+
# Time series diagnostics
36+
# --------------------------------------------------
37+
diag_timeseries_temperature:
38+
description: simple_time_series
39+
variables:
40+
timeseries_variable:
41+
short_name: thetao
42+
preprocessor: prep_timeseries
43+
scripts:
44+
timeseries_diag:
45+
script: ocean/diagnostic_timeseries.py

0 commit comments

Comments
 (0)