Project

General

Profile

inttime - year wrapping

Added by Brendan DeTracey over 9 years ago

Hi,

I am using inttime to interpolate climatological monthly averages to daily values. Is there a simple way to wrap time (prior to interpolation?) so that I can start my interpolation on Jan 1 12:00 and end it on Dec 31 12:00? At present I get interpolation from Jan 16 12:00 to Dec 15 12:00. Must I manually pad the data and edit the times for the padded records?

Thanks


Replies (4)

RE: inttime - year wrapping - Added by Jaison-Thomas Ambadan over 9 years ago

you could use settaxis operator to change the time axis

RE: inttime - year wrapping - Added by Brendan DeTracey over 9 years ago

I do not see how changing the time axis would solve my problem. I had to:
1. Copy first record (Jan) to the end of the data file and increment its year.
2. Copy the last record(December, before step 1) to the beginning of the data file and decrement its year.
3. Interpolate and trim

Did it this way and succeeded, but had to use four temporary files(splitsel does not pipe, which makes sense):
cdo splitsel,1,,12 prnet_2046-2065_rcp45_noneg.nc prnet_2046-2065_rcp45_noneg_2066_
cdo splitsel,1,11,12 prnet_2046-2065_rcp45_noneg.nc prnet_2046-2065_rcp45_noneg_2064_
cdo setyear,2064 prnet_2046-2065_rcp45_noneg_2064_000000.nc prnet_2046-2065_rcp45_noneg_2064.nc
cdo setyear,2066 prnet_2046-2065_rcp45_noneg_2066_000000.nc prnet_2046-2065_rcp45_noneg_2066.nc
cdo mergetime prnet_2046-2065_rcp45_noneg_2064.nc prnet_2046-2065_rcp45_noneg.nc prnet_2046-2065_rcp45_noneg_2066.nc test.nc
cdo selyear,2065 -inttime,2065-01-01,12:00:00,1day test.nc test2.nc

RE: inttime - year wrapping - Added by Jaison-Thomas Ambadan over 9 years ago

sorry I think I missundersood your question then. I guess you don't need to use splitsel though

Attached is a sample file, monthly values: pr_Amon_GFDL-CM3_rcp45_r1i1p1_206101-206512.nc

for example, to interpolate the monthly values of year 2062:

cdo -mergetime -selmon,12 -selyear,2061 pr_Amon_GFDL-CM3_rcp45_r1i1p1_206101-206512.nc -selyear,2062 pr_Amon_GFDL-CM3_rcp45_r1i1p1_206101-206512.nc -selmon,1 -selyear,2063 pr_Amon_GFDL-CM3_rcp45_r1i1p1_206101-206512.nc ifile.nc
cdo sinfo -selyear,2062 -inttime,2062-01-01,12:00:00,1day ifile.nc

RE: inttime - year wrapping - Added by Brendan DeTracey over 9 years ago

Yes. That is a much better solution than mine. Thanks.

    (1-4/4)