[gradsusr] how to find typhoon center via minloc function

Charles Seman Charles.Seman at noaa.gov
Tue Jan 4 14:31:15 EST 2011


Jie,

Attached is a file File_Error_1_Grads_1.9-Plot_tc_shi.gs.txt containing 
the text from an email exchange to the GrADS Listserv between Joe Covert 
and Diane Stokes on 9/13/2004 -- on 4/27/06, found via a Google search 
for "plot_tc_shi.gs": http://caos.iisc.ernet.in/gslib/plot_tc_shi.gs

The attached GrADS script plot_hurricane_center3.gs (along with 
pause.gsf, aGrADS script function used by the plot script) is a locally 
modified version derived from Joe Covert's script "plot_tc_shi.gs" 
(Joe.Covert at noaa.gov) which was posted to the GrADS Listserv on 
9/13/2004 (his script was named plot_tc_shi.gs) and code from 
hurricane_tracking.txt (taken from an email exchange posted to the GrADS 
Listserv by Kun-Hsuan Chou and Arturo Caracas Uribe in Oct, 2004)...

Please find below code from hurricane_tracking.txt (taken from an email 
exchange posted to the GrADS Listserv by Kun-Hsuan Chou and Arturo 
Caracas Uribe in Oct, 2004) illustrating a technique for finding max 
wind in a 2D field... and below that some code from attached script 
plot_hurricane_center3.gs to find the min sea-level pressure in a 2D 
field...

code from Kun-Hsuan Chou to find maximum wind speed from 
hurricane_tracking.txt:
---
'd maxloc(max(mag(u,v),lon=120,lon=130),lat=15,lat=25)'
  line=sublin(result,2)
  ygrd=subwrd(line,4)
'd maxloc(max(mag(u,v),lat=15,lat=25),lon=120,lon=130)'
  line=sublin(result,2)
  xgrd=subwrd(line,4)
'set x 'xgrd
lonval = subwrd(result,4)
'set y 'ygrd
latval = subwrd(result,4)
'q w2xy 'lonval' 'latval
xpos = subwrd(result,3)
ypos = subwrd(result,6)
'draw mark 1 'xpos' 'ypos' .2'
---

sample code from plot_hurricane_center3.gs to find hurricane center (see 
script for supporting code):
---
*
* find minimum "pressure" within box area (x1,x2), (y1,y2)...
*
      'set x 'x1
      'set y 'y1
      'set z 1'
      'set t 'tt
      'set gxout print'
      nxp = x2-x1+1
*      say '    nxp = 'nxp
      nyp = y2-y1+1
*      say '    nyp = 'nyp
      'd minloc(min(psl,y='y1',y='y2'),x='x1',x='x2')'
        rec=sublin(result,nxp+3)
        xc=subwrd(rec,1)
      'd minloc(min(psl,x='x1',x='x2'),y='y1',y='y2')'
        rec=sublin(result,nyp+3)
        yc=subwrd(rec,1)
      say
      say 'location of minimum "pressure"...'
      say
      say ' (xc,yc) = ('xc','yc')'
*
* find "world" coordinates of (xc,yc) and convert "world" coordinates
* to "xy" coordinates for plotting track of hurricane center...
*
      'set x 'xc
      lonval = subwrd(result,4)
      'set y 'yc
      latval = subwrd(result,4)
      say ' (lonval,latval) = ('lonval','latval')'
      'q w2xy 'lonval' 'latval
      xpos = subwrd(result,3)
      ypos = subwrd(result,6)
      say ' (xpos,ypos) = ('xpos','ypos')'
*
* write (xpos,ypos) to output file...
*
      res = write (''hurricane.nf'','t = 'tt' xpos = 'xpos' ypos = 'ypos'')

      pause()
---

Please let me know if you have any questions.

Hope this helps,
Chuck

Jie TANG wrote:
>
> hi,grads folks ,
>   I am using grads v1.9, trying to find the center of typhoon via 
> minloc function.
> the key script is shown as below:
> slplat=min(slp,lat=19,lat=26)                         
> tclon=minloc(slplat,lon=119,lon=126)                   
> slplon=min(slp,lon=119,lon=126)                        
> tclat=minloc(slplon,lat=19,lat=26)
>
> but grads tell me that "function not found min " 
> and when i changed my script to be :
> tclat=min(minloc(slpt,lon=119,lon=126), lat=19,lat=26)
> tclon=min(minloc(slpt, lat=19,lat=26 )lon=119,lon=126)
>
>
> how can i finx my scrpit ? thank you .:)
> -- 
>
> TANG Jie
> Email: totangjie at gmail.com <mailto:totangjie at gmail.com>
> Tel: 0086-2154896104
> Shanghai Typhoon Institute,China
> ------------------------------------------------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>   

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: File_Error_1_Grads_1.9-Plot_tc_shi.gs.txt
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20110104/dc2da2f3/attachment-0003.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: plot_hurricane_center3.gs
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20110104/dc2da2f3/attachment-0003.pl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pause.gsf
Type: application/x-font-type1
Size: 355 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110104/dc2da2f3/attachment-0003.bin 


More information about the gradsusr mailing list