[gradsusr] GrADS v2.0.a7.oga.3: modifying time axis units

Charles Seman Charles.Seman at noaa.gov
Mon Mar 29 19:58:44 EDT 2010


GrADS Users Forum,

Using GrADS version:
---
Grid Analysis and Display System (GrADS) Version 2.0.a7.oga.3
...
Built Thu Oct 29 17:28:29 EDT 2009 for i686-pc-linux-gnu

This version of GrADS has been configured with the following options:
  o Built on a LITTLE ENDIAN machine
  o Command line editing ENABLED
      http://tiswww.case.edu/php/chet/readline/rltop.html
  o printim command for image output ENABLED
      http://www.zlib.net
      http://www.libpng.org/pub/png/libpng.html
      http://www.libgd.org/Main_Page
  o GRIB2 interface ENABLED
      http://www.ijg.org
      http://www.ece.uvic.ca/~mdadams/jasper
      http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2
      g2clib-1.0.5 
  o NetCDF interface ENABLED
      http://www.opendap.org
      libnc-dap 4.0.1-beta3-snapshot2009021712 of Feb 21 2009 14:55:15 $ 
  o HDF interface ENABLED
      http://hdfgroup.org
      HDF 4.2r3
      HDF5 1.8.2
  o Athena Widget GUI ENABLED
  o OPeNDAP gridded data interface ENABLED
      http://www.opendap.org
      libdap 3.7.10
  o OPeNDAP station data interface ENABLED
      http://iges.org/grads/gadoc/supplibs.html
      libgadap 2.0.oga.1 
  o GeoTIFF and KML output ENABLED
      http://www.libtiff.org
      http://geotiff.osgeo.org

---

I'm unable to modify the time axis units for an sdfwrite netCDF file 
using the following command:
'set sdfattr time String units "minutes since 1998-01-01 00:00:00"'
the units remain at "minutes since 0001-01-01 00:00"

Here are the commands used to generate "nc_file" (the original file had 
only lat/lon axes; no "z" or "t" axes...)

'set sdfwrite -4d 'nc_file
'set sdfattr level String long_name height'
'set sdfattr level String units m'
'set sdfattr time String units "minutes since 1998-01-01 00:00:00"'
'set sdfattr rprecip String long_name regridded precipitation'
'set sdfattr rprecip String units mm/h'
'set undef 'undef_value ;* change from default -9.99e8 to use source 
netCDF file undef
say
'q sdfwrite'
say result
'sdfwrite rprecip'
'c sdfwrite'

Here's the "q sdfwrite" output (except for the SDFwrite file name):

SDFwrite format is NetCDF
SDFwrite output undef value is set to -9999.900000
SDFwrite file will have at least 4 dimensions
SDFwrite attribute metadata:
  level String long_name height
  level String units m
  time String units "minutes since 1998-01-01 00:00:00"
  rprecip String long_name regridded precipitation
  rprecip String units mm/h

Here's output from the "\ncdump -c" on the output "nc_file"... the 
"level" and "rprecip" attributes were modified as desired, but not the 
time units:

dimensions:
        longitude = 144 ;
        latitude = 50 ;
        level = 1 ;
        time = 1 ;
variables:
        double longitude(longitude) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "Longitude" ;
        double latitude(latitude) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "Latitude" ;
        double level(level) ;
                level:units = "m" ;
                level:long_name = "height" ;
        double time(time) ;
                time:long_name = "Time" ;
                time:units = "minutes since 0001-01-01 00:00" ;
        double rprecip(time, level, latitude, longitude) ;
                rprecip:missing_value = -9999.9 ;
                rprecip:long_name = "regridded precipitation" ;
                rprecip:units = "mm/h" ;
data:

 longitude = 1.25, 3.75, 6.25, 8.75, 11.25, 13.75, 16.25, 18.75, 21.25,
    23.75, 26.25, 28.75, 31.25, 33.75, 36.25, 38.75, 41.25, 43.75, 46.25,
    48.75, 51.25, 53.75, 56.25, 58.75, 61.25, 63.75, 66.25, 68.75, 71.25,
    73.75, 76.25, 78.75, 81.25, 83.75, 86.25, 88.75, 91.25, 93.75, 96.25,
    98.75, 101.25, 103.75, 106.25, 108.75, 111.25, 113.75, 116.25, 118.75,
    121.25, 123.75, 126.25, 128.75, 131.25, 133.75, 136.25, 138.75, 141.25,
    143.75, 146.25, 148.75, 151.25, 153.75, 156.25, 158.75, 161.25, 163.75,
    166.25, 168.75, 171.25, 173.75, 176.25, 178.75, 181.25, 183.75, 186.25,
    188.75, 191.25, 193.75, 196.25, 198.75, 201.25, 203.75, 206.25, 208.75,
    211.25, 213.75, 216.25, 218.75, 221.25, 223.75, 226.25, 228.75, 231.25,
    233.75, 236.25, 238.75, 241.25, 243.75, 246.25, 248.75, 251.25, 253.75,
    256.25, 258.75, 261.25, 263.75, 266.25, 268.75, 271.25, 273.75, 276.25,
    278.75, 281.25, 283.75, 286.25, 288.75, 291.25, 293.75, 296.25, 298.75,
    301.25, 303.75, 306.25, 308.75, 311.25, 313.75, 316.25, 318.75, 321.25,
    323.75, 326.25, 328.75, 331.25, 333.75, 336.25, 338.75, 341.25, 343.75,
    346.25, 348.75, 351.25, 353.75, 356.25, 358.75 ;

 latitude = -49, -47, -45, -43, -41, -39, -37, -35, -33, -31, -29, -27, 
-25,
    -23, -21, -19, -17, -15, -13, -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 
9, 11,
    13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 
47, 49 ;

 level = 0 ;

 time = 0 ;

Thanks for your help,
Chuck

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not necessarily
reflect any position of the Government or NOAA."




More information about the gradsusr mailing list