IDL 4.0 bug (netCDF related) [message #4533] |
Mon, 12 June 1995 00:00 |
legler
Messages: 11 Registered: July 1991
|
Junior Member |
|
|
There seems to be a bug in writing character data to a netCDF file in IDL 4.0.
I have not received confirmation of this from RSI, but I wanted to
alert potential users...
Instead of writing character data, the data are written as type BYTE. Here
is a small
test routine and output of ncdump (dumps contents of newly generated netCDF
file 'test.nc'). Note the dump indicates the CHAR data was written as type
BYTE. Writing character data as type CHAR worked just fine in previous
versions of IDL.
PRO test
new_id = NCDF_CREATE('test.nc', /CLOBBER)
ndim = 1
dim = LONARR(1)
dim(0) = NCDF_DIMDEF(new_id, 'rec', /UNLIMITED)
var_id = NCDF_VARDEF(new_id, 'chrvar', dim(0), /CHAR)
NCDF_CONTROL, new_id, /ENDEF
NCDF_VARPUT, new_id, var_id, 'This is a test'
NCDF_CLOSE, new_id
end
------
ncdump of 'test.nc':
====================
netcdf test {
dimensions:
rec = UNLIMITED ; // (14 currently)
variables:
byte chrvar(rec) ;
data:
chrvar = 84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116 ;
}
--
Dr. David M. Legler
Center for Ocean Atmosphere Prediction Studies
Florida State University | (904) 644-3797 (Voice)
Room 020 Love Bldg | (904) 644-4841 (fax)
Tallahassee, FL 32306-3041 | Email: legler@coaps.fsu.edu
|
|
|