Project

General

Profile

problem in leap year

Added by Ali Mirzaei over 12 years ago

Hi

I did split yearly data (with 3 hourly time step) to monthly data by:

for yr in $(seq 1979 2008)
do
for m in 4(seq 1 12)
do
cdo selsmon,${i} wind_${i}.nc wind_${yr}_${m}.nc
done
done

it works fine but in takes the year before leap-year as a leap-year. for example for year 2008 which is a leap year
it considers 2007 as a leap-year and sorts the data.

any help is highly appreciated.

cheers
Ali


Replies (4)

RE: problem in leap year - Added by Jaison-Thomas Ambadan over 12 years ago

Hi,

Can you please upload a sample of your data?

By the way, did you try "splitmon" operator? From "cdo -h splitmon":

/*
splitmon Split months
Splits a file into pieces, one for each different month.
xxx will have two digits with the month.
*/

Hope this helps!

Cheers,
J.

RE: problem in leap year - Added by Ali Mirzaei over 12 years ago

splitmon behaves same as selsmon and problem is still there.

see the uploaded file.

RE: problem in leap year - Added by Jaison-Thomas Ambadan over 12 years ago

Hi,

In your file, the time axis says( from ncdump -h):

double time(time) ;
time:long_name = "time" ;
time:units = "days since 1979-1-1 0:0:0" ;
time:axis = "T" ;

The time units are in days but cdo sinfo says it is in 3 hours (from your first post also says 3 hourly data)? I guess the problem is most likely due to this discrepancy. You may try setting the time axis properly by using the "-settaxis" or "-setdate", before applying "-splitmon" or "-selsmon".

I must admit that I didn't understood your problem correctly but may be others can help you with more info.

Cheers,
J.

RE: problem in leap year - Added by Ali Mirzaei over 12 years ago

Thanks J.

you were right and I set the time axis to 3 hourly and it works fine

cdo settaxis,1979-01-01,03:00:00,3hour ifile ofile
cdo splitmon ifile ofile

Cheers
Ali

    (1-4/4)