# How to calculation of daily precipitation based on hourly precipitation rate - ERA5-Land hourly data from 1981 to present

**URL:** <https://forum.ecmwf.int/t/how-to-calculation-of-daily-precipitation-based-on-hourly-precipitation-rate-era5-land-hourly-data-from-1981-to-present/1303>\
**Category:** C3S - Datasets and Usage\
**Tags:** ifs, c3s, era5-land\
**Created:** [3 June 2020 07:20 UTC](https://forum.ecmwf.int/t/how-to-calculation-of-daily-precipitation-based-on-hourly-precipitation-rate-era5-land-hourly-data-from-1981-to-present/1303 "2020-06-03T07:20:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiangyi\_wang](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/x/bbe5ce/32.png) [@xiangyi\_wang](https://forum.ecmwf.int/u/xiangyi_wang)\
**Post date:** [3 June 2020 07:20 UTC](https://forum.ecmwf.int/t/how-to-calculation-of-daily-precipitation-based-on-hourly-precipitation-rate-era5-land-hourly-data-from-1981-to-present/1303/1 "2020-06-03T07:20:26Z")

</div>

```
The precipitation calculated by the following method is several times normal
daily_precipitation= xr.DataArray(name='prcp',data=(ds['tprate']-ds['sfrate']).groupby("time.dayofyear").sum('time'))\*3600\*1000 or
```

```
daily\_precipitation =xr.DataArray(name='prcp', data=(ds['tprate']-ds['sfrate']).resample(time='D', closed='right').sum(dim='time')\*3600\*1000
```

```
In the dataset description, Variable name is total precipitation（m） but in the downloaded file information total precipitation rate(m/s) ，I wonder if it's a descriptive mistake
```

---

<div class="post-metadata">

**Author:** ![Michela](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/m/898d66/32.png) [@Michela](https://forum.ecmwf.int/u/Michela)\
**Post date:** [4 June 2020 08:03 UTC](https://forum.ecmwf.int/t/how-to-calculation-of-daily-precipitation-based-on-hourly-precipitation-rate-era5-land-hourly-data-from-1981-to-present/1303/2 "2020-06-04T08:03:11Z")

</div>

Hi,

did you download the data from the toolbox or the CDS API?

Thanks

Michela

---

<div class="post-metadata">

**Author:** ![xiangyi\_wang](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/x/bbe5ce/32.png) [@xiangyi\_wang](https://forum.ecmwf.int/u/xiangyi_wang)\
**Post date:** [10 June 2020 09:27 UTC](https://forum.ecmwf.int/t/how-to-calculation-of-daily-precipitation-based-on-hourly-precipitation-rate-era5-land-hourly-data-from-1981-to-present/1303/3 "2020-06-10T09:27:42Z")

</div>

def select\_point(filepath,year, lon, lat):  
 # lon = 123.88  
 # lat = 34.88  
 # North = 34.88 + 0.1  
 # South = 34.88 - 0.1  
 # West = 123.88 - 0.1  
 # East = 123.88 + 0.1  
 # #  
 c = cdsapi.Client()  
 code = """  
 import cdstoolbox as ct  
 @ct.application(title='Extract a time series and plot graph')  
 @ct.output.download()  
 def application(var, year, lon , lat ):  
 data = ct.catalogue.retrieve(  
 'reanalysis-era5-land',# reanalysis-era5-single-levels # reanalysis-era5-land  
 {  
 'variable': var,  
 'grid': ['0.1', '0.1'],  
 #'product\_type': 'reanalysis',  
 'year': str(year),  
 'month': [  
 '01', '02', '03', '04', '05', '06',  
 '07', '08', '09', '10', '11', '12'  
 ],  
 'day': [  
 '01', '02', '03', '04', '05', '06',  
 '07', '08', '09', '10', '11', '12',  
 '13', '14', '15', '16', '17', '18',  
 '19', '20', '21', '22', '23', '24',  
 '25', '26', '27', '28', '29', '30',  
 '31'  
 ],  
 # 'time': [  
 # '00:00',   
 # '06:00',   
 # '12:00',   
 # '18:00',   
 # ],  
 'time': [  
 '00:00', '01:00', '02:00',  
 '03:00', '04:00', '05:00',  
 '06:00', '07:00', '08:00',  
 '09:00', '10:00', '11:00',  
 '12:00', '13:00', '14:00',  
 '15:00', '16:00', '17:00',  
 '18:00', '19:00', '20:00',  
 '21:00', '22:00', '23:00',  
 ],  
 'area':[53.560860,73.557701,13.159306,134.773926]  
 }  
 )  
 tem = ct.geo.extract\_point(data[0], lon=lon, lat=lat)  
 pre = ct.geo.extract\_point(data[1], lon=lon, lat=lat)  
 data\_daily\_max = ct.climate.daily\_max(tem)  
 data\_daily\_min = ct.climate.daily\_min(tem)  
 sf = ct.geo.extract\_point(data[2], lon=lon, lat=lat)  
 #ct.units.convert\_units(pre, 'mm h-1', source\_units='m s-1')  
 data = ([tem, pre,sf])  
 return data  
 """  
 kwargs = {  
 'var': ['2m\_temperature','total\_precipitation','snowfall'],  
 'year': year,  
 'lon': lon,  
 'lat': lat,  
 }  
 df = c.workflow(code, \*\*kwargs)  
 c.download(df,filepath)

---

<div class="post-metadata">

**Author:** ![Michela](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/m/898d66/32.png) [@Michela](https://forum.ecmwf.int/u/Michela)\
**Post date:** [12 June 2020 11:48 UTC](https://forum.ecmwf.int/t/how-to-calculation-of-daily-precipitation-based-on-hourly-precipitation-rate-era5-land-hourly-data-from-1981-to-present/1303/4 "2020-06-12T11:48:42Z")

</div>

Hi,

the toolbox converts total precipitation in m/s, please have a look at the following link:

[https://cds.climate.copernicus.eu/toolbox/doc/tutorials/3\_create\_a\_climate\_graph\_application\_for\_any\_point\_location/3\_create\_a\_climate\_graph\_application\_for\_any\_point\_location.html#b-retrieve-era5-hourly-data-on-single-levels-total-precipitation](https://cds.climate.copernicus.eu/toolbox/doc/tutorials/3_create_a_climate_graph_application_for_any_point_location/3_create_a_climate_graph_application_for_any_point_location.html#b-retrieve-era5-hourly-data-on-single-levels-total-precipitation)

Thanks

Michela
