possible bug in nf_fread2d.F , input masks

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
blaupole
Posts: 5
Joined: Fri Sep 24, 2010 12:12 am
Location: Antarctic Research Centre

possible bug in nf_fread2d.F , input masks

#1 Unread post by blaupole »

Hi,

I am using ROMS Rev 627.

In nf_fread2d.F

Code: Select all

          DO i=1,Npts
!            IF (ABS(wrk(i)).ge.ABS(Aspval)) THEN
            IF (ABS(wrk(i)).gt.ABS(Aspval)) THEN
              wrk(i)=0.0_r8                     ! masked with _FillValue
            ELSE
              wrk(i)=Ascl*(Afactor*wrk(i)+Aoffset)
              Amin=MIN(Amin,wrk(i))
              Amax=MAX(Amax,wrk(i))
            END IF
          END DO
the variable 'wrk' - that seems to carry the 2D field from the netcdf input file (0s and 1s for masks) as 1D vector - is compared to a value 'Aspval' that happens to be 1 for the masks.
'wrk' is set to zero where the IF statement returns logic true i.e. 1s (water) are set to zero

This results in all input masks set to land. I am not sure where 'Aspval' comes from and what it means.

For now changing .ge. to .gt. seems to work for me as the masks are correctly read and all other 2D fields as well.

Thanks for opinions and advise,
Stefan

Post Reply