[Thread Prev][Thread Next][Index]

Re: Strangeness in 'format="unformatted"' vs 'format="stream"'



As usual, Steve is a wizard...

------- Forwarded Message
Date: Wed, 06 Nov 2002 17:31:41 -0800
From: Steve Hankin <hankin@pmel.noaa.gov>
Subject: Re: Strangeness in 'format="unformatted"' vs 'format="stream"'

Hi Gary,

offline very quick suggestion:  see if /COLUMNS=<values-per-record> makes it 
all work.

If this works, the explanation is that in FORTRAN you can always use a READ 
statement with an input list *shorter* than the data in the record.  Hence you
have to tell Ferret how many values to read ("columns").  Else it defaults to 
reading just one per record.

The corrected script follows:
-------------------------------------------------------------------------------
!
set memory/size=256
!
def axis/x=-179.5:179.5:1/unit="degrees_east"/modulo lon
def axis/y=-89.5:89.5:1/unit="degrees_north" lat
def axis/t="15-JAN-1871":"15-DEC-1997"/npoint=1524 time
def grid/x=lon/y=lat/t=time gg
file/format="unformatted"/grid=gg/columns=`360*180`/var=v1 G2.3b_1871_1997.anom
!
set var/bad=1.E36 v1
let/title="GISST SST Anomaly (relative to 1961-1990)"/units="deg.C"   SSTA  = v1[g=gg@asn]
!
save/clo/file=GISST_2.3b_1871_1997_anom.nc SSTA
!
quit
-------------------------------------------------------------------------------

Works like a charm! Thanks, Steve!

--
/\        Gary Strand (303) 497-1336                                NCAR CG2260
  \_][    www.cgd.ucar.edu/ccr/strandwg                    3080 Center Green Dr
      \___strandwg@ucar.edu                       Boulder, Colorado, USA  80301


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement