Project

General

Profile

cdo mergetime problem

Added by SUMAN MAITY over 6 years ago

Dear All
This is Suman Maity from IIT Kharagpur, India. I am facing a problem which is as follows.
I have 10 no. of netcdf files for 10 different year (1990-1999)each of having daily rainfall data for JJAS season (June, July, August and September i.e. for 122 days only). I want to find daily climatology considering those 10 years and anomaly for those.
I have tried to use mergetime to merge all the 10 files into a single file so that ydaymean can be used. But I have seen mergetime merges the files without considering the time stamp of different files. I want to mean at t=123 shows 1st october,1990 in stead of showing 1st, June 1991.
I couldn't understand how to find the daily climatology and anomaly.
Any kind of help will accepted.

Regards
Suman


Replies (4)

RE: cdo mergetime problem - Added by Karin Meier-Fleischer over 6 years ago

Hi Suman,

without your data files it is quiet difficult to reproduce the wrong date.

Using my test daily data (10 years: 2040-2049) e.g. starting at 2040-01-01 12:00:00

  1. create JJAS season data
  2. merge all 10 years of JJAS data
  3. compute ydaymean

The following Korn Shell script does these steps and the results are what I expect

#!/bin/ksh

for year in $(seq -w 2040 1 2049)
do 
  cdo -f nc select,season=JJAS days_${year}.nc days_JJAS_${year}.nc
done  

cdo mergetime 'days_JJAS_*.nc' days_JJAS_all_2040_2049.nc

cdo ydaymean days_JJAS_all_2040_2049.nc clim_2040_2049.nc

exit

days_JJAS_all_2040_2049.nc

timestep 1    : 2040-06-01 12:00:00
timestep 1220 : 2049-09-30 12:00:00

clim_2040_2049.nc

timestep 1    : 2049-06-01 12:00:0
timestep 122  : 2049-09-30 12:00:00

-Karin

RE: cdo mergetime problem - Added by SUMAN MAITY over 6 years ago

Hi
Karin
Thank you very much for your elaborate reply. I will be thankful if you share your test daily data or a sample of it.
Which version of the cdo, you are using?

With Regards
Suman

RE: cdo mergetime problem - Added by Karin Meier-Fleischer over 6 years ago

In this case the test files are CMIP5 atmos tas daily data and the CDO version is 1.9.0

-Karin

RE: cdo mergetime problem - Added by SUMAN MAITY over 6 years ago

Dear Karin
Yes you are wright. The output is correctly produced having 4 months in each year. But unfortunately when I am opening the data through grads, it creates problem. I mean t=5 gives next year june, t=6 gives next year july and so on. As I am using grads for figure generation, I don't have any other way to do. Do you have any solution for that?
Please reply.

With Regards
Suman

    (1-4/4)