[netcdfgroup] Question about ncdump and time values

​Hi,

I have a question about why "ncdump -t" sometimes returns a seconds value
of "60", when I thought the seconds values were supposed to fall between 0
to 59.

I'm sure there's some kind of rounding error, but am wondering if this can
be fixed.

The simple NetCDF file looks like this:

netcdf timetest {
dimensions:
time = 63 ;
variables:
float time(time) ;
time:units = "minutes since 2014-01-01" ;
data:

 time = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19,
    20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
    38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
    56, 57, 58, 59, 60, 61, 62 ;
}
​
Using the latest (4.3.3.1) version of ncdump, I used the "-t" option to
dump the string values of time.  Note that sometimes you get strings like
"2014-01-01" and other times it is "2014-01-01 00:00:60.000000".

I've had a few users complain about this, because they need the software to
return 01:00 (mm:ss) and not 00:60.

I attached the netcdf file.

Thanks,

--Mary

denton[268] ncdump -t timetest.nc
netcdf timetest {
dimensions:
time = 63 ;
variables:
float time(time) ;
time:units = "minutes since 2014-01-01" ;
data:

 time = "2014-01-01", "2014-01-01 00:00:60.000000",
    "2014-01-01 00:01:60.000000", "2014-01-01 00:02:60.000000",
    "2014-01-01 00:03:60.000000", "2014-01-01 00:04:60.000000",
    "2014-01-01 00:05:60.000000", "2014-01-01 00:06:60.000000",
    "2014-01-01 00:08:0.000000", "2014-01-01 00:09:0.000000",
    "2014-01-01 00:10:0.000000", "2014-01-01 00:11:0.000000",
    "2014-01-01 00:12:0.000000", "2014-01-01 00:13:0.000000",
    "2014-01-01 00:14:0.000000", "2014-01-01 00:15",
    "2014-01-01 00:15:60.000000", "2014-01-01 00:16:60.000000",
    "2014-01-01 00:17:60.000000", "2014-01-01 00:18:60.000000",
    "2014-01-01 00:19:60.000000", "2014-01-01 00:20:60.000000",
    "2014-01-01 00:21:60.000000", "2014-01-01 00:23:0.000000",
    "2014-01-01 00:24:0.000000", "2014-01-01 00:25:0.000000",
    "2014-01-01 00:26:0.000000", "2014-01-01 00:27:0.000000",
    "2014-01-01 00:28:0.000000", "2014-01-01 00:29:0.000000",
    "2014-01-01 00:30", "2014-01-01 00:30:60.000000",
    "2014-01-01 00:31:60.000000", "2014-01-01 00:32:60.000000",
    "2014-01-01 00:33:60.000000", "2014-01-01 00:34:60.000000",
    "2014-01-01 00:35:60.000000", "2014-01-01 00:36:60.000000",
    "2014-01-01 00:38:0.000000", "2014-01-01 00:39:0.000000",
    "2014-01-01 00:40:0.000000", "2014-01-01 00:41:0.000000",
    "2014-01-01 00:42:0.000000", "2014-01-01 00:43:0.000000",
    "2014-01-01 00:44:0.000000", "2014-01-01 00:45",
    "2014-01-01 00:45:60.000000", "2014-01-01 00:46:60.000000",
    "2014-01-01 00:47:60.000000", "2014-01-01 00:48:60.000000",
    "2014-01-01 00:49:60.000000", "2014-01-01 00:50:60.000000",
    "2014-01-01 00:51:60.000000", "2014-01-01 00:53:0.000000",
    "2014-01-01 00:54:0.000000", "2014-01-01 00:55:0.000000",
    "2014-01-01 00:56:0.000000", "2014-01-01 00:57:0.000000",
    "2014-01-01 00:58:0.000000", "2014-01-01 00:59:0.000000",
    "2014-01-01 01", "2014-01-01 01:00:60.000000",
    "2014-01-01 01:01:60.000000" ;
}

Attachment: timetest.nc
Description: Cdf file

  • 2015 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: