NCDF_ATTPUT _FillValue problem for string arrays? [message #67146] |
Mon, 06 July 2009 12:14 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
I've encountered a strange problem with some netCDF output using IDL.
I define a character string array variable in my output netCDF file like so:
VarId = NCDF_VARDEF( fid, 'Absorber_Units_Name', [32,n_Absorbers_DimId], /CHAR)
where the "32" is the maximum string length.
Now if I try to set a fill value attribute for that variable, like so
NCDF_ATTPUT, fid, VarId, '_FillValue', ' '
or
NCDF_ATTPUT, fid, VarId, '_FillValue', 0B
when I run the code I get the following error when I take the file out of define mode:
% NCDF_CONTROL: Attempt to take the file out of define mode (ENDEF) failed. (NC_ERROR=-45)
If I simply comment out the call to NCDF_ATTPUT for these character variables, there's no
problem.
I do this sort of thing (i.e. _FillValue of " " for character string variables) all the
time using the Fortran90 API to netCDF so I assume an empty space is a valid fill value.
Has anyone else encountered this behaviour in IDL? I.e. is this a known bug in the IDL
netCDF interface, or do I need to do something special with character fill values?
Thanks for any info.
cheers,
paulv
|
|
|