fwrite question

Sestak, Dr. Michael michael.sestak at FNMOC.NAVY.MIL
Wed May 11 12:05:12 EDT 2005


You have to do the fwrite in the same order that grads accesses data
x,y,z,variable,t.  Which means that you cannot just write variables with t
varying because that is ordered x,y,z,t,variable.  You have to write a
script with a loop around the display commands that steps through each value
of t.  Something like

tvar=0
while (tvar<=31)
'set t 'tvar
'd slp'
'd t'
'd cloud'
tvar=tvar+1
endwhile

This may not be the exact syntax, but it should be close



-----Original Message-----
From: Jean Pierre Arabonis [mailto:arabonis at EGS.UCT.AC.ZA]
Sent: Wednesday, May 11, 2005 8:13 AM
To: GRADSUSR at LIST.CINECA.IT
Subject: fwrite question


Hi all
    I think I've probably made a stupid mistake here, maybe someone can
enlighten me.
    I am trying to save portions of the dods data on the cola8 site to a
local file, however I am having problems, I am trying to save the "slp",
"t" and "cloud variables from t = 1 to 31 for one co-ordinate.
     If I do this for each individual variable and save to separate
files it works and the output file perfectly readable and displayable,
if however I want all 3 variables in one file (editing the ctl file to
reflect the changes) I have problems such that the resultant file is
unreadable.
    This is what I tried

sdfopen http://cola8.iges.org:9090/dods/avn051012
set lat -35
set lon 18
set t 1 31
set fwrite test.dat
set gxout fwrite
d slp
d t
d cloud
disable fwrite

then I have the following control file

dset test.dat
title GFS Initialized 12z10may2005
undef -9.99e+33
xdef 1 linear 18 1
ydef 1 linear -35 1
zdef 1 linear 1 1
tdef 31 linear 12Z10MAY2005 360mn
vars 3
slp 0 -999 sea level pressure [pa]
t 26 -999 temperature [k]
cloud 0 -999 entire atmosphere cloud cover [%]
endvars

And this is the error I get

ga-> set t 1 31
Time values set: 2005:5:10:12 2005:5:18:0
ga-> d slp
Low Level I/O Error:  Read error on data file
  Data file name = test.dat
  Error reading 1 bytes at location 112
Data Request Error:  Error for variable 'slp'
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = slp




Any ideas where I am going wrong.
    Many thanks
       Jean Pierre





--
Jean Pierre Arabonis
arabonis at egs.uct.ac.za
Tel 021 780 1021 cell 084 401 1365
This email is 100% Microsoft Free



More information about the gradsusr mailing list