Because many files written with other software use NaN for
missing values, Ferret will read netCDF files that use NaN, but
when writing netCDF data, it doesn't write NaN as the missing
flag.
I was just wondering about that! On what condition does Ferret do so?
I was surprised that you can actually save variables with bad = NaN by
I examined the generated file tmp.nc with ncdump and found that NaN is correctly used as the _FillValue .
But, if the variable is defined like
yes? let var = if SST lt 25 then SST
instead of the "<==" line in the script, NaN doesn't occur in the generate netCDF file.
I think the capability to have NaN in the netCDF file is nice. I sometimes extract the binary data from a netCDF file generated by Ferret and process it with Forttan and sometimes wish NaN in it(*footnote).
Ryo
----------------
(*footnote) Normal values often suffer from the precision problem. The dataset I used above uses single precision and its _FillValue is -1.E+34 , but when ferret saves a new variable derived from one in the dataset, it saves it in double precision and the new _FillValue is-9.99999979021477E+33, not the double precision -9.9999999999999E+33 . This makes dealing with the _FillValue somewhat cumbersome. In addition, if you write a Fortran program that reads various netCDF files and does some calculation on the variables from them, you would want to unify _FillValues to avoid a program like