<html><body>
<DIV>Thanks for your help. I removed the 2 option cards but still come up with the same result.</DIV>
<DIV> </DIV>
<DIV>So I ran 'set gxout grid' for a small area on both the origianl grid and the fwrite output grid for only the variable HTSGWsfc to try and see what was going on. Reading just a bit of one latitiude row:</DIV>
<DIV> </DIV>
<DIV>Original Grib Values: 4 4 3 3 3 3 2 2 </DIV>
<DIV>Fwrite Grib Values: 172 155 157 159 156 160 166 157</DIV>
<DIV> </DIV>
<DIV>There's no apparent correlation. Not sure where to go now.... </DIV>
<DIV> </DIV>
<DIV>Just to confirm: I should be able to just read the fwrite output file using a modified ctl file and no fortran interpretation?? </DIV>
<DIV> </DIV>
<DIV class=signature id=signature>--<BR>Thanks, <BR>Mark</DIV>
<DIV> </DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">-------------- Original message -------------- <BR><BR>> The "options yrev" should not be used. Even though your original file has x <BR>> and y reversed, fwrite writes the data from grads arrays so everything is in <BR>> the order grads expects. I don't think that would give you the results you <BR>> report, though. The grid should just be skewed around since you are reading <BR>> rows and columns in the wrong order. The little endian may be a problem. <BR>> If you are writing and reading the files on the same machine, you don't need <BR>> to specify the endian type. Again, fwrite uses the expected format for the <BR>> machine you are on. Since you only have two variables with one time and <BR>> level, there isn't much more that could be wrong. <BR>> <BR>> > -----Original Message----- <BR>> > From: Mark Sponsler [mailto:msponsler@COMCAST.NET] <BR>
> > Sent: Monday, October 17, 2005 2:42 PM <BR>> > To: GRADSUSR@LIST.CINECA.IT <BR>> > Subject: fwrite (again) <BR>> > <BR>> > <BR>> > Sorry to be so bothersome but I have another simple question <BR>> > that I could <BR>> > not answer after reviewing the documentation. <BR>> > <BR>> > When using the fwrite defaults, it streams the data to a <BR>> > binary file for <BR>> > eventualy re-ingestion into GRADS. Is some level of fortran <BR>> > manipulation <BR>> > of the fwrite output required before it can be re-read by Grads? <BR>> > <BR>> > I ask because I was able to manually generate a control file <BR>> > and get Grads <BR>> > to read the file producing some results, but the data is way off <BR>> > (Significant Wave Heights are all too high and and Direction <BR>> > is set to 180 <BR>> > degrees for all grib points). <BR>> > <BR>> > Here
's my modified control file: <BR>> > <BR>> > dset grads.fwrite <BR>> > undef 9.999E+20 <BR>> > options little_endian <BR>> > options yrev <BR>> > ydef 157 linear -78.000000 1 <BR>> > xdef 288 linear 0.000000 1.250000 <BR>> > tdef 1 linear 18Z12nov2004 03hr <BR>> > zdef 1 linear 1 1 <BR>> > vars 2 <BR>> > DIRPWsfc 0 107,1,1 ** surface Primary wave direction [deg] <BR>> > HTSGWsfc 0 100,1,1 ** surface Sig height of wind waves and swell [m] <BR>> > ENDVARS <BR>> > <BR>> > Here's the control file for original dataset that fwrite used as it's <BR>> > source: <BR>> > <BR>> > dset nww3.all.grb <BR>> > index nww3.all.grb.idx <BR>> > undef 9.999E+20 <BR>> > title nww3.all.grb <BR>> > * produced by grib2ctl v0.9.12.5p33e <BR>> > dtype grib 233 <BR>> > options yrev <BR>> > ydef 157 linear -78.000000 1 <BR>> > xdef 288 linear 0.00000
0 1.250000 <BR>> > tdef 61 linear 18Z12nov2004 03hr <BR>> > zdef 1 linear 1 1 <BR>> > vars 11 <BR>> > DIRPWsfc 0 107,1,1 ** surface Primary wave direction [deg] <BR>> > DIRSWsfc 0 109,1,1 ** surface Secondary wave direction [deg] <BR>> > HTSGWsfc 0 100,1,1 ** surface Sig height of wind waves and swell [m] <BR>> > PERPWsfc 0 108,1,1 ** surface Primary wave mean period [s] <BR>> > PERSWsfc 0 110,1,1 ** surface Secondary wave mean period [s] <BR>> > UGRDsfc 0 33,1,1 ** surface u wind [m/s] <BR>> > VGRDsfc 0 34,1,1 ** surface v wind [m/s] <BR>> > WDIRsfc 0 31,1,1 ** surface Wind direction [deg] <BR>> > WINDsfc 0 32,1,1 ** surface Wind speed [m/s] <BR>> > WVDIRsfc 0 101,1,1 ** surface Direction of wind waves [deg] <BR>> > WVPERsfc 0 103,1,1 ** surface Mean period of wind waves [s] <BR>> > ENDVARS <BR>> > </BLOCKQUOTE></body></html>