- 积分
- 30
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-7-18
- 最后登录
- 1970-1-1
|
发表于 2013-9-16 11:21:41
|
显示全部楼层
水平螺旋度的gs文件:
'reinit'
'clear'
prefix.1='u' ; prefix.2='v'
pi=3.1415926
'sdfopen f:\hyx\data\ncep\uwnd.2003.nc'
'sdfopen f:\hyx\data\ncep\vwnd.2003.nc'
levstr=' 850 700 600 500 400 300 '
'set lon 80 110'
'set lat 30 50'
'set time 06z20jul'
'define cr=uwnd'
**************************************************************************************************
i=1
while(i<=9)
j=1
while(j<=13)
uave.i.j=0.0
vave.i.j=0.0
k=1
while(k<=5)
'set lev 'subwrd(levstr,k)
'undefine fld'
'define fld=uwnd.1'
'q defval fld '32+j' '48+i
nwval=subwrd(result,3)
uave.i.j=uave.i.j+nwval
'undefine fld'
'define fld=vwnd.2'
'q defval fld '32+j' '48+i
nwval=subwrd(result,3)
vave.i.j=vave.i.j+nwval
* say ' nwval='nwval ' vave.'i'.'j'='vave.i.j
k=k+1
endwhile
uave.i.j=uave.i.j/5
vave.i.j=vave.i.j/5
if(vave.i.j!=0)
qq.i.j=math_atan(math_abs(vave.i.j/uave.i.j))
else
if(uave.i.j>0)
qq.i.j=0
endif
if(uave.i.j<0)
qq.i.j=pi
endif
if(uave.i.j=0)
say ' chaos has arrised!'
endif
endif
if(uave.i.j>=0 & vave.i.j>=0);qq.i.j=qq.i.j-40.0 ;endif;
if(uave.i.j<0 & vave.i.j>=0) ;qq.i.j=180-40.0-qq.i.j;endif;
if(uave.i.j<=0 & vave.i.j<=0);qq.i.j=180-40.0+qq.i.j;endif;
if(uave.i.j>0 & vave.i.j<=0) ;qq.i.j=270-40.0+qq.i.j;endif;
* if(uave.i.j>=0 & vave.i.j>=0);qq.i.j=qq.i.j-40.0*3.1415926/180.0 ;endif;
* if(uave.i.j<0 & vave.i.j>=0) ;qq.i.j=(180-40.0)*3.1415926/180.0-qq.i.j;endif;
* if(uave.i.j<=0 & vave.i.j<=0) ;qq.i.j=(180-40.0)*3.1415926/180.0+qq.i.j;endif;
* if(uave.i.j>0 & vave.i.j<=0) ;qq.i.j=(270-40.0)*3.1415926/180.0+qq.i.j;endif;
uave.i.j=math_sqrt(uave.i.j*uave.i.j+vave.i.j*vave.i.j)*math_cos(qq.i.j*3.1415926/180.0)*0.75
vave.i.j=math_sqrt(uave.i.j*uave.i.j+vave.i.j*vave.i.j)*math_sin(qq.i.j*3.1415926/180.0)*0.75
* uave.i.j=math_sqrt(uave.i.j*uave.i.j+vave.i.j*vave.i.j)*math_cos(qq.i.j)*0.75
* vave.i.j=math_sqrt(uave.i.j*uave.i.j+vave.i.j*vave.i.j)*math_sin(qq.i.j)*0.75
j=j+1
endwhile
i=i+1
endwhile
*************************************************************************************************************************************
*************************************************************************************************************************************
i=1
while(i<=9)
j=1
while(j<=13)
hd.i.j=0.
k=1
while(k<=5)
'set lev 'subwrd(levstr,k)
'undefine fld'
'define fld=uwnd.1'
'q defval fld '32+j' '48+i
u0=subwrd(result,3)
'undefine fld'
'define fld=vwnd.2'
'q defval fld '32+j' '48+i
v0=subwrd(result,3)
'set lev 'subwrd(levstr,k+1)
'undefine fld'
'define fld=uwnd.1'
'q defval fld '32+j' '48+i
u1=subwrd(result,3)
'undefine fld'
'define fld=vwnd.2'
'q defval fld '32+j' '48+i
v1=subwrd(result,3)
hd.i.j=hd.i.j+(u1-uave.i.j)*(v0-vave.i.j)-(v1-vave.i.j)*(u0-uave.i.j)
k=k+1
endwhile
'set defval cr '32+j' '48+i' 'hd.i.j
* say 'set defval sucess' ; pull c
* 'd 'hd.i.j
* 'print '
j=j+1
endwhile
i=i+1
endwhile
'enable print f:\hyx\data\scb\20-06-lxd.gmf'
'set cint 40'
'd cr'
'print '
'disable print'
* 'reinit'
* say 'u0='u0' u1='u1
* say 'v0='v0' v1='v1
* say ' i='i' j='j
* say ' hd.'i'.'j'='hd.i.j
垂直螺旋度的gs文件:
'reinit'
'clear'
'sdfopen f:\hyx\data\ncep\uwnd.2003.nc'
'sdfopen f:\hyx\data\ncep\vwnd.2003.nc'
'sdfopen f:\hyx\data\ncep\omega.2003.nc'
'set mpdset mres'
'set lon 80 110'
'set lat 30 50'
'set lev 700 200'
'set time 12z20jul'
'define wd=hcurl(uwnd.1,vwnd.2)'
'define lx=-(wd*omega.3*10.)/12.64'
*'set xlevs 100 101 102 103 104 105'
'set lat 40'
'enable print f:\hyx\data\scb\lxd-4.gmf'
'd lx*1e+6'
'draw title lxd-20-18'
'print'
'disable print' |
|