Track of the tropical cyclone
sajjad saeed
sajjad_met at HOTMAIL.COM
Thu May 11 06:50:36 EDT 2006
Dear all,
I am trying to plot the track of the the tropical cyclone during october
1999 in Bay of Bengal I am us a script and data file given below, i am
getting the following error.
.........................................................
ga-> cyclonetrack.gs
Enter File Name: (type q to stop)
SC track data
lon lat time/date
marktype, marksize, lcolor, lstyle and lthick:
98.81 12.53 95.45 14.27 26/00z
starting hour and the interval hours of plotting points:
92.88 15.88
endhour=94.16
DRAW error: Syntax is DRAW MARK marktype x y size
SC track data is working fine.
Enter File Name: (type q to stop)
...........................................................................................
I would very much appreciate your kind guidance
The script i am using is
function main()
'clear'
'open pmdada.paj9oct.16222.regrid.ctl'
'set lat 0 30'
'set lon 70 100'
'set mpdset hires'
'set poli on'
'draw map'
say 'Enter File Name: (type q to stop)'
pull fname
while (fname != 'q')
* Read the 1st record: Title
ret = read(fname)
rc = sublin(ret,1)
if (rc>0)
say 'File Error 1'
return
endif
title = sublin(ret,2)
say title
* Read the drawing primitives
ret = read(fname)
rc = sublin(ret,1)
if (rc>0)
say 'File Error 2'
return
endif
dpline = sublin(ret,2)
marktype = subwrd(dpline,1)
marksize = subwrd(dpline,2)
ret = read(fname)
rc = sublin(ret,1)
if (rc>0)
say 'File Error 3'
return
endif
dpline = sublin(ret,2)
lcolor = subwrd(dpline,1)
lstyle = subwrd(dpline,2)
lthick = subwrd(dpline,3)
say ' marktype, marksize, lcolor, lstyle and lthick:'
say ' 'marktype ' ' marksize ' ' lcolor ' ' lstyle ' ' lthick
* Read starting hour and the interval hours of plotting points
ret = read(fname)
rc = sublin(ret,1)
if (rc>0)
say 'File Error 4'
return
endif
dhour = sublin(ret,2)
start = subwrd(dhour,1)
jump = subwrd(dhour,2)
say ' starting hour and the interval hours of plotting points:'
say ' 'start' 'jump
* Read all data points
ret = read(fname)
rc = sublin(ret,1)
while (rc = 0)
loc = sublin(ret,2)
hour = subwrd(loc,1)
dlong.hour = subwrd(loc,2)
dlat.hour = subwrd(loc,3)
* prompt ' hour ' hour ' are read,'
* say ' long=' dlong.hour ' lat=' dlat.hour
ret = read(fname)
rc = sublin(ret,1)
endwhile
if (rc!=2 & rc!=0)
say 'File Error 5, rc=' rc
return
endif
endhour = hour
say ' endhour=' endhour
* Plotting
'set line 'lcolor' 'lstyle' 'lthick
'query w2xy 'dlong.start' 'dlat.start
xprev = subwrd(result,3)
yprev = subwrd(result,6)
'draw mark 'marktype' 'xprev' 'yprev' 'marksize
next = start+jump
while (next <= endhour)
* say ' 'dlong.start' 'dlat.start
'query w2xy 'dlong.next' 'dlat.next
xnext = subwrd(result,3)
ynext = subwrd(result,6)
'draw line 'xprev' 'yprev' 'xnext' 'ynext
* say ' 'xprev' 'yprev' 'xnext' 'ynext
'draw mark 'marktype' 'xnext' 'ynext' 'marksize
next = next+jump
xprev = xnext
yprev = ynext
endwhile
say fname ' is working fine.'
* read in the filename to be plotted next
say 'Enter File Name: (type q to stop)'
pull fname
endwhile
......................................................................................
The data file i am using is
..........................................
lon lat time/date
98.81 12.53 25/00z
95.45 14.27 26/00z
92.88 15.88 27/00z
91.60 16.95 28/00z
91.92 18.55 29/00z
94.16 20.42 30/00z
Thankyou in advance
Sajjad Saeed
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.com/
More information about the gradsusr
mailing list