Project

General

Profile

ERA5: hourly to daily values

Added by Brian Yalle almost 3 years ago

Hi!
I'm working with ERA5 land hourly data, particularly with "2m temperature" and "total precipitation".
Before obtaining daily values, I made the following steps:

For temperature :
1. Convert Kelvin to Celsius
cdo subc,273.15 era5land_t2m_hourly_ene-dic_1981-2010.nc era5land_t2m-c_hourly_1981-2010.nc
2. Convert hourly to daily values: I use mean of hourly values
cdo daymean era5land_t2m-c_hourly_1981-2010.nc era5land_t2m-c_daily_1981-2010.nc

For precipitation :
1. Convert meter to milimeters (mm)
cdo mulc,1000 era5land_tp_hourly_ene-dic_1981-2010.nc era5land_tp-mm_hourly_1981-2010.nc
2. Convert hourly to daily values: since this variable is a cumulative measure, I use a sum of hourly values
cdo daysum @era5land_tp-mm_hourly_1981-2010.nc era5land_tp-mm_daily_1981-2010.n

QUESTIONS
a) I'm not quite sure if I use these codes correctly. Are these codes OK?
b) While I trying to obtain daily values (step 2), I read that in some posts -shifttime,1-hour is used next to daysum or daymean is used. Could anyone explain me the reason to use it? and it should be applied for temperature or precipitation or both?

Data source for ERA5 land hourly: https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-land?tab=overview

Cheers,
Brian


Replies (7)

RE: ERA5: hourly to daily values - Added by Karin Meier-Fleischer almost 3 years ago

Hi Brian,

This looks good, except in fact for the missing shifttime. If I understand the documentation correctly, the values for 00:00:00 to 00:59:59 are stored in 01:00:00, which means that 00:00:00 actually has the values of the last timestep of the previous day.

https://confluence.ecmwf.int/display/CKB/ERA5-Land%3A+data+documentation#ERA5Land:datadocumentation-Temporalfrequency
----
Accumulations

Please, note that the convention for accumulations used in ERA5-Land differs with that for ERA5. The accumulations in the short forecasts of ERA5-Land (with hourly steps from 01 to 24) are treated the same as those in ERA-Interim or ERA-Interim/Land, i.e., they are accumulated from the beginning of the forecast to the end of the forecast step. For example, runoff at day=D, step=12 will provide runoff accumulated from day=D, time=0 to day=D, time=12. The maximum accumulation is over 24 hours, i.e., from day=D, time=0 to day=D+1,time=0 (step=24).
----

cdo -daymean -shifttime,-1sec -subc,273.15 era5land_t2m_hourly_ene-dic_1981-2010.nc era5land_t2m-c_daily_1981-2010.nc

-Karin

RE: ERA5: hourly to daily values - Added by Brian Yalle almost 3 years ago

Thanks Karin for your reply,

The code you provided for temperature
cdo -daymean -shifttime,-1sec -subc,273.15 era5land_t2m_hourly_ene-dic_1981-2010.nc era5land_t2m-c_daily_1981-2010.nc

I understand you're using shifttime adding 1sec (does it mean second?).
After reading the ERA5-Land: data documentation, and other posts I found this:

"For example if you have hourly data for January 2019, the data for '2019-01-01-00:00' will contribute to the sum of '2018-12-31' while the sum over '2019-01-01' will take the values from '2019-01-01-01:00' all the way to '2019-01-02-00:00' included"

Is this the reason to use 1sec instead 1hour?

Just to make it explicit, shifttime,-1sec needs to applied to both temperature and precipitation, doesn't it?

RE: ERA5: hourly to daily values - Added by Karin Meier-Fleischer almost 3 years ago

No, the 1 second is subtracted not added (shifttime,-1sec). The times will be shifted 1 second back in time, e.g. for 1981 January, 15th

time 15.01.1981 00:00:00 --> 14.01.1981 23:59:59
time 15.01.1981 01:00:00 --> 15.01.1981 00:59:59
...

CDO documentation: https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf

See shifttime: https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#subsection.2.6.4

You have to read the documentation of ER5 and CDO.

Explanation of the CDO command line (the operators are read from right to left - see docu!):

cdo -daymean -shifttime,-1sec -subc,273.15 era5land_t2m_hourly_ene-dic_1981-2010.nc era5land_t2m-c_daily_1981-2010.nc

output file: era5land_t2m-c_daily_1981-2010.nc
input file: era5land_t2m_hourly_ene-dic_1981-2010.nc

1. subtract 273.15 from all values to convert the data from K to degC
2. shift the time back 1 sec to get the correct time interval for further operations
3. compute the daily mean

And for precipitation following your commands:

cdo -daysum -shifttime,-1sec -mulc,1000 era5land_tp_hourly_ene-dic_1981-2010.nc era5land_tp-mm_daily_1981-2010.nc

output file: era5land_tp-mm_daily_1981-2010.nc
input file: era5land_tp_hourly_ene-dic_1981-2010.nc

1. multiply all values with 1000 to get mm
2. shift the time back 1 sec to get the correct time interval for further operations
3. compute the daily sum

RE: ERA5: hourly to daily values - Added by Brian Yalle almost 3 years ago

If anyone still has doubts about converting precipitation and temperature data from ERA5, you can watch a video that provides more useful and detailed information: [[https://www.youtube.com/watch?v=pD1r12pklEo]]

RE: ERA5: hourly to daily values - Added by Ralf Mueller almost 3 years ago

thx for the link, Brian. that's a nice channel - I added it to the list of documentation.

cheers
ralf

RE: ERA5: hourly to daily values - Added by Brian Yalle almost 3 years ago

Good to know it! I think the idea is trying to help each other .

RE: ERA5: hourly to daily values - Added by Emre Salkım almost 2 years ago

Hi all,

Thank you all for these valuable discussion. I wouldn't be able to figure this out without you all.
I would like to ask one more final question (I guess).

After carrying out all the necessary steps mentioned earlier in this post,
do I need to shift my final NetCDF file 1 day forward to obtain the correct dates?

Yours,
Emre

    (1-7/7)