Opened 14 years ago

Closed 14 years ago

#408 closed bug (Fixed)

Corrected bug in get_ngfld.F and get_ngfldr.F

Reported by: arango Owned by: arango
Priority: major Milestone: Release ROMS/TOMS 3.4
Component: Nonlinear Version: 3.4
Keywords: Cc:

Description (last modified by arango)

Corrected a bug in get_ngfld.F and get_ngfldr.F when the scale_factor and add_offset NetCDF attributes are used to compress the data. The generic routines in mod_netcdf.F already process these paramemeters to uncompress the data. So the additional scaling in get_ngfld.F and get_ngfldr.F routines is only related with Fscale(ifield,ng) and not compression:

            Fmin=A(1)*Fscale(ifield,ng)
            Fmax=A(1)*Fscale(ifield,ng)
            ic=0
            DO j=1,Jrec
              DO i=Istr,Iend
                ic=ic+1
                Aval=A(ic)*Fscale(ifield,ng)
                Fmin=MIN(Fmin,Aval)
                Fmax=MAX(Fmax,Aval)
                Fout(i,j,Tindex)=Aval
              END DO
            END DO

Notice that the Fscale factor is a different issue and doesn't have nothing to do with the compression of data but field units manipulation from varinfo.dat. Usually, Fscale=1.0 for mostly all input fields.

Many thanks to Mark Hadfield for reporting this problem.

The same correction is also needed for get_2dfld.F, get_2dfldr.F, get_3dfld.F, and get_3dfldr.F when processing point-data. However, it very unlikely to have a input NetCDF file with point-data that needs to be compressed as byte and scaled with the scale_factor and add_offset attributes.

Change History (3)

comment:1 by arango, 14 years ago

Resolution: Fixed
Status: newclosed

comment:2 by arango, 14 years ago

Description: modified (diff)
Resolution: Fixed
Status: closedreopened

comment:3 by arango, 14 years ago

Resolution: Fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.