- 积分
- 5103
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-10-31
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 勇敢的悲伤 于 2016-12-6 15:59 编辑
通过一段时间的学习,现在开始自己画图,但是遇到一个情况就是,设置画布大小的时候,这个命令好像没起作用一样,这到底是哪里出现问题了呢,请大家帮忙看一看,就是下面标记红色的部分,数字设置的有些怪异,是为了看到底有没有起作用。
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/contrib/cd_string.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
f=addfile("/cygdrive/e/fnl/fnl_20160415_06_00.grib2","r")
;print(f)
TMPprs=f->TMP_P0_L100_GLL0(:,:,:)
RHprs=f->RH_P0_L100_GLL0(:,:,:)
lev=f->lv_ISBL0
nz=26
nx=181
ny=360
;printVarSummary(lev)
;print(lev)
res = True
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
;>--------------------------------------------<
; set for the map
;>--------------------------------------------<
res@mpMinLatF = 30.
res@mpMaxLatF = 40.
res@mpMinLonF = 108.
res@mpMaxLonF = 120.
res@mpFillOn = True
res@mpOutlineOn = False ; Use outlines from shapefile
res@cnFillDrawOrder = "PreDraw"
res@mpDataBaseVersion = "MediumRes"
res@mpDataSetName = "Earth..4"
res@mpAreaMaskingOn = True
res@mpMaskAreaSpecifiers = (/"China","Taiwan","Disputed area between India and China","India:Arunachal Pradesh"/)
res@mpLandFillColor = "white"
res@mpInlandWaterFillColor = "white"
res@mpOceanFillColor = "white"
res@mpOutlineBoundarySets = "NoBoundaries"
;>--------------------------------------------<
; set for the plot
;>--------------------------------------------<
es=new((/nz,nx,ny/),float)
q=new((/nz,nx,ny/),float)
el=new((/nz,nx,ny/),float)
td=new((/nz,nx,ny/),float)
t_td=new((/nz,nx,ny/),float)
es(21,:,:)=6.112*exp(17.67*(TMPprs(21,:,:)-273.15)/(TMPprs(21,:,:)-29.65))
q(21,:,:)=RHprs(21,:,:)*(0.62197*es(21,:,:)/(lev(21)-es(21,:,:)))/100.
el(21,:,:)=log((q(21,:,:)/0.62197)*(lev(21))/(1.+(q(21,:,:)/0.62197)))
td(21,:,:)=273.15+(243.5*el(21,:,:)-440.8)/(19.48-el(21,:,:))
t_td(21,:,:)=TMPprs(21,:,:)-td(21,:,:)
t_td!0="lev"
t_td&lev=TMPprs&lv_ISBL0
t_td&lev@units="Pa"
t_td!1="lat"
t_td&lat=TMPprs&lat_0
t_td&lat@units="degrees_north"
t_td!2="lon"
t_td&lon=TMPprs&lon_0
t_td&lon@units="degrees_east"
;设置画布大小
res@vpHeightF=0.05
res@vpWidthF=0.08
res@vpXF=3.13
res@vpYF=3.85
;设置等值线
res@cnInfoLabelOn=False
res@cnLineLabelsOn=True
res@cnLineLabelAngleF=0.
res@cnMonoLineColor=False
res@cnLevelSelectionMode="ManualLevels"
res@cnMinLevelValF=3
res@cnMaxLevelValF=18
res@cnLevelSpacingF=3
res@cnLineThicknessF=5.
res@cnSmoothingOn=True
res@cnSmoothingDistanceF=0.
res@cnSmoothingTensionF=-3.
wks=gsn_open_wks("png","/cygdrive/e/fnl/t_td.5")
plot=gsn_csm_contour_map(wks,t_td(21,:,:),res)
;>============================================================<
; add China map
;>------------------------------------------------------------<
cnres = True
cnres@china = True ;draw china map or not
cnres@river = True ;draw changjiang&huanghe or not
cnres@province = True ;draw province boundary or not
cnres@nanhai = False ;draw nanhai or not
cnres@diqu = False ; draw diqujie or not
chinamap = add_china_map(wks,plot,cnres)
;>============================================================<
draw(plot)
frame(wks)
end
|
|