[Thread Prev][Thread Next][Index]

Re: [ferret_users] BUG REPORT: Appending packed NetCDF data



Hi Russ,
We have a fix for this which will be in the next Ferret release.

--Ansley


On 12/10/2012 10:23 AM, Ansley Manke wrote:
Hi Russ,
Thank you for the report. We'll get right on this.

Ansley

On 12/9/2012 9:00 PM, Russ Fiedler wrote:
Hi,

There appears to be a serious bug when trying to append packed data to a
file.

I have temperature, say, which is packed to a 2 byte integer with the
attributes scale_factor and add_offset.


         short temp(Time, st_ocean, yt_ocean, xt_ocean) ;
                 temp:missing_value = -32768s ;
                 temp:_FillValue = -32768s ;
                 temp:long_name = "Potential temperature" ;
                 temp:units = "degrees C" ;
                 temp:scale_factor = 0.001678518f ;
                 temp:add_offset = 45.f ;
                 temp:history = "From ocean_temp_1994_01" ;
...
  temp =
   -9714,
   -9750 ;

These come out to be

01-JAN-1994 12 / 1:  28.69
02-JAN-1994 12 / 2:  28.63



If I attempt to save this all at once then no problem...

set var/outtype=int2 temp
set att/output temp.scale_factor
set att/output temp.add_offset
save/clob/file=dummy1.nc/l=1:2 temp

yes? sp ncdump  dummy1.nc | tail  -n 4
    temp =
   -9714,
   -9750 ;
}


Now if I try to save the first value and then append the second

  save/clob/file=dummy2.nc/l=1 temp
  save/app/file=dummy2.nc/l=2 temp

yes? sp ncdump  dummy2.nc | tail -n 4
   -0.100000003352761, 0 ;

  temp =
   -9714,
   28 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}

Ferret just appends the integer part of the the temperature rather than
doing any scaling.


russ-hf% ferret -nojnl
         NOAA/PMEL TMAP
         FERRET v6.82
         Linux 2.6.32-279.1.1.el6.x86_64 64-bit - 08/03/12


Russ








[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement