[Thread Prev][Thread Next][Index]
Problem with missing values
Dear Ferret users,
When setting up a NetCDF file for ocean model (POM) output, I try
to assign a special value to land cells by setting the _FillValue or
missing_value attribute.
For example, in the case of the variable EL (sea surface elevation):
call NCAPTC(CDFID,ELID,'long_name',NCCHAR,9,'Elevation',IRET)
call NCAPTC(CDFID,ELID,'units',NCCHAR,6,'meters',IRET)
---> call NCAPT(CDFID,ELID,'missing_value',NCDOUBLE,1,SPVAL,IRET)
where SPVAL is -999.0 or some such number. Then when writing the
variable to the CDF file, the code fragment is:
do j = 1,JM
do i = 1,IM
if (FSM(i,j).eq.0.0) then
TMP2D(i,j) = SPVAL ! Land cell identifier
else
TMP2D(i,j) = EL(i,j)
endif
enddo
enddo
ELID = NCVID(CDFID,'EL',IRET)
call NCVPT(CDFID,ELID,CORNER,EDGES,TMP2D,IRET)
where FSM is a mask which is zero on land cells and unity everywhere
else.
The trouble is that while an older version of Ferret (v4.11) seems
to recognise the missing value flag, the newest version avaliable to
me (v4.90) does not. For example, with the earlier version, I get
the missing value indicator ("...") as I should:
> yes? list/j=2/i=1:5 EL
> Elevation (meters)
> T (days): 0
> DATA SET: ./spiral.cdf
> 2
> 2
> 1 / 1: ....
> 2 / 2: 0.0000
> 3 / 3: 0.0000
> 4 / 4: 0.0000
> 5 / 5: 0.0000
while with the later version I get something strange:
> yes? list/j=2/i=1:5 EL
> Elevation (meters)
> T (days): 0
> DATA SET: ./spiral.cdf
> 2
> 2
> 1 / 1: -999.0
> 2 / 2: ....
> 3 / 3: ....
> 4 / 4: ....
> 5 / 5: ....
Ferret v4.90 seems to interpret the zeros as missing values, but
fails to correctly interpret my intended missing-value flag!
Any ideas as to what is happening here?
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement