Retrieves the _FillValue of a variable, if present.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" function getFillValue ( x : numeric )
A numeric array of any dimensionality.
A scalar value equal to the _FillValue of x. Same type as x
Determines the _FillValue by first looking to see if the variable has a missing value attribute. This can be an attribute named "_FillValue" or "missing_value". As of version 4.3.0, if it has neither, then a _FillValue of "No_FillValue" is returned.
Important behavior change
Prior to version 4.3.0, getFillValue would return the default _FillValue if a variable did not have _FillValue associated with it.
For example, in the line below:
A side effect of this new behavior is that the following will result in a fatal error:
q@_FillValue = getFillValue(w)if the variable has no _FillValue associated with it. The reason is the the string "No_FillValue" can not be assigned to "q" unless q is of type string.
It should be noted that getFillValue was only intended to be used within the new statement.
There are many metadata tools
Example 1: Create a new variable and assign the _FillValue associated with some variable (here, "w"). If "w" has no _FillValue, then "q" will have no _FillValue.
q = new( 10, "float", getFillValue(w))