﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
408	Corrected bug in get_ngfld.F and get_ngfldr.F	arango	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 [https://www.myroms.org/forum/viewtopic.php?f=19&t=1723 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."	bug	closed	major	Release ROMS/TOMS 3.4	Nonlinear	3.4	Fixed		
