- 积分
- 403
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-1-15
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-6-21 20:41:21
|
显示全部楼层
是的已经解决了
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
;************************************************
; open file and read in variable
;***********************************************
;levels 1000 925 850 700 600 500 400 300
; 层数 0 1 2 3 4 5 6 7
;***********************************************
nlat=73
nlon=144
nyear=35
nlev=8
p = (/ 1000.,925.,850.,700.,600.,500., \
400.,300.,250.,200.,150.,100., \
70.,50.,30.,20.,10. /)
linlog = 1
pbot = 1100.
ptop = 300.
u_file=addfile("uwnd_Dtrend.nc","r")
v_file=addfile("vwnd_Dtrend.nc","r")
p_file=addfile("pres_Dtrend.nc","r")
shum_file=addfile("shum_Dtrend.nc","r")
xx_file=addfile("uwnd.mon.mean.nc","r")
uu=u_file->uwnd_Dtrend
vv=v_file->vwnd_Dtrend
pres=p_file->pres_Dtrend
shum=shum_file->shum_Dtrend
qu = new((/nyear,nlev,nlat,nlon/),float)
qv = new((/nyear,nlev,nlat,nlon/),float)
qu=shum*uu
qv=shum*vv
copy_VarCoords(uu,qu)
copy_VarCoords(vv,qv)
qu@_FillValue=-9.99E+33
qv@_FillValue=-9.99E+33
qu_new = new((/nyear,nlev+9,nlat,nlon/),float)
qv_new = new((/nyear,nlev+9,nlat,nlon/),float)
do i=0,7
qu_new(:,i,:,:)= qu(:,i,:,:)
qv_new(:,i,:,:)= qv(:,i,:,:)
end do
do j=8,nlev+9-1
qu_new(:,j,:,:)= 0.0
qv_new(:,j,:,:)= 0.0
end do
qu_new&level = xx_file->uwnd&level
qv_new&level = xx_file->uwnd&level
; printVarSummary(qu_new)
u = vibeta (p,qu_new(time|:,lat|:,lon|:,level|:),linlog,pres,pbot,ptop)/9.8 ; returns u(time,lat,lon)
v = vibeta (p,qv_new(time|:,lat|:,lon|:,level|:),linlog,pres,pbot,ptop)/9.8
copy_VarCoords(uu(:,0,:,:),u)
copy_VarCoords(vv(:,0,:,:),v)
u@_FillValue=-9.99E+33
v@_FillValue=-9.99E+33
; printVarSummary(v)
asciiwrite ("allqu.txt" , u)
delete(uu)
delete(vv)
delete(pres)
delete(shum)
end |
|