登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 568679112 于 2014-2-3 09:28 编辑
1,提取资料
从necp上下载下来shum,uwnd,vwnd和pres的月平均资料,然后提取资料如下:
提取shum:
- 'reinit'
- mon.1=Jan;mon.2=Feb;mon.3=Mar;mon.4=Apr;mon.5=May;mon.6=Jun;
- mon.7=Jul;mon.8=Aug;mon.9=Sep;mon.10=Oct;mon.11=Nov;mon.12=Dec
- 'sdfopen e:/lunwen/ziliao/shum.mon.mean.nc'
- 'set gxout fwrite'
- imon=1
- while(imon<=12)
- 'set fwrite e:/sst/ex1/sqtl/'mon.imon'_shum.grd'
- y=1948
- y1=1971
- y2=2010
- while(y1<=y2)
- ta=(y1-y)*12+imon
- 'set t 'ta''
- nz=1
- while(nz<=8)
- 'set z 'nz''
- 'set x 1 144'
- 'set y 1 73'
- 'd shum'
- nz=nz+1
- endwhile
- y1=y1+1
- endwhile
- 'disable fwrite'
- imon=imon+1
- endwhile
- ;
提取u,v和pres类似,只是pres只有一层,所以不用z循环了。
2.写这些提取出来资料的ctl,由于我提取的为每种资料各个月份的,所以ctl为单个月份40年的:
dset e:/sst/ex1/sqtl/jan_shum.grd
undef -9.99e+8
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 8 levels 1000 925 850 700 600 500 400 300
tdef 40 linear DEC1971 1yr
vars 1
shum 8 99 eigenvactors matrix of EOF
endvars
(要注意里面的层数,是8层,vars那里的8要对应层数,我一开始没注意,在这里吃力好多苦头,整了2个小时没弄出来,后来想放弃了,在论坛里不经意看到才弄出来)
u和v的ctl类似的,pres的ctl为:
dset e:/sst/ex1/sqtl/jan_pres.grd
undef -9.99e+8
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 1 linear 1 1
tdef 40 linear DEC1971 1yr
vars 1
p 0 99 eigenvactors matrix of EOF
endvars
(这里的vars下面的层数要写0代表1层,我一开始写了1,也是怎么弄也弄不出来!!!)
3.逐层水汽通量,是根据论坛里大一个大侠的帖子写的:
- *flying_nuist
- 'reinit'
- 'open e:\sst\ex1\sqtl\jan_uwnd.ctl'
- 'open e:\sst\ex1\sqtl\jan_vwnd.ctl'
- 'open e:\sst\ex1\sqtl\jan_shum.ctl'
- 'set fwrite e:\sst\ex1\sqtl\quv1.grd'
- 'set gxout fwrite'
- y1=1
- while(y1<=40)
- nz=1
- while(nz<=8)
- 'set z 'nz''
- 'set t 'y1''
- 'set y 1 73'
- 'set x 1 144'
- 'define qu=u*shum.3/9.8'
- 'd qu'
- nz=nz+1
- endwhile
- nz=1
- while(nz<=8)
- 'set z 'nz''
- 'set t 'y1''
- 'set y 1 73'
- 'set x 1 144'
- 'define qv=v.2*shum.3/9.8'
- 'd qv'
- nz=nz+1
- endwhile
- nz=1
- while(nz<=8)
- 'set z 'nz''
- 'set t 'y1''
- 'set y 1 73'
- 'set x 1 144'
- 'define qu=u*shum.3/9.8'
- 'define qv=v.2*shum.3/9.8'
- 'd hdivg(qu,qv)'
- nz=nz+1
- endwhile
- y1=y1+1
- endwhile
- 'disable fwrite'
- 'reinit'
- ;
对应的ctl为:
dset e:/sst/ex1/sqtl/quv1.grd
undef -9.99e+8
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 8 levels 1000 925 850 700 600 500 400 300
tdef 40 linear DEC1971 1yr
vars 3
qu 8 99 eigenvactors matrix of EOF
qv 8 99 eigenvactors matrix of EOF
quv 8 99 eigenvactors matrix of EOF
endvars
(注意层数)
4.整层水汽通量和散度为(也是根据上面提到的那位大侠写得):
- *flying_nuist
- 'reinit'
- 'open e:\sst\ex1\sqtl\quv1.ctl'
- 'open e:\sst\ex1\sqtl\jan_pres.ctl'
- 'set fwrite e:\sst\ex1\sqtl\quv1_all.grd'
- 'set gxout fwrite'
- ta=1
- while(ta<=40)
- 'set t 'ta''
- 'set z 1'
- 'set y 1 73'
- 'set x 1 144'
- 'define qua=vint(p.2,qu,300)*9.8'
- 'define qva=vint(p.2,qv,300)*9.8'
- 'd qua'
- 'd qva'
- 'd hdivg(qua,qva)'
- ta=ta+1
- endwhile
- 'disable fwrite'
- 'reinit'
- ;
对应ctl:
dset e:/sst/ex1/sqtl/quv1_all.grd
undef -9.99e+8
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 1 linear 0 1
tdef 40 linear DEC1971 1yr
vars 3
qua 0 99 eigenvactors matrix of EOF
qva 0 99 eigenvactors matrix of EOF
quva 0 99 eigenvactors matrix of EOF
endvars
(也是注意层数,今天主要被ctl里的层数正懵了,所以老提醒层数!!!!!!!!!!)
5.出图gs:
'reinit'
'open e:/sst/ex1/sqtl/quv1_all.ctl'
*'set gxout stream'
'set lat 0 60'
'set lon 20 150'
'set gxout shaded'
'define a=ave(qua,t=1,t=40)'
'define b=ave(qva,t=1,t=40)'
'd sqrt(a*a+b*b)'
'set gxout vector'
'd a;b'
;
贴个图看看(还没修饰):
|