Opened 15 years ago
Closed 15 years ago
#374 closed bug (Fixed)
WARNING: Corrected BUG in scale_factor attribute for input NetCDF files
Reported by: | arango | Owned by: | arango |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 3.3 |
Component: | Nonlinear | Version: | 3.3 |
Keywords: | Cc: |
Description
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.
Change History (1)
comment:1 by , 15 years ago
Resolution: | → Fixed |
---|---|
Status: | new → closed |
Summary: | Corrected bug in scale_factor attribute for input NetCDF files → WARNING: Corrected BUG in scale_factor attribute for input NetCDF files |