﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
374	WARNING: Corrected BUG in scale_factor attribute for input NetCDF files	arango	arango	"'''WARNING''': This is a bug if you scale your data using the NetCDF '''scale_factor''' attribute which is used to compress data sometimes.

----

Corrected a bug in '''get_ngfld.F''', '''get_ngfldr.F''', '''get_2dflf.F''', '''get_2dfldr.F''', '''get_3dfld.F''', and '''get_3dfldr.F'''. The '''Fscale(ifield,ng)''' was rewritten as:

{{{
!
!  If ""scale_factor"" attribute is present for a variable, the data are
!  to be multiplied by this factor.  Check if only water points are
!  available.
!
          IF (foundit) THEN
            DO i=1,nvatt
              IF (TRIM(var_Aname(i)).eq.'scale_factor') THEN
                scale=var_Afloat(i)
                Fscale(ifield,ng)=Fscale(ifield,ng)*scale
              ELSE IF (TRIM(var_Aname(i)).eq.'water_points') THEN
                Iinfo(1,ifield,ng)=-ABS(Iinfo(1,ifield,ng))
                Vtype=Iinfo(1,ifield,ng)
              END IF
            END DO
          END IF
}}}
This was changed to:
{{{
              IF (TRIM(var_Aname(i)).eq.'scale_factor') THEN
                scale=var_Afloat(i)
                Finfo(10,ifield,ng)=scale
              ELSE IF (TRIM(var_Aname(i)).eq.'water_points') THEN
              END IF
}}}
So no longer the value of '''Fscale(ifield,ng)''' is over-written. The scale value is now stored in '''Finfo(10,:,ng)'''.  This avoided scaling the variable twice by the '''scale_factor''' during reading in routines '''nf_fread*'''.

I apologize that missed this one completely when I tested this part. Many thanks to Brian Powell for bringing this to my attention."	bug	closed	major	Release ROMS/TOMS 3.3	Nonlinear	3.3	Fixed		
