|
发表于 2012-5-18 19:05:33
|
显示全部楼层
先把距平值提取出来到一个单独的文件中
然后使用这个文件中的两个变量相减(如果不需要距平值,就直接写出距平相减的值就行了)来作图
- 'reinit'
- 'sdfopen K:\ncep\pressure\uwnd.mon.mean.nc '
- 'set gxout fwrite'
- 'set fwrite K:\ncep\uwnd.anomaly.grd'
- i=282
- 'set lev 850'
- 'define sumave1=aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=41,y=45)'
- 'define sumave2=aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=47,y=51)'
- i=i+12
- #40年夏季的区域平均
- while(i<=750)
- 'sumave1=sumave1+aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=41,y=45)'
- 'sumave2=sumave2+aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=47,y=51)'
- i=i+12
- endwhile
- *all year-summer aave
- 'sumave1 = sumave1/40.0'
- 'sumave2=sumave2/40.0'
- #每年夏季的区域平均
- i=282
- 'set lev 850'
- 'set x 1'
- 'set y 1'
- 'set z 1'
- 'define summer1=aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=41,y=45)'
- 'define summer2=aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=47,y=51)'
- 'd summer1'
- 'd summer2'
- i=i+12
- while(i<=750)
- #提取距平数据
- 'summer1=sumave1-aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=41,y=45)'
- 'summer2=sumave2-aave(ave(uwnd,t='i',t='i'+2),x=41,x=61,y=47,y=51)'
- 'd summer1'
- 'd summer2'
- i=i+12
- endwhile
- 'disable fwrite'
- ;
输出的文件对应的ctl
- dset K:\ncep\uwnd.anomaly.grd
- title testdata
- undef -9.99e+33
- xdef 1 linear 1 1
- ydef 1 linear 1 1
- zdef 1 linear 1 1
- tdef 40 linear jan1958 1yr
- vars 2
- an1 0 99 an1 data
- an2 0 99 an2 data
- endvars
剩下的自己搞定吧,最基础的东西了,出来的图上面贴过了,直接是两个距平的数据做的 |
|