| 
 
	积分24贡献 精华在线时间 小时注册时间2014-2-22最后登录1970-1-1 
 | 
 
 发表于 2014-3-1 23:00:04
|
显示全部楼层 
| [转载]用Grads编写的画台风路径的 gs (2007-04-20 11:45:56)转载▼ 标签: grads 台风路径 gs文件
 *         #################################################
 *         ###                                           ###
 *         ###         Draw the track of typhoon         ###
 *         ###              Version 1.1                  ###
 *         ###                                           ###
 *         ###        Developed by Huang Xiaogang        ###
 *         ###                                           ###
 *         ###      Department of Atmosphere Science,    ###
 *         ###      Institute of Meteorology, PLAUST     ###
 *         ###         Nanjing 211101, P.R.China         ###
 *         ###             2002/9/27/08:00               ###
 *         ###                                           ###
 *         #################################################
 
 'open e:/track/track1.ctl'
 prompt 'Please input the starlat:'
 pull starlat
 prompt 'Please input the endlat:'
 pull endlat
 prompt 'Please input the starlon:'
 pull starlon
 prompt 'Please input the endlon:'
 pull endlon
 'set lon 'starlon' 'endlon''
 'set lat 'starlat' 'endlat''
 'set cmin 10000'
 'set grads off'
 say '        '
 say '       ******************************************************'
 say '       *                                                    *'
 say '       *   Please choose the map projections:               *'
 say '       *   1:   latlon   Lat/lon projection with aspect     *'
 say '       *                 radio maintained. Default.         *'
 say '       *   2:   lambert  Lambert conformal conic projection *'
 say '       *                                                    *'
 say '       ******************************************************'
 say '        '
 prompt 'Your choice, 1 or 2?'
 pull mpchoice
 if (mpchoice=2)
    'set mproj lambert'
    'set xlint 5'
    'set ylint 5'
 *    'set grid on 1'
    'set grid off'
    'd latt'
    'set line 1 1 2'
     i=0
     a=starlat
     b=endlat
     c=starlon
     d=endlon
     ii=1
     aa=a
     cc=c
     while(cc<=endlon)
    
         i=i+1
        'q w2xy 'c' 'starlat''
         xms1.i=subwrd(result,3)
         yms1.i=subwrd(result,6)
        'q w2xy 'd' 'endlat''
         xms3.i=subwrd(result,3)
         yms3.i=subwrd(result,6)
        if (i=ii)
           'set string 1 l 2 0'
           'set strsiz 0.15 0.15'
            mark2=''cc''%' E'
           'draw string 'xms1.i-0.3' 'yms1.i-0.2' 'mark2''
           'draw mark 2 'xms1.i+0.2' 'yms1.i-0.1' 0.08'
 *       draw the grid
           if (i>1)
        
               a_1=starlat
               i_1=0
               while (a_1<=endlat)
                  i_1=i_1+1
                  'q w2xy 'cc' 'a_1''
                  xms_1.i_1=subwrd(result,3)
                  yms_1.i_1=subwrd(result,6)
                  if (i_1>1)
                      j_1=i_1-1
                      'draw line 'xms_1.j_1' 'yms_1.j_1' 'xms_1.i_1' 'yms_1.i_1''
                  endif
                  a_1=a_1+0.1
               endwhile
            endif      
            ii=ii+50
            cc=cc+5
         endif
         if (i>1)
    
             j=i-1
            'draw line 'xms1.j' 'yms1.j' 'xms1.i' 'yms1.i''
            'draw line 'xms3.j' 'yms3.j' 'xms3.i' 'yms3.i''
         endif
         d=d-0.1
         c=c+0.1      
     endwhile
     i=0
     ii=1
     while(aa<=endlat)
         i=i+1
        'q w2xy 'starlon' 'a''
         xms2.i=subwrd(result,3)
         yms2.i=subwrd(result,6)
        'q w2xy 'endlon' 'b''
         xms4.i=subwrd(result,3)
         yms4.i=subwrd(result,6)
         if (i=ii)
           'set string 1 l 2 0'
           'set strsiz 0.15 0.15'
            mark1=''aa''%' N'
           'draw string 'xms2.i-0.6' 'yms2.i' 'mark1''
           'draw mark 2 'xms2.i-0.25' 'yms2.i+0.1' 0.08'
           if (i>1)
        
               a_1=starlon
               i_1=0
               while (a_1<=endlon)
                  i_1=i_1+1
                  'q w2xy 'a_1' 'aa''
                  xms_1.i_1=subwrd(result,3)
                  yms_1.i_1=subwrd(result,6)
                  if (i_1>1)
                      j_1=i_1-1
                      'draw line 'xms_1.j_1' 'yms_1.j_1' 'xms_1.i_1' 'yms_1.i_1''
                  endif
                  a_1=a_1+0.1
               endwhile
            endif      
            ii=ii+50
            aa=aa+5
         endif
         if (i>1)
             j=i-1
            'draw line 'xms2.j' 'yms2.j' 'xms2.i' 'yms2.i''
            'draw line 'xms4.j' 'yms4.j' 'xms4.i' 'yms4.i''
         endif
         a=a+0.1
         b=b-0.1      
     endwhile
 else
    'set mproj latlon'
    'set xlint 5'
    'set ylint 5'
    'set grid on 1'
    'd latt'
 endif    
 *'draw title 'The track of "SINLAKU" tropical cyclone''
 marks.2=3
 marks.3=5
 marks.4=2
 marks.5=4
 marks.6=7
 marks.7=8
 marks.8=6
 marks.9=1
 marks.10=10
 marks.11=11
 var.2=9
  
 'set line 2 1 1'
 i=0
 j=0
 dummy=0
 while (dummy<2)
    i=i+1
    
    if (i=1)
      j=j+1
    endif
    
    dummy=read('e:/track/lonlat15.txt')
     res=sublin(dummy,2)
     lat1=subwrd(res,1)
     lon1=subwrd(res,2)
 
     'q w2xy 'lon1' 'lat1''
     xms.i=subwrd(result,3)
     yms.i=subwrd(result,6)
    
     if(j=1&i=1)
         'draw string 'xms.i-0.3' 'yms.i-0.25' 'SINLAKU''
         'draw string 'xms.i-0.3' 'yms.i-0.5' '0216''
         'draw string 'xms.i+0.18' 'yms.i' '02.00''
     endif
    
     if (j=1&i=var.2)
         'draw string 'xms.i-0.35' 'yms.i+0.18' '04.00''
     endif
     if (j>1)
       'draw mark 'marks.j' 'xms.i' 'yms.i' 0.1'
     endif
            
     if (i>1)
         ii=i-1
        'draw line 'xms.ii' 'yms.ii' 'xms.i' 'yms.i''
     endif      
     if (j=1)
        'draw wxsym 41 'xms.i' 'yms.i' 0.25'
     endif
     if (j>1)
       'draw mark 'marks.j' 'xms.i' 'yms.i' 0.1'
     endif
     if (i=var.2)
        i=0
     endif
 endwhile
 'enable print e:/track/track.gmf'
 'print'
 'disable print'
 * 'printim gifimage.out gif x800 y600 white'
 
 | 
 |