Project

General

Profile

NetCDF time issues

Added by Brad Udall over 6 years ago

Hi,
I'm working with a netCDF generated by NCAR's CLM and I think there is something odd with the times, but I don't know enough to debug the problem.

Here's an ncdump -h:

ncdump -h run_extlow001_iv3p_00.2040y_selvar.nc
netcdf run_extlow001_iv3p_00.2040y_selvar {
dimensions:
time = UNLIMITED ; // (252 currently)
lat = 96 ;
lon = 144 ;
lev = 26 ;
tbnd = 2 ;
variables:

<removed a bunch of variables here...>

double time(time) ;
time:long_name = "time" ;
time:units = "days since 0001-01-01 00:00:00" ;
time:calendar = "noleap" ;
time:bounds = "time_bnds" ;
double time_bnds(time, tbnd) ;
time_bnds:long_name = "time interval endpoints" ;

The time bounds look like:
6935 6966
6966 6944
and so on

the above seems to describe a 31 day month, followed by a 28 day month (February)
This leads me to believe this file is 252 months, running from a January and ending at the end of December, 21 years later (21*12=252 months)

cdo showtimestamp <file name> give me a long list of times that start here:

0020-02-01T00:00:00 0020-03-01T00:00:00 0020-04-01T00:00:00 <many more>

and ends with..
0040-11-01T00:00:00 0040-12-01T00:00:00 0041-01-01T00:00:00

cdo showdate <file name> also shows a February first month and January last month.

I'm reasonably certain this file with 252 months does not run from February and end in January but I think this is what the showtimestamp / showdate shows.

This seems like a problem that needs fixing before I do anything else.

How do I debug what the problem here is?

thank you.


Replies (3)

RE: NetCDF time issues - Added by Brad Udall over 6 years ago

Here's a ncdump -c output.

It is curious that the time variable starts at 6966 and not 6935. That's a February start, I think.
(Although the whole days since 0001-01-01 is a bit of a mystery to me given the 'no-leap specification'.)

Also note the nrccat command. It starts with a file 0020-01 and ends with 0040-12. This file should start with January, end in December.

ncdump -c run_extlow001_iv3p_00.2040y_selvar.nc 
netcdf run_extlow001_iv3p_00.2040y_selvar {
dimensions:
time = UNLIMITED ; // (252 currently)
lat = 96 ;
lon = 144 ;
lev = 26 ;
tbnd = 2 ;
variables:
float CLDHGH(time, lat, lon) ;
CLDHGH:Sampling_Sequence = "rad_lwsw" ;
CLDHGH:units = "fraction" ;
CLDHGH:long_name = "Vertically-integrated high cloud" ;
CLDHGH:cell_methods = "time: mean" ;
float FLNT(time, lat, lon) ;
FLNT:Sampling_Sequence = "rad_lwsw" ;
FLNT:units = "W/m2" ;
FLNT:long_name = "Net longwave flux at top of model" ;
FLNT:cell_methods = "time: mean" ;
float ICEFRAC(time, lat, lon) ;
ICEFRAC:units = "fraction" ;
ICEFRAC:long_name = "Fraction of sfc area covered by sea-ice" ;
ICEFRAC:cell_methods = "time: mean" ;
float OMEGA(time, lev, lat, lon) ;
OMEGA:units = "Pa/s" ;
OMEGA:long_name = "Vertical velocity (pressure)" ;
OMEGA:cell_methods = "time: mean" ;
float PRECT(time, lat, lon) ;
PRECT:units = "m/s" ;
PRECT:long_name = "Total (convective and large-scale) precipitation rate (liq + ice)" ;
PRECT:cell_methods = "time: mean" ;
float PS(time, lat, lon) ;
PS:units = "Pa" ;
PS:long_name = "Surface pressure" ;
PS:cell_methods = "time: mean" ;
float TROP_T(time, lat, lon) ;
TROP_T:_FillValue = 1.e+36f ;
TROP_T:missing_value = 1.e+36f ;
TROP_T:units = "K" ;
TROP_T:long_name = "Tropopause Temperature" ;
TROP_T:cell_methods = "time: mean" ;
float TS(time, lat, lon) ;
TS:units = "K" ;
TS:long_name = "Surface temperature (radiative)" ;
TS:cell_methods = "time: mean" ;
float U(time, lev, lat, lon) ;
U:units = "m/s" ;
U:long_name = "Zonal wind" ;
U:cell_methods = "time: mean" ;
float V(time, lev, lat, lon) ;
V:units = "m/s" ;
V:long_name = "Meridional wind" ;
V:cell_methods = "time: mean" ;
float Z3(time, lev, lat, lon) ;
Z3:units = "m" ;
Z3:long_name = "Geopotential Height (above sea level)" ;
Z3:cell_methods = "time: mean" ;
double lat(lat) ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
double lev(lev) ;
lev:long_name = "hybrid level at midpoints (1000*(A+B))" ;
lev:units = "level" ;
lev:positive = "down" ;
lev:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate" ;
lev:formula_terms = "a: hyam b: hybm p0: P0 ps: PS" ;
double lon(lon) ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
double time(time) ;
time:long_name = "time" ;
time:units = "days since 0001-01-01 00:00:00" ;
time:calendar = "noleap" ;
time:bounds = "time_bnds" ;
double time_bnds(time, tbnd) ;
time_bnds:long_name = "time interval endpoints" ;

// global attributes:
:Conventions = "CF-1.0" ;
:source = "CAM" ;
:case = "run_extlow001_iv3p" ;
:title = "UNSET" ;
:logname = "ivanacv" ;
:host = "sierra647" ;
:Version = "$Name$" ;
:revision_Id = "$Id$" ;
:initial_file = "/p/lscratche/cuqrusr/ccsm3data/inputdata/atm/cam/inic/fv/cami_0000-01-01_1.9x2.5_L26_c070408.nc" ;
:topography_file = "/p/lscratche/cuqrusr/ccsm3data/inputdata/atm/cam/topo/USGS-gtopo30_1.9x2.5_remap_c050602.nc" ;
:history = "Wed Oct 11 19:05:29 2017: ncks -v ICEFRAC,PRECT,TS,PS,TROP_T,Z3,U,V,CLDHGH,FLNT,OMEGA run_extlow001_iv3p.2040y.nc run_extlow001_iv3p.2040y_selvar.nc\n",
"Mon Jul 6 15:53:48 2015: ncrcat run_extlow001_iv3p.cam2.h0.0020-01.nc run_extlow001_iv3p.cam2.h0.0020-02.nc run_extlow001_iv3p.cam2.h0.0020-03.nc run_extlow001_iv3p.cam2.h0.0020-04.nc run_extlow001_iv3p.cam2.h0.0020-05.nc run_extlow001_iv3p.cam2.h0.0020-06.nc run_extlow001_iv3p.cam2.h0.0020-07.nc run_extlow001_iv3p.cam2.h0.0020-08.nc run_extlow001_iv3p.cam2.h0.0020-09.nc run_extlow001_iv3p.cam2.h0.0020-10.nc run_extlow001_iv3p.cam2.h0.0020-11.nc run_extlow001_iv3p.cam2.h0.0020-12.nc run_extlow001_iv3p.cam2.h0.0021-01.nc run_extlow001_iv3p.cam2.h0.0021-02.nc run_extlow001_iv3p.cam2.h0.0021-03.nc run_extlow001_iv3p.cam2.h0.0021-04.nc run_extlow001_iv3p.cam2.h0.0021-05.nc run_extlow001_iv3p.cam2.h0.0021-06.nc run_extlow001_iv3p.cam2.h0.0021-07.nc run_extlow001_iv3p.cam2.h0.0021-08.nc run_extlow001_iv3p.cam2.h0.0021-09.nc run_extlow001_iv3p.cam2.h0.0021-10.nc run_extlow001_iv3p.cam2.h0.0021-11.nc run_extlow001_iv3p.cam2.h0.0021-12.nc run_extlow001_iv3p.cam2.h0.0022-01.nc run_extlow001_iv3p.cam2.h0.0022-02.nc run_extlow001_iv3p.cam2.h0.0022-03.nc run_extlow001_iv3p.cam2.h0.0022-04.nc run_extlow001_iv3p.cam2.h0.0022-05.nc run_extlow001_iv3p.cam2.h0.0022-06.nc run_extlow001_iv3p.cam2.h0.0022-07.nc run_extlow001_iv3p.cam2.h0.0022-08.nc run_extlow001_iv3p.cam2.h0.0022-09.nc run_extlow001_iv3p.cam2.h0.0022-10.nc run_extlow001_iv3p.cam2.h0.0022-11.nc run_extlow001_iv3p.cam2.h0.0022-12.nc run_extlow001_iv3p.cam2.h0.0023-01.nc run_extlow001_iv3p.cam2.h0.0023-02.nc run_extlow001_iv3p.cam2.h0.0023-03.nc run_extlow001_iv3p.cam2.h0.0023-04.nc run_extlow001_iv3p.cam2.h0.0023-05.nc run_extlow001_iv3p.cam2.h0.0023-06.nc run_extlow001_iv3p.cam2.h0.0023-07.nc run_extlow001_iv3p.cam2.h0.0023-08.nc run_extlow001_iv3p.cam2.h0.0023-09.nc run_extlow001_iv3p.cam2.h0.0023-10.nc run_extlow001_iv3p.cam2.h0.0023-11.nc run_extlow001_iv3p.cam2.h0.0023-12.nc run_extlow001_iv3p.cam2.h0.0024-01.nc run_extlow001_iv3p.cam2.h0.0024-02.nc run_extlow001_iv3p.cam2.h0.0024-03.nc run_extlow001_iv3p.cam2.h0.0024-04.nc run_extlow001_iv3p.cam2.h0.0024-05.nc run_extlow001_iv3p.cam2.h0.0024-06.nc run_extlow001_iv3p.cam2.h0.0024-07.nc run_extlow001_iv3p.cam2.h0.0024-08.nc run_extlow001_iv3p.cam2.h0.0024-09.nc run_extlow001_iv3p.cam2.h0.0024-10.nc run_extlow001_iv3p.cam2.h0.0024-11.nc run_extlow001_iv3p.cam2.h0.0024-12.nc run_extlow001_iv3p.cam2.h0.0025-01.nc run_extlow001_iv3p.cam2.h0.0025-02.nc run_extlow001_iv3p.cam2.h0.0025-03.nc run_extlow001_iv3p.cam2.h0.0025-04.nc run_extlow001_iv3p.cam2.h0.0025-05.nc run_extlow001_iv3p.cam2.h0.0025-06.nc run_extlow001_iv3p.cam2.h0.0025-07.nc run_extlow001_iv3p.cam2.h0.0025-08.nc run_extlow001_iv3p.cam2.h0.0025-09.nc run_extlow001_iv3p.cam2.h0.0025-10.nc run_extlow001_iv3p.cam2.h0.0025-11.nc run_extlow001_iv3p.cam2.h0.0025-12.nc run_extlow001_iv3p.cam2.h0.0026-01.nc run_extlow001_iv3p.cam2.h0.0026-02.nc run_extlow001_iv3p.cam2.h0.0026-03.nc run_extlow001_iv3p.cam2.h0.0026-04.nc run_extlow001_iv3p.cam2.h0.0026-05.nc run_extlow001_iv3p.cam2.h0.0026-06.nc run_extlow001_iv3p.cam2.h0.0026-07.nc run_extlow001_iv3p.cam2.h0.0026-08.nc run_extlow001_iv3p.cam2.h0.0026-09.nc run_extlow001_iv3p.cam2.h0.0026-10.nc run_extlow001_iv3p.cam2.h0.0026-11.nc run_extlow001_iv3p.cam2.h0.0026-12.nc run_extlow001_iv3p.cam2.h0.0027-01.nc run_extlow001_iv3p.cam2.h0.0027-02.nc run_extlow001_iv3p.cam2.h0.0027-03.nc run_extlow001_iv3p.cam2.h0.0027-04.nc run_extlow001_iv3p.cam2.h0.0027-05.nc run_extlow001_iv3p.cam2.h0.0027-06.nc run_extlow001_iv3p.cam2.h0.0027-07.nc run_extlow001_iv3p.cam2.h0.0027-08.nc run_extlow001_iv3p.cam2.h0.0027-09.nc run_extlow001_iv3p.cam2.h0.0027-10.nc run_extlow001_iv3p.cam2.h0.0027-11.nc run_extlow001_iv3p.cam2.h0.0027-12.nc run_extlow001_iv3p.cam2.h0.0028-01.nc run_extlow001_iv3p.cam2.h0.0028-02.nc run_extlow001_iv3p.cam2.h0.0028-03.nc run_extlow001_iv3p.cam2.h0.0028-04.nc run_extlow001_iv3p.cam2.h0.0028-05.nc run_extlow001_iv3p.cam2.h0.0028-06.nc run_extlow001_iv3p.cam2.h0.0028-07.nc run_extlow001_iv3p.cam2.h0.0028-08.nc run_extlow001_iv3p.cam2.h0.0028-09.nc run_extlow001_iv3p.cam2.h0.0028-10.nc run_extlow001_iv3p.cam2.h0.0028-11.nc run_extlow001_iv3p.cam2.h0.0028-12.nc run_extlow001_iv3p.cam2.h0.0029-01.nc run_extlow001_iv3p.cam2.h0.0029-02.nc run_extlow001_iv3p.cam2.h0.0029-03.nc run_extlow001_iv3p.cam2.h0.0029-04.nc run_extlow001_iv3p.cam2.h0.0029-05.nc run_extlow001_iv3p.cam2.h0.0029-06.nc run_extlow001_iv3p.cam2.h0.0029-07.nc run_extlow001_iv3p.cam2.h0.0029-08.nc run_extlow001_iv3p.cam2.h0.0029-09.nc run_extlow001_iv3p.cam2.h0.0029-10.nc run_extlow001_iv3p.cam2.h0.0029-11.nc run_extlow001_iv3p.cam2.h0.0029-12.nc run_extlow001_iv3p.cam2.h0.0030-01.nc run_extlow001_iv3p.cam2.h0.0030-02.nc run_extlow001_iv3p.cam2.h0.0030-03.nc run_extlow001_iv3p.cam2.h0.0030-04.nc run_extlow001_iv3p.cam2.h0.0030-05.nc run_extlow001_iv3p.cam2.h0.0030-06.nc run_extlow001_iv3p.cam2.h0.0030-07.nc run_extlow001_iv3p.cam2.h0.0030-08.nc run_extlow001_iv3p.cam2.h0.0030-09.nc run_extlow001_iv3p.cam2.h0.0030-10.nc run_extlow001_iv3p.cam2.h0.0030-11.nc run_extlow001_iv3p.cam2.h0.0030-12.nc run_extlow001_iv3p.cam2.h0.0031-01.nc run_extlow001_iv3p.cam2.h0.0031-02.nc run_extlow001_iv3p.cam2.h0.0031-03.nc run_extlow001_iv3p.cam2.h0.0031-04.nc run_extlow001_iv3p.cam2.h0.0031-05.nc run_extlow001_iv3p.cam2.h0.0031-06.nc run_extlow001_iv3p.cam2.h0.0031-07.nc run_extlow001_iv3p.cam2.h0.0031-08.nc run_extlow001_iv3p.cam2.h0.0031-09.nc run_extlow001_iv3p.cam2.h0.0031-10.nc run_extlow001_iv3p.cam2.h0.0031-11.nc run_extlow001_iv3p.cam2.h0.0031-12.nc run_extlow001_iv3p.cam2.h0.0032-01.nc run_extlow001_iv3p.cam2.h0.0032-02.nc run_extlow001_iv3p.cam2.h0.0032-03.nc run_extlow001_iv3p.cam2.h0.0032-04.nc run_extlow001_iv3p.cam2.h0.0032-05.nc run_extlow001_iv3p.cam2.h0.0032-06.nc run_extlow001_iv3p.cam2.h0.0032-07.nc run_extlow001_iv3p.cam2.h0.0032-08.nc run_extlow001_iv3p.cam2.h0.0032-09.nc run_extlow001_iv3p.cam2.h0.0032-10.nc run_extlow001_iv3p.cam2.h0.0032-11.nc run_extlow001_iv3p.cam2.h0.0032-12.nc run_extlow001_iv3p.cam2.h0.0033-01.nc run_extlow001_iv3p.cam2.h0.0033-02.nc run_extlow001_iv3p.cam2.h0.0033-03.nc run_extlow001_iv3p.cam2.h0.0033-04.nc run_extlow001_iv3p.cam2.h0.0033-05.nc run_extlow001_iv3p.cam2.h0.0033-06.nc run_extlow001_iv3p.cam2.h0.0033-07.nc run_extlow001_iv3p.cam2.h0.0033-08.nc run_extlow001_iv3p.cam2.h0.0033-09.nc run_extlow001_iv3p.cam2.h0.0033-10.nc run_extlow001_iv3p.cam2.h0.0033-11.nc run_extlow001_iv3p.cam2.h0.0033-12.nc run_extlow001_iv3p.cam2.h0.0034-01.nc run_extlow001_iv3p.cam2.h0.0034-02.nc run_extlow001_iv3p.cam2.h0.0034-03.nc run_extlow001_iv3p.cam2.h0.0034-04.nc run_extlow001_iv3p.cam2.h0.0034-05.nc run_extlow001_iv3p.cam2.h0.0034-06.nc run_extlow001_iv3p.cam2.h0.0034-07.nc run_extlow001_iv3p.cam2.h0.0034-08.nc run_extlow001_iv3p.cam2.h0.0034-09.nc run_extlow001_iv3p.cam2.h0.0034-10.nc run_extlow001_iv3p.cam2.h0.0034-11.nc run_extlow001_iv3p.cam2.h0.0034-12.nc run_extlow001_iv3p.cam2.h0.0035-01.nc run_extlow001_iv3p.cam2.h0.0035-02.nc run_extlow001_iv3p.cam2.h0.0035-03.nc run_extlow001_iv3p.cam2.h0.0035-04.nc run_extlow001_iv3p.cam2.h0.0035-05.nc run_extlow001_iv3p.cam2.h0.0035-06.nc run_extlow001_iv3p.cam2.h0.0035-07.nc run_extlow001_iv3p.cam2.h0.0035-08.nc run_extlow001_iv3p.cam2.h0.0035-09.nc run_extlow001_iv3p.cam2.h0.0035-10.nc run_extlow001_iv3p.cam2.h0.0035-11.nc run_extlow001_iv3p.cam2.h0.0035-12.nc run_extlow001_iv3p.cam2.h0.0036-01.nc run_extlow001_iv3p.cam2.h0.0036-02.nc run_extlow001_iv3p.cam2.h0.0036-03.nc run_extlow001_iv3p.cam2.h0.0036-04.nc run_extlow001_iv3p.cam2.h0.0036-05.nc run_extlow001_iv3p.cam2.h0.0036-06.nc run_extlow001_iv3p.cam2.h0.0036-07.nc run_extlow001_iv3p.cam2.h0.0036-08.nc run_extlow001_iv3p.cam2.h0.0036-09.nc run_extlow001_iv3p.cam2.h0.0036-10.nc run_extlow001_iv3p.cam2.h0.0036-11.nc run_extlow001_iv3p.cam2.h0.0036-12.nc run_extlow001_iv3p.cam2.h0.0037-01.nc run_extlow001_iv3p.cam2.h0.0037-02.nc run_extlow001_iv3p.cam2.h0.0037-03.nc run_extlow001_iv3p.cam2.h0.0037-04.nc run_extlow001_iv3p.cam2.h0.0037-05.nc run_extlow001_iv3p.cam2.h0.0037-06.nc run_extlow001_iv3p.cam2.h0.0037-07.nc run_extlow001_iv3p.cam2.h0.0037-08.nc run_extlow001_iv3p.cam2.h0.0037-09.nc run_extlow001_iv3p.cam2.h0.0037-10.nc run_extlow001_iv3p.cam2.h0.0037-11.nc run_extlow001_iv3p.cam2.h0.0037-12.nc run_extlow001_iv3p.cam2.h0.0038-01.nc run_extlow001_iv3p.cam2.h0.0038-02.nc run_extlow001_iv3p.cam2.h0.0038-03.nc run_extlow001_iv3p.cam2.h0.0038-04.nc run_extlow001_iv3p.cam2.h0.0038-05.nc run_extlow001_iv3p.cam2.h0.0038-06.nc run_extlow001_iv3p.cam2.h0.0038-07.nc run_extlow001_iv3p.cam2.h0.0038-08.nc run_extlow001_iv3p.cam2.h0.0038-09.nc run_extlow001_iv3p.cam2.h0.0038-10.nc run_extlow001_iv3p.cam2.h0.0038-11.nc run_extlow001_iv3p.cam2.h0.0038-12.nc run_extlow001_iv3p.cam2.h0.0039-01.nc run_extlow001_iv3p.cam2.h0.0039-02.nc run_extlow001_iv3p.cam2.h0.0039-03.nc run_extlow001_iv3p.cam2.h0.0039-04.nc run_extlow001_iv3p.cam2.h0.0039-05.nc run_extlow001_iv3p.cam2.h0.0039-06.nc run_extlow001_iv3p.cam2.h0.0039-07.nc run_extlow001_iv3p.cam2.h0.0039-08.nc run_extlow001_iv3p.cam2.h0.0039-09.nc run_extlow001_iv3p.cam2.h0.0039-10.nc run_extlow001_iv3p.cam2.h0.0039-11.nc run_extlow001_iv3p.cam2.h0.0039-12.nc run_extlow001_iv3p.cam2.h0.0040-01.nc run_extlow001_iv3p.cam2.h0.0040-02.nc run_extlow001_iv3p.cam2.h0.0040-03.nc run_extlow001_iv3p.cam2.h0.0040-04.nc run_extlow001_iv3p.cam2.h0.0040-05.nc run_extlow001_iv3p.cam2.h0.0040-06.nc run_extlow001_iv3p.cam2.h0.0040-07.nc run_extlow001_iv3p.cam2.h0.0040-08.nc run_extlow001_iv3p.cam2.h0.0040-09.nc run_extlow001_iv3p.cam2.h0.0040-10.nc run_extlow001_iv3p.cam2.h0.0040-11.nc run_extlow001_iv3p.cam2.h0.0040-12.nc run_extlow001_iv3p.2040y.nc" ;
:nco_openmp_thread_number = 1 ;
:NCO = "4.2.5" ;
data:

lat = -90, -88.1052631578947, -86.2105263157895, -84.3157894736842, 
-82.4210526315789, -80.5263157894737, -78.6315789473684,
-76.7368421052632, -74.8421052631579, -72.9473684210526,
-71.0526315789474, -69.1578947368421, -67.2631578947368,
-65.3684210526316, -63.4736842105263, -61.5789473684211,
-59.6842105263158, -57.7894736842105, -55.8947368421053, -54,
-52.1052631578947, -50.2105263157895, -48.3157894736842,
-46.421052631579, -44.5263157894737, -42.6315789473684,
-40.7368421052632, -38.8421052631579, -36.9473684210526,
-35.0526315789474, -33.1578947368421, -31.2631578947368,
-29.3684210526316, -27.4736842105263, -25.5789473684211,
-23.6842105263158, -21.7894736842105, -19.8947368421053, -18,
-16.1052631578947, -14.2105263157895, -12.3157894736842,
-10.4210526315789, -8.52631578947368, -6.63157894736842,
-4.73684210526316, -2.8421052631579, -0.94736842105263, 0.94736842105263,
2.84210526315789, 4.73684210526315, 6.63157894736841, 8.52631578947368,
10.4210526315789, 12.3157894736842, 14.2105263157895, 16.1052631578947,
18, 19.8947368421053, 21.7894736842105, 23.6842105263158,
25.578947368421, 27.4736842105263, 29.3684210526316, 31.2631578947368,
33.1578947368421, 35.0526315789474, 36.9473684210526, 38.8421052631579,
40.7368421052632, 42.6315789473684, 44.5263157894737, 46.4210526315789,
48.3157894736842, 50.2105263157895, 52.1052631578947, 54,
55.8947368421053, 57.7894736842105, 59.6842105263158, 61.578947368421,
63.4736842105263, 65.3684210526316, 67.2631578947368, 69.1578947368421,
71.0526315789474, 72.9473684210526, 74.8421052631579, 76.7368421052632,
78.6315789473684, 80.5263157894737, 82.4210526315789, 84.3157894736842,
86.2105263157895, 88.1052631578947, 90 ;
lev = 3.54463800000001, 7.38881350000001, 13.967214, 23.944625, 
37.2302900000001, 53.1146050000002, 70.0591500000003, 85.4391150000003,
100.514695, 118.250335, 139.115395, 163.66207, 192.539935, 226.513265,
266.481155, 313.501265000001, 368.817980000002, 433.895225000001,
510.455255000002, 600.524200000003, 696.796290000003, 787.702060000003,
867.160760000001, 929.648875000002, 970.554830000001, 992.5561 ;
lon = 0, 2.5, 5, 7.5, 10, 12.5, 15, 17.5, 20, 22.5, 25, 27.5, 30, 32.5, 35, 
37.5, 40, 42.5, 45, 47.5, 50, 52.5, 55, 57.5, 60, 62.5, 65, 67.5, 70,
72.5, 75, 77.5, 80, 82.5, 85, 87.5, 90, 92.5, 95, 97.5, 100, 102.5, 105,
107.5, 110, 112.5, 115, 117.5, 120, 122.5, 125, 127.5, 130, 132.5, 135,
137.5, 140, 142.5, 145, 147.5, 150, 152.5, 155, 157.5, 160, 162.5, 165,
167.5, 170, 172.5, 175, 177.5, 180, 182.5, 185, 187.5, 190, 192.5, 195,
197.5, 200, 202.5, 205, 207.5, 210, 212.5, 215, 217.5, 220, 222.5, 225,
227.5, 230, 232.5, 235, 237.5, 240, 242.5, 245, 247.5, 250, 252.5, 255,
257.5, 260, 262.5, 265, 267.5, 270, 272.5, 275, 277.5, 280, 282.5, 285,
287.5, 290, 292.5, 295, 297.5, 300, 302.5, 305, 307.5, 310, 312.5, 315,
317.5, 320, 322.5, 325, 327.5, 330, 332.5, 335, 337.5, 340, 342.5, 345,
347.5, 350, 352.5, 355, 357.5 ;
time = 6966, 6994, 7025, 7055, 7086, 7116, 7147, 7178, 7208, 7239, 7269, 
7300, 7331, 7359, 7390, 7420, 7451, 7481, 7512, 7543, 7573, 7604, 7634,
7665, 7696, 7724, 7755, 7785, 7816, 7846, 7877, 7908, 7938, 7969, 7999,
8030, 8061, 8089, 8120, 8150, 8181, 8211, 8242, 8273, 8303, 8334, 8364,
8395, 8426, 8454, 8485, 8515, 8546, 8576, 8607, 8638, 8668, 8699, 8729,
8760, 8791, 8819, 8850, 8880, 8911, 8941, 8972, 9003, 9033, 9064, 9094,
9125, 9156, 9184, 9215, 9245, 9276, 9306, 9337, 9368, 9398, 9429, 9459,
9490, 9521, 9549, 9580, 9610, 9641, 9671, 9702, 9733, 9763, 9794, 9824,
9855, 9886, 9914, 9945, 9975, 10006, 10036, 10067, 10098, 10128, 10159,
10189, 10220, 10251, 10279, 10310, 10340, 10371, 10401, 10432, 10463,
10493, 10524, 10554, 10585, 10616, 10644, 10675, 10705, 10736, 10766,
10797, 10828, 10858, 10889, 10919, 10950, 10981, 11009, 11040, 11070,
11101, 11131, 11162, 11193, 11223, 11254, 11284, 11315, 11346, 11374,
11405, 11435, 11466, 11496, 11527, 11558, 11588, 11619, 11649, 11680,
11711, 11739, 11770, 11800, 11831, 11861, 11892, 11923, 11953, 11984,
12014, 12045, 12076, 12104, 12135, 12165, 12196, 12226, 12257, 12288,
12318, 12349, 12379, 12410, 12441, 12469, 12500, 12530, 12561, 12591,
12622, 12653, 12683, 12714, 12744, 12775, 12806, 12834, 12865, 12895,
12926, 12956, 12987, 13018, 13048, 13079, 13109, 13140, 13171, 13199,
13230, 13260, 13291, 13321, 13352, 13383, 13413, 13444, 13474, 13505,
13536, 13564, 13595, 13625, 13656, 13686, 13717, 13748, 13778, 13809,
13839, 13870, 13901, 13929, 13960, 13990, 14021, 14051, 14082, 14113,
14143, 14174, 14204, 14235, 14266, 14294, 14325, 14355, 14386, 14416,
14447, 14478, 14508, 14539, 14569, 14600 ;
}

RE: NetCDF time issues - Added by Brad Udall over 6 years ago

So the answer seems to be that the time array is storing the end of the time period, not the beginning. Is this normal?

CDO seems to want the time array to indicate the beginning of the period.

I suppose I could just rewrite the time array to shift all the numbers in it down by 1, add 6935 for element 1, and get rid of the last entry, keeping it at 252 timesteps.

(Anyone want to suggest the write CDO command to do this?)

Any other suggestions on what is going on here?

Can I tell CDO that the times are at the end of the period and not do any rewriting?

The time bounds array has the correct begin/end times, but it seems to be ignored by CDO.

Thanks

Brad

RE: NetCDF time issues - Added by Karin Meier-Fleischer over 6 years ago

Hi Brad,

can you upload your netcdf file.

You have monthly data and the time units is 'days since'. Using the time data from the ncdump output of the first 10 dates (6966, 6994, 7025, 7055, 7086, 7116, 7147, 7178, 7208, 7239) the resulting date of the variable time are:

Date: 0020/01/28 00:00
Date: 0020/02/25 00:00
Date: 0020/03/27 00:00
Date: 0020/04/26 00:00
Date: 0020/05/27 00:00
Date: 0020/06/26 00:00
Date: 0020/07/27 00:00
Date: 0020/08/27 00:00
Date: 0020/09/26 00:00
Date: 0020/10/27 00:00

There is a typo in the second line of your time_bnds example (6935,6966),(6966, 6944 ). The resulting date of your time_bnds are:

Time bounds(0): 0019/12/28 00:00 0020/01/28 00:00
Time bounds(1): 0020/01/28 00:00 0020/01/06 00:00 <--

Maybe this will do what you want

cdo -r settaxis,0020-01-01,00:00:00,1mon run_extlow001_iv3p_00.2040y_selvar.nc outfile.nc

-Karin

    (1-3/3)