[Thread Prev][Thread Next][Index]

Several variables in one unformatted file



Hello,

Using a Fortran program, I wrote an unformatted file containing four
two-dimensional fields.

The file was written like this:

   real A(64,32),B(64,32),C(64,32),D(64,32)

   open(10,file='tempmoy.dat',form='UNFORMATTED')
   write(10) A,B,C,D
   close(10)

I try to read it with ferret using

! Definition of gaussian grid 64x32
file /var=lats/columns=1 lats.gauss.32
define axis/x=0:354.375:5.625/unit=degrees x64
define axis/y/from_data/name=y32/unit=degrees lats
define grid/x=x64/y=y32 g64x32

file /var="T650,T1000,Tdiff,r"/grid=g64x32/format=UNFORMATTED/COLUMNS=`64*32*4` tempmoy.dat

Unfortunately, when I try to display the fields with like this:

fill /line/key/title="Average temperature at 650 mb (1980) (Kelvins)"/i=1:64/j=1:32 T650
fill /line/key/title="Average temperature at 1000 mb (1980) (Kelvins)"/i=1:64/j=1:32 T1000
fill /lin/key/title="T1000 - T650 (1980) (Kelvins)"/i=1:64/j=1:32 Tdiff
fill /line/key/title="r(T650,T1000) (1980)"/i=1:64/j=1:32 r

I get strange results: the bottom part of each plot looks like
temperature data (values range from 240 to 300 approximately) and the
top part looks like it comes from either the third or fourth field.

What am I doing wrong ?  I suspect that I have to change something
either in the way I write the fields or the way I use "file"...

-- 
Michel Beland                 beland@CERCA.UMontreal.CA
professionnel de recherche    tel: (514)369-5223  fax: (514)369-3880
CERCA (CEntre de Recherche en Calcul Applique)
5160, boul. Decarie, bureau 400(423), Montreal (Quebec), Canada, H3X 2H9


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / ERL / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement