- 积分
- 526
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-4-6
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
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"
begin
FILE = systemfunc("ls"+" /cygdrive/L/DJBY/20y_winter/2017_1/*.grib2")
numFILE = dimsizes(FILE)
do j = 11,13
file_list = addfile(FILE(j), "r")
time=str_get_cols(FILE(j),39,49)
lon = file_list->lon_0
lat = file_list->lat_0
lon@units="degrees_east"
lat@units="degrees north"
dlon = (lon(2)-lon(1))*0.0174533
dlat = (lat(2)-lat(1)) * 0.0174533
;print(time)
nlev1=750
tmpx = file_list->TMP_P0_L100_GLL0({nlev1*100},:,:)
rhx = file_list->RH_P0_L100_GLL0({nlev1*100},:,:)
prsx=nlev1
esx=(6.112*exp(17.67*(tmpx-273.15)/(tmpx-29.65)))
qx=rhx*(0.62197*esx/(prsx-esx))/100.
ex=prsx*qx/(0.62197+qx)+1e-10
tlclx=55.0+2840.0/(3.5*log(tmpx)-log(ex)-4.805)
thetax=tmpx*((1000/prsx)^(0.2854*(1.0-0.28*qx)))
eqtx=thetax*exp(((3376./tlclx)-2.54)*qx*(1.0+0.81*qx))
vx= file_list->VGRD_P0_L100_GLL0({nlev1*100},:,:)
ux= file_list->UGRD_P0_L100_GLL0({nlev1*100},:,:)
nlev2 = 650
tmpy = file_list->TMP_P0_L100_GLL0({nlev2*100},:,:)
rhy = file_list->RH_P0_L100_GLL0({nlev2*100},:,:)
prsy=nlev2
esy=(6.112*exp(17.67*(tmpy-273.15)/(tmpy-29.65)))
qy=rhy*(0.62197*esy/(prsy-esy))/100
ey=prsy*qy/(0.62197+qy)+1e-10
tlcly=55.0+2840.0/(3.5*log(tmpy)-log(ey)-4.805)
thetay=tmpy*((1000/prsy)^(0.2854*(1.0-0.28*qy)))
eqty=thetay*exp(((3376./tlcly)-2.54)*qy*(1.0+0.81*qy))
vy = file_list->VGRD_P0_L100_GLL0({nlev2*100},:,:)
uy = file_list->UGRD_P0_L100_GLL0({nlev2*100},:,:)
nlev3 = 700
tmpz = file_list->TMP_P0_L100_GLL0({nlev3*100},:,:)
rhz = file_list->RH_P0_L100_GLL0({nlev3*100},:,:)
absvprs = file_list->ABSV_P0_L100_GLL0({nlev3*100},:,:)
prsz = nlev3
esz = (6.112*exp(17.67*(tmpz-273.15)/(tmpz-29.65)))
qz = rhz*(0.62197*esz/(prsz-esz))/100.
ez = prsz*qz/(0.62197+qz)+1e-10
tlclz = 55.0+2840.0/(3.5*log(tmpz)-log(ez)-4.805)
thetaz = tmpz*((1000/prsz)^(0.2854*(1.0-0.28*qz)))
eqtz = thetaz*exp(((3376./tlclz)-2.54)*qz*(1.0+0.81*qz))
rhz@_FillValue = -999.0
numlat = dimsizes(lat)
numlon = dimsizes(lon)
dtdX=new((/numlat, numlon/), typeof(rhz), rhz@_FillValue)
dtdY=new((/numlat, numlon/), typeof(rhz), rhz@_FillValue)
do n1=0,numlat-1
dX = 6378388.*cos(0.0174533*lat(n1))*dlon ; constant at this latitude
dtdX(n1:n1,:) = center_finite_diff_n(eqtz(n1:n1,:), dX ,False,0,1)
end do
do n2=0,numlon-1
dY = 6378388. * dlat
dtdY(:,n2:n2) = center_finite_diff_n(eqtz(:,n2:n2), dY, False, 0, 0)
end do
eqtxy=eqtx-eqty
vxy=vx-vy
uxy=ux-uy
dp=10000
mp1=-9.8*absvprs*eqtxy/dp
mp2=9.8*((vxy/dp)*dtdX-(uxy/dp)*dtdY)
mpv=mp1+mp2
mpv2=mp2*1E6
mpv1=mp1*1E6
copy_VarCoords(rhz,mpv1)
copy_VarCoords(rhz,mpv2)
wks = gsn_open_wks("png","mpv12_"+time)
res = True
res@mpMaxLatF = 40 ; specify the plot domain
res@mpMinLatF = 15. ;
res@mpMinLonF = 80. ;
res@mpMaxLonF = 130. ;
res@pmTickMarkDisplayMode = "Always"
res@mpOutlineOn = True ; turn the map outline on
res@mpDataSetName = "Earth..4"
res@mpDataBaseVersion = "MediumRes"
res@mpOutlineOn = True
res@mpOutlineSpecifiers = (/"China:states","Taiwan"/)
res@mpGeophysicalLineThicknessF = 2
res@mpNationalLineThicknessF = 2
res@gsnLeftString = ""
res@gsnRightString = ""
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame
res@gsnLeftStringFontHeightF =0.015
res@cnSmoothingOn=True
res@cnSmoothingDistanceF=0.0001
res@cnSmoothingTensionF=-0.2
res@cnLinesOn = False ; turn of contour lines
res@cnFillPalette = "WhiteBlueGreenYellowRed"
res@cnFillOn = True
res@cnInfoLabelOn = False ; disappear lable information
res@cnLevelSelectionMode = "ManualLevels" ; manual contour levels
res@cnMinLevelValF = -1.0 ; minimum level
res@cnMaxLevelValF = 1.0 ; maximum level
res@cnLevelSpacingF = 0.2 ; contour spacing
res@lbBoxMinorExtentF =0.2
res@lbTitleFontHeightF =0.012
res@lbLabelFontHeightF =0.013
res@lbLabelStride =2
resc=res
resc@cnFillOn = False
resc@cnLineThicknessesF =2
resc@cnLineColor ="black"
plot_mpv1 = gsn_csm_contour_map(wks,mpv1,res)
plot_mpv2 = gsn_csm_contour(wks,mpv2,resc) ; create the U-wind plot
overlay(plot_mpv1,plot_mpv2) ; overlay the U-wind plot on the temperature plot
draw(plot_mpv1) ; draw the temperature plot (with the U-wind plot overlaid)
frame(wks) ; advance the frame
end do
end |
|