fwrite

Davide Sacchetti davide.sacchetti at ARPAL.ORG
Thu Dec 21 10:50:52 EST 2006


the easiest way to write/read data is
set gxout print

bye bye
Davide

On Thu, 2006-12-21 at 16:11 +0100, enrico pisoni wrote:
> Dear gradsUsers,
>
> I discovered now the command
> ---
> 'set gxout fwrite'
> ---
> very useful...but I have 2 doubts:
>
> 1) how to read in fortran the binary file that I can create in this way
> (I think I have to open it in particular way, but I don't know)...
> 2) is it possible to write files directly in ascii format?
>
> thanks
> Bye
> Enrico
>
> Maluta Mbedzi wrote:
>
> > Hi
> >
> > I am trying to save data into a new file using “fwrite”, all the
> > variables that the model outputs are displaying without any problem in
> > this new file, but I am experiencing problems with the variable I
> > calculated from the output fields, specifically “vorticity” that I
> > calculated using hcurl (u, v).U and V themselves are displaying
> > correctly, but Vorticity is wrong. What do you think could be the
> > problem? I have attached my control file.
> >
> > My script looks as follows:
> >
> > 'reinit'
> >
> > 'open PLEV_VAR.ctl'
> >
> > 'set gxout fwrite'
> >
> > 'set x 1 133'
> >
> > 'set fwrite tropcyr.dat'
> >
> > number=1
> >
> > while(number<=124)
> >
> > 'set t 'number’’
> >
> > 'set lev 850'
> >
> > 'd hcurl(u,v)'
> >
> > 'd u'
> >
> > 'd v'
> >
> > 'set lev 500'
> >
> > 'd t'
> >
> > 'set lev 400'
> >
> > 'd t'
> >
> > 'set lev 300'
> >
> > 'd t'
> >
> > 'set lev 250'
> >
> > 'd t'
> >
> > 'set lev 200'
> >
> > 'd t'
> >
> > 'd h'
> >
> > 'set lev 850'
> >
> > 'd h'
> >
> > 'd slp'
> >
> > number=number+1
> >
> > endwhile
> >
> > 'disable fwrite'
> >
> > 'close 1'
> >
> > Regards
> >
> > Pennington
> >
> >
> > ------------------------------------------------------------------------
> >
> > This e-mail is subject to South African Weather Service e-mail legal
> > notice, to view click here
> > <http://www.weathersa.co.za/Legal/EmailLegalNotice.jsp>
> > ------------------------------------------------------------------------
> >
--
Sacchetti Davide
ARPAL UO3 Centro Meteo Idrologico Regione Liguria - Dir. Scientifica
V.le Brigare Partigiane 2 16121 Genova (I)
tel: +39 010 6437535
mail: davide.sacchetti at arpal.org   web: www.meteoliguria.it



More information about the gradsusr mailing list