Produce a new grib data

Mark gemark at GEORGE2.AS.NTU.EDU.TW
Fri Apr 22 03:25:21 EDT 2005


> Hi, Mark!
> Thanks for your reply.
> I've fixed my ctl file according to your suggestion, displayed one of the
> variable, and got this error message:
>         segmentation fault (core dumped)
> I don't know what's wrong with my program.
> I attach my script and ctl file. so you or other users may find my faults
> out.
> Charles

Hi Charles
Since you wrote your data file through GrADS,
then you don't have to put 'sequential' in the options line of ctl file.

Could you try this: (in your gs file)
'set fwrite -st pgb.fcst.1985.dat'
to make sure your output is in stream binary format.
And erase the line 'dtype grib' in your ctl file.
By the way, I found an error between your gs and ctl files.
The 1st slab data you wrote by gs file is presmsl on Dec 1985,
and wrote 5 levels (1000, 850, 700, 500, 300) HGT, UGRD,VGRD,
and repeated twice.
So, I think your ctl file should look like this:
*************the control file
dset pgb.fcst.1985.dat
undef -9.99E+33
title EXP1
xdef  180 linear     0.000    2.000
ydef    91 linear  -90.000    2.000
zdef      5 levels    1000     850     700     500     300
tdef       2 linear    Dec1985   1mo
vars 4
presmsl        0   99 PRESSURE (PA)
hgtprs        20   99 GEOPOTENTIAL HEIGHT (M)
ugrdprs       20  99 ZONAL WIND (M/S)
vgrdprs       20  99 MERIDIONAL WIND (M/S)
endvars
************************************************
I think after fwrite, your file format is stream binary,
but not in GRIB format.
Sorry, I didn't deal with GRIB format file too much.
I prefer binary file for Fortran and GrADS.
By the way, could you provide your machine type?
I wish these information can help you some.

Mark



More information about the gradsusr mailing list