Project

General

Profile

date information of output file from multi-year daily running statistical value functions

Added by Andries De Vries over 9 years ago

Hello All:)

Currently I m using cdo to calculate the 21-day running mean and standard deviation of daily ERA-Interim data. The input file is in grib format and contains the full timeserie of daily averaged (from 6-hourly data) geopotential height for all days in all months over the years 1979-2013 (30/31 days x 12 months x 35 years = ~12784 days). I used the command "cdo ydrunstd,21 {ifile} {ofile}" and "cdo ydrunmean,21 {ifile} {ofile}". The commands work fine, however, I feel slightly confused by the date information in the output file. Its time dimension has 366 values, obviously corresponding to the number of days in a year. However, when I read in the date information with NCL, I find a confusing order in the time dimension, starting at 29 February, then continues with 22 - 31 December, and then 1 Jan follows until 21 December (see the print of variable "date_STD" in the attached file). Is this shifted time order a consequence of the data availability during the calculations by cdo (e.g., the centered STD and MEAN for 22-31 December could not be calculated from the the last year 2013)? Or did I somehow use the cdo command inappropriate? Or may something incorrect in the format of the input file? I suppose the dates in the output file correspond to the centered day for which the running MEAN and STD are calculated.

Thank you very much for the help in advance!
Cheers
Andries

output-log3.txt (14.5 KB) output-log3.txt read in output file & time dimension with NCL

Replies (2)

RE: date information of output file from multi-year daily running statistical value functions - Added by Uwe Schulzweida over 9 years ago

The date information in an output field is the date of the timestep in the middle of the last contributing running window.
For the period 1978-01-01 to 2013-12-31 the date information of the 366 output timesteps is:

timestep  date
------------------
    1   2013-01-01
  ...   2013-..-..
   59   2013-02-28
   60   2012-02-29
   61   2013-03-01
  ...   2013-..-..
  356   2013-12-21
  357   2012-12-22
  ...   2012-..-..
  366   2012-12-31
Most of the timesteps have the year 2013 and some timesteps have the year 2012. The timesteps with the year 2012 are not available in a running 21 day window in 2013. I assume that NCL is sorting the timesteps by the date which might give wrong results. I would propose to set the year of all output timesteps to the same value. A good value with your data is 2012 because it contains the 29 February:
cdo setyear,2012 -ydrunmean,21 {ifile} {ofile}

RE: date information of output file from multi-year daily running statistical value functions - Added by Andries De Vries over 9 years ago

Thank you very much for the clear explanation. It is good to know that the calculation in cdo proceeded as intended. Following your suggestion, I will put set the year to 2012 in the outputfile to avoid confusion.
Best regards,
Andries

    (1-2/2)