[ncl-talk] variable metadata getting overwritten when variable is written to a NetCDF4 file

Keith Lindsay klindsay at ucar.edu
Mon Nov 2 08:06:24 MST 2015


Hi,

I have come across an instance where I'm writing a variable to a file and
the variable metadata in the file is getting overwritten, even though I'm
using (/ ... /) on the right-hand side of the write to file statement. That
is, the statement
f->$varname$ = (/ tmpvar /)
is overwriting the metadata for the file variable $varname$ in the file
pointed to by f. The attached script demonstrates the problem. This seems
like an ncl bug to me.

Details of my script that seem to matter are:
1) the file is NetCDF4
2) the file variable whose metadata is getting overwritten has been defined
in the file but not written to yet
3) the file variable whose metadata is getting overwritten does not have
the _FillValue attribute
4) the variable on rhs of write to file statement has _FillValue attribute

The problem happens with ncl 6.3.0 on yellowstone. It does not happen with
ncl 6.2.1, though with 6.2.1 the _FillValue gets added to the file
variable's metadata, which is unexpected to me.

Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151102/557ac56a/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file_var_metadata_clobber.ncl
Type: application/octet-stream
Size: 591 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151102/557ac56a/attachment.obj 


More information about the ncl-talk mailing list