fwrite (again)

Mark Sponsler msponsler at COMCAST.NET
Mon Oct 17 17:41:30 EDT 2005


Sorry to be so bothersome but I have another simple question that I could
not answer after reviewing the documentation.

When using the fwrite defaults, it streams the data to a binary file for
eventualy re-ingestion into GRADS.  Is some level of fortran manipulation
of the fwrite output required before it can be re-read by Grads?

I ask because I was able to manually generate a control file and get Grads
to read the file producing some results, but the data is way off
(Significant Wave Heights are all too high and and Direction is set to 180
degrees for all grib points).

Here's my modified control file:

dset grads.fwrite
undef 9.999E+20
options little_endian
options yrev
ydef 157 linear -78.000000 1
xdef 288 linear 0.000000 1.250000
tdef 1 linear 18Z12nov2004 03hr
zdef 1 linear 1 1
vars 2
DIRPWsfc  0 107,1,1  ** surface Primary wave direction [deg]
HTSGWsfc  0 100,1,1  ** surface Sig height of wind waves and swell [m]
ENDVARS

Here's the control file for original dataset that fwrite used as it's
source:

dset nww3.all.grb
index nww3.all.grb.idx
undef 9.999E+20
title nww3.all.grb
*  produced by grib2ctl v0.9.12.5p33e
dtype grib 233
options yrev
ydef 157 linear -78.000000 1
xdef 288 linear 0.000000 1.250000
tdef 61 linear 18Z12nov2004 03hr
zdef 1 linear 1 1
vars 11
DIRPWsfc  0 107,1,1  ** surface Primary wave direction [deg]
DIRSWsfc  0 109,1,1  ** surface Secondary wave direction [deg]
HTSGWsfc  0 100,1,1  ** surface Sig height of wind waves and swell [m]
PERPWsfc  0 108,1,1  ** surface Primary wave mean period [s]
PERSWsfc  0 110,1,1  ** surface Secondary wave mean period [s]
UGRDsfc  0 33,1,1  ** surface u wind [m/s]
VGRDsfc  0 34,1,1  ** surface v wind [m/s]
WDIRsfc  0 31,1,1  ** surface Wind direction [deg]
WINDsfc  0 32,1,1  ** surface Wind speed [m/s]
WVDIRsfc  0 101,1,1  ** surface Direction of wind waves [deg]
WVPERsfc  0 103,1,1  ** surface Mean period of wind waves [s]
ENDVARS



More information about the gradsusr mailing list