Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERA-Interim Land #1338

Merged
merged 32 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a8467f0
starting era-interim-land from era5 script
bascrezee Oct 1, 2019
fbc82ae
renamed to eraintland
bascrezee Oct 1, 2019
181d2ee
fix codacy complains
bascrezee Oct 1, 2019
f55e0a9
fixex area_weighted error for this dataset
bascrezee Oct 3, 2019
df3ef7c
Merge branch 'version2_development' into ei-land
bascrezee Nov 4, 2019
5e525ab
moved and renamed files
bascrezee Nov 4, 2019
234336a
Base ERA-Interim-Land cmorizers on ERA-Interim cmorizer
bascrezee Nov 4, 2019
dab92f6
renamed reference
bascrezee Nov 4, 2019
ff67bcd
add comment
bascrezee Nov 4, 2019
f2b5fdc
renamed reference
bascrezee Nov 4, 2019
ed51311
Support custom variables
bouweandela Nov 7, 2019
819e6ce
Fix linter issue
bouweandela Nov 7, 2019
bf10615
removed old script
bascrezee Nov 8, 2019
963c5a2
Merge branch 'ei-land' of https://github.com/ESMValGroup/ESMValTool i…
bascrezee Nov 8, 2019
68711c0
change to Lmon
bascrezee Nov 8, 2019
cc6e149
changed file pattern to reflect Lmon
bascrezee Nov 12, 2019
3ec9e69
Merge branch 'version2_development' into ei-land
bascrezee Nov 13, 2019
fb9c53e
added option to calculate monmeans for ERA-Interim-Land
bascrezee Nov 13, 2019
f03279c
support two frequencies for sm
bascrezee Nov 13, 2019
110c9f0
restructured
bascrezee Nov 13, 2019
33d5399
minor change
bascrezee Nov 13, 2019
03ede46
works for Land
bascrezee Nov 14, 2019
708dcb1
Changed mip
bascrezee Nov 14, 2019
1d481d7
same coordinate implementation for EI and EI-land
bascrezee Jan 10, 2020
a5d9515
formatting improvement
bascrezee Jan 10, 2020
1da2e35
Merge branch 'master' into ei-land
bascrezee Jan 10, 2020
b71a564
make filename consistent with download script
bascrezee Jan 10, 2020
3daebef
Adjust for new coordinate key names
bouweandela Jan 10, 2020
081bed6
Update overview table
mattiarighi Jan 13, 2020
7196592
Update esmvaltool/config-references.yml
bascrezee Jan 13, 2020
1ec2321
Add dataset to check recipe
mattiarighi Jan 13, 2020
e46fa9b
Merge branch 'master' into ei-land
mattiarighi Jan 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions esmvaltool/cmorizers/obs/cmor_config/ERA-Interim-Land.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Global attributes of NetCDF file
attributes:
dataset_id: ERA-Interim-Land
project_id: OBS6
tier: 3
version: '1'
modeling_realm: reanaly
source: 'https://apps.ecmwf.int/datasets/data/interim-land/type=an/'
reference: 'era-interim-land'
comment: |
'Contains modified Copernicus Climate Change Service Information {year}'

# Variables to CMORize
variables:
sm_daily:
short_name: sm
mip: CFday
raw: swvl1
file: 'eraintland_swvl1_????.nc'
mattiarighi marked this conversation as resolved.
Show resolved Hide resolved
sm_monthly:
short_name: sm
mip: Lmon
raw: swvl1
file: 'eraintland_swvl1_????.nc'

46 changes: 33 additions & 13 deletions esmvaltool/cmorizers/obs/cmorize_obs_era_interim.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
import numpy as np

from esmvalcore.cmor.table import CMOR_TABLES
from esmvalcore.preprocessor import daily_statistics
from esmvalcore.preprocessor import daily_statistics, monthly_statistics

from . import utilities as utils

Expand Down Expand Up @@ -145,8 +145,8 @@ def _fix_coordinates(cube, definition):
if 'height10m' in definition.dimensions:
utils.add_scalar_height_coord(cube, 10.)

for axis in 'T', 'X', 'Y', 'Z':
coord_def = definition.coordinates.get(axis)
for definition_axis,axis in zip(['time','longitude','latitude'],['T','X','Y']):
coord_def = definition.coordinates.get(definition_axis)
if coord_def:
coord = cube.coord(axis=axis)
if axis == 'T':
Expand Down Expand Up @@ -178,6 +178,17 @@ def _fix_monthly_time_coord(cube):
coord.points = 0.5 * (start + end)
coord.bounds = np.column_stack([start, end])

def _compute_monthly(cube):
"""Convert various frequencies to daily frequency.

ERA-Interim-Land is in 6hr freq need to convert to monthly

"""
cube = monthly_statistics(cube, operator='mean')
# Remove monthly statistics aux coordinates
cube.remove_coord(cube.coord('month_number'))
cube.remove_coord(cube.coord('year'))
return cube

def _compute_daily(cube):
"""Convert various frequencies to daily frequency.
Expand Down Expand Up @@ -308,7 +319,8 @@ def _extract_variable(in_files, var, cfg, out_dir):

# Set correct names
cube.var_name = definition.short_name
cube.standard_name = definition.standard_name
if definition.standard_name:
cube.standard_name = definition.standard_name
cube.long_name = definition.long_name

_fix_units(cube, definition)
Expand All @@ -318,15 +330,23 @@ def _extract_variable(in_files, var, cfg, out_dir):

cube = _fix_coordinates(cube, definition)

if 'mon' in var['mip']:
_fix_monthly_time_coord(cube)

if 'day' in var['mip']:
cube = _compute_daily(cube)

if 'fx' in var['mip']:
cube = iris.util.squeeze(cube)
cube.remove_coord('time')
if attributes['dataset_id']=='ERA-Interim':
if 'mon' in var['mip']:
_fix_monthly_time_coord(cube)
if 'day' in var['mip']:
cube = _compute_daily(cube)
if 'fx' in var['mip']:
cube = iris.util.squeeze(cube)
cube.remove_coord('time')

# Specific to ERA Interim Land
elif attributes['dataset_id']=='ERA-Interim-Land':
if 'mon' in var['mip']:
cube = _compute_monthly(cube)
if 'day' in var['mip']:
cube = _compute_daily(cube)
else:
raise ValueError("Unknown dataset_id for this script: {attributes['dataset_id']}")

# Convert units if required
cube.convert_units(definition.units)
Expand Down
20 changes: 20 additions & 0 deletions esmvaltool/cmorizers/obs/cmorize_obs_era_interim_land.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""ESMValTool CMORizer for ERA-Interim-Land data.

Tier
Tier 3: restricted datasets (i.e., dataset which requires a registration
to be retrieved or provided upon request to the respective contact or PI).

Source
https://apps.ecmwf.int/datasets/data/interim-land/type=fc/

Last access
20191104

Download and processing instructions
See script cmorize_obs_era_interim.py

"""

from .cmorize_obs_era_interim import cmorization

__all__ = ['cmorization']
1 change: 1 addition & 0 deletions esmvaltool/config-references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ references:
duveiller2018: "Duveiller et al., Sci. Data, doi:10.1038/sdata.2018.14, 2018."
eppley-vgpm-modis: "Behrenfeld and Falkowski, Limnol. Oceanogr., doi:10.4319/lo.1997.42.1.0001, 1997."
era-interim: "Dee et al., Q. J. Roy. Meteor. Soc., doi:10.1002/qj.828, 2011."
era-interim-land: "Balsamo et al. ERA-Interim/Land: a global land surface reanalysis data set, Hydrol. Earth Syst. Sci., 19, 389–407, https://doi.org/10.5194/hess-19-389-2015, 2015."
bascrezee marked this conversation as resolved.
Show resolved Hide resolved
era5: "Copernicus Climate Change Service (C3S) (2017): ERA5: Fifth generation of ECMWF atmospheric reanalyses of the global climate. Copernicus Climate Change Service Climate Data Store (CDS)"
esacci-aerosol: "Popp et al., Remote Sens., doi:10.3390/rs8050421, 2016."
esacci-cloud: "Stengel et al., Earth Syst. Sci. Data, doi:10.5194/essd-9-881-2017, 2017."
Expand Down