Project

General

Profile

accumulative rainfall calculation using daily data

Added by Farhan Saleem about 2 years ago

Hello,

I would appreciate it if someone can assist with a code to calculate 1, 3, and 5 days of accumulative rainfall exceeding the threshold of 20 mm.

Regards,
Farhan


Replies (5)

RE: accumulative rainfall calculation using daily data - Added by Estanislao Gavilan about 2 years ago

Hi Farhan,
this is a clear example of cdo with conditions. There are many posts on this forum about this.

https://code.mpimet.mpg.de/boards/1/topics/12966

I think you can also use ifthen command. You need to check the manual and look for examples on the forum

There are also examples a about accumulative rainfall like this one
https://code.mpimet.mpg.de/boards/2/topics/4059?r=12623#message-12623

Try to draft a script and, then it will be easier for the devs to assist you.

Kind regards,

Estanislao

RE: accumulative rainfall calculation using daily data - Added by Farhan Saleem about 2 years ago

Hi Estanislao,

Thank you for the response and for sharing some useful links.

I used the below-mentioned commands to calculate 3 and 5 days of accumulative precipitation greater and equal to 10mm (can you please guide whether I did the calculations in the right way?)

cdo runsum,3 -gec,10 1day.precip.jja.1979.2022.nc 3day.precip.10mm.jja.1979.2022.nc
cdo runsum,5 -gec,10 1day.precip.jja.1979.2022.nc 5day.precip.10mm.jja.1979.2022.nc

The output files contain 1 (ones) and 0 (zeros) where the specified conditions are true and false. But I want the actual accumulative precipitation values, instead of 1 and 0 where the specified conditions are met (Is there any cdo command?).

For convenience, I also attached the input and output files.

Please help, thanks

Regards,
Farhan

RE: accumulative rainfall calculation using daily data - Added by Estanislao Gavilan about 2 years ago

hi Farhan,
I am not at home right now. However, that code is filtering the data that bigger or equal to 10 and then computes the runsum. I thought you want the opposite.

Kind regards,

Estanislao

RE: accumulative rainfall calculation using daily data - Added by Estanislao Gavilan about 2 years ago

hi Farhan,

if that what you want you can do this

cdo runsum,5 -mul 1day.precip.jja.1979.2022.nc -gec,10 1day.precip.jja.1979.2022.nc 5day.precip.10mm.jja.1979.2022.nc

Regards,

Estanislao

RE: accumulative rainfall calculation using daily data - Added by Farhan Saleem about 2 years ago

Dear Estanislao,

Thank you for your support.

Regards,
Farhan

    (1-5/5)