Project

General

Profile

6hourly data record to climatology

Added by Estanislao Gavilan almost 2 years ago

Dear Community,

is it possible compute the 6h climatology (ie one dataset with 365*4 timesteps) from a 6h 10 years data record with (ie 10*365*4 time steps)? Thanks in advance for your help

Kind regards,

Estanilao


Replies (6)

RE: 6hourly data record to climatology - Added by Ralf Mueller almost 2 years ago

hi!

I think yhourmean is the operator you are looking for.

hth
ralf

RE: 6hourly data record to climatology - Added by Estanislao Gavilan almost 2 years ago

Hi Ralf,

so should I use this command?. Do you know if there is another flag to output in 366*4 and 365*4 time steps? Thanks in advance for all your help

cdo yhourmean,6hour infile.nc outfile.nc

RE: 6hourly data record to climatology - Added by Ralf Mueller almost 2 years ago

If you use 366 days calendar you might want to delete the 29Feb first. you can to this in same command line with the del29feb operator:

cdo -yhourmean -del29feb infile.nc outfile.nc

BTW: yhourmean does not take an argument because it just takes into account the hours of the input file. in your case it is 6-hourly-date, so it sticks to 6-hourly values. I think this should be fine for you, but please double check with analytic test cases or something like that. I used

cdo -s -infov -yhourmean -selyear,2001/2006 -del29feb -settaxis,2000-01-01,12:00:00,6hours -seq,1,$((365*4*10))
do simulate 6hourly input and the yhourmean operation on it.

hth
ralf

RE: 6hourly data record to climatology - Added by Estanislao Gavilan almost 2 years ago

Hi Ralf,
I have tried to use that command but something it feels a bit off. The output data is extremly heavy. As I mentioned before I have yearly data which I want to convert to climatology. In particular, I have 10 files (3.5G each). I tried to merge those files, but the output was about 130GB. Therefore, I decided to run this command

cd mergetime -yhourmean infile*.nc (ie. file_2005...2014.nc) outfile.nc

Since I did not get any error, I thought I would get a file about 3.5GB. The process has not finished yet and the file has already surprass the 60GB

RE: 6hourly data record to climatology - Added by Ralf Mueller almost 2 years ago

hi again!

Just to get this clear: with climatology you mean a 6-hourly-dataset, where each timestep is the mean value of all year from the exact same timestep (like 31.01 - 18:00). correct?

mergetime is not needed if your inputs are in temporal order already. This just creates additional work. you call

cdo mergetime -yhourmean infile*.nc
does not work, because yhourmean takes only a single input stream and mergetime takes an arbitrary number of files. Another this is the operator order: They are applied from right to left. So -mergetime -yhourmean is the reverse order of what you want.

Assuming that the files have reasonable names, which enforce the correct temporal order using a wildcard, you can use cat like this:

cdo -yhourmean -cat 'infile*.nc' output.nc
or
cdo -yhourmean -cat [ infile*nc ] output.nc

RE: 6hourly data record to climatology - Added by Estanislao Gavilan almost 2 years ago

Hi Ralf,

thanks so much for your help. Now, it  is working perfectly fine.

Best regards,

Estanislao

    (1-6/6)