Opened 17 years ago
Closed 17 years ago
#238 closed bug (Fixed)
Problem in input routines nf_fread*d when scale is not unity
| Reported by: | arango | Owned by: | arango |
|---|---|---|---|
| Priority: | major | Milestone: | Release ROMS/TOMS 3.2 |
| Component: | Nonlinear | Version: | 3.2 |
| Keywords: | Cc: |
Description
There is a problem in routines nf_fread2d.F, nf_fread3d.F, and nf_fread4d.F when the scale (Ascl) value used to multiply input fields is different than unity and land points are replaced with the _FillValue. The read field was scaled first and then checked for the fill value. This logic needs to be changed to:
DO i=1,Npts
IF (wrk(i).ge.spval) THEN
wrk(i)=0.0_r8 ! land/sea maked with _FillValue
ELSE
wrk(i)=Ascl*wrk(i)
Amin=MIN(Amin,wrk(i))
Amax=MAX(Amax,wrk(i))
END IF
END DO
That is, the read field is unmodified when the conditional wrk(i).ge.spval is executed. Many thanks to Andy Moore for bringing this to my attention.
I also initialized local arrays in the IO routines to avoid denormalized numbers that are treated differently by various compilers. This facilitates processing and debugging. I also initialized such fields in the mp_gather and mp_scatter routines.
