- 积分
- 8280
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-3-11
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
请问一下在共用坐标的时候第一列都是正确的,怎么后面的就出错了呢?代码如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
wks = gsn_open_wks ("pdf","notrans.wrf_aws_quyu_t2_chazhi")
gsn_define_colormap(wks, "MPL_coolwarm")
res = True
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
;>--------------------------------------------<
; set for the map
;>--------------------------------------------<
res@mpMinLatF = 20.
res@mpMaxLatF = 40.
res@mpMinLonF = 70.
res@mpMaxLonF = 110.
res@mpFillOn = True
res@mpOutlineOn = True ; Use outlines from shapefile
res@mpDataBaseVersion = "MediumRes"
res@mpDataSetName = "Earth..4"
res@mpOutlineSpecifiers = (/"China:states","Taiwan"/) ;China:states
res@mpAreaMaskingOn = True
res@mpOutlineBoundarySets = "NoBoundaries"
res@mpMaskAreaSpecifiers = (/"China","Taiwan"/)
res@mpFillDrawOrder ="PostDraw"
res@mpLandFillColor = "white"
res@mpInlandWaterFillColor = "white"
res@mpOceanFillColor = "white"
;>--------------------------------------------<
; set for the plot
;res@cnFillDrawOrder = "PreDraw"
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnFillOn = True
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@gsnSpreadColors = True
res@lbLabelAutoStride = True
res@gsnAddCyclic = False ;important
res@cnSmoothingOn = True
res@cnLevels = (/-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7/);T
res@lbLabelBarOn = False ; 关闭各个plot的labelbar
res@tmXBLabelsOn = False ; no bottom labels
res@tmXBOn = False ; no bottom tickmarks
res@tmYRLabelsOn = False ; no right labels
res@tmYROn = False ; no right tickmarks
res@tmYLLabelsOn = False ; do not draw left labels
res@tmYLOn = False ; no left tickmarks
res@tmXTLabelsOn = False ; do not draw top labels
res@tmXTOn = False ; no top tickmarks
res@lbLabelFontHeightF = 0.005
res@tmXBLabelFontHeightF = 0.02
res@tmYLLabelFontHeightF = 0.02
plots = new(6,graphic)
;>============================================================<
do i=6,8
if(i.eq.6)then
MYJ_name = "../WRF-2013-MYJ/wrfout_d01_2013-06-01"
YSU_name = "../WRF-2013-YSU/wrfout_d01_2013-06-01"
data = asciiread("../aws/jieguo6.txt",-1,"float")
argu = onedtond(data, (/2439,13/))
end if
if(i.eq.7)then
MYJ_name = "../WRF-2013-MYJ/wrfout_d01_2013-07-01"
YSU_name = "../WRF-2013-YSU/wrfout_d01_2013-07-01"
trmm_name = "../trmm/3B42RT.201307"
data = asciiread("../aws/jieguo7.txt",-1,"float")
argu = onedtond(data, (/2439,13/))
end if
if(i.eq.8)then
MYJ_name = "../WRF-2013-MYJ/wrfout_d01_2013-08-01"
YSU_name = "../WRF-2013-YSU/wrfout_d01_2013-08-01"
data = asciiread("../aws/jieguo8.txt",-1,"float")
argu = onedtond(data, (/2439,13/))
end if
;MYJ ,aws
;>============================================================<
MYJfiles=systemfunc("ls -1 "+ MYJ_name +"*")
MYJf=addfiles(MYJfiles,"r")
ListSetType(MYJf,"cat")
t2=wrf_user_getvar(MYJf[:],"T2",-1)
lon2d = wrf_user_getvar(MYJf[:],"XLONG", 0)
lat2d = wrf_user_getvar(MYJf[:],"XLAT", 0)
avg_t2 = dim_avg_n_Wrap(t2, 0)
avg_t2c=avg_t2-273.15
aws_t2=argu(:,8)
lat=argu(:,2)
lon=argu(:,1)
olon = fspan(70,110,161)
olat = fspan(20,40,81)
data1 = new((/161,81/),"float")
olon!0 = "lon"
olon@long_name = "lon"
olon@units = "degrees-east"
olon&lon = olon
olat!0 = "lat"
olat@long_name = "lat"
olat@units = "degrees_north"
olat&lat = olat
MYJ_grid_t2 = rcm2rgrid_Wrap(lat2d,lon2d,avg_t2c,olat,olon,0)
aws_t2@_FillValue = 999999.000000
rscan = (/10,5,3,2,1,0.5,0.25,0.1,0.05,0.01/) ;连续的有效半径大小
aws_grid_t2 = obj_anal_ic_Wrap(lon,lat,aws_t2,olon,olat,rscan,False)
result_MYJ_t2=MYJ_grid_t2 - aws_grid_t2
copy_VarMeta(MYJ_grid_t2,result_MYJ_t2)
delete(MYJ_grid_t2)
if(i.eq.6)then
result_MYJ_t2@long_name="MYJ:June"
result_MYJ_t2@units="centigrade"
end if
if(i.eq.7)then
result_MYJ_t2@long_name="MYJ:July"
result_MYJ_t2@units="centigrade"
end if
if(i.eq.8)then
result_MYJ_t2@long_name="MYJ:August"
result_MYJ_t2@units="centigrade"
end if
delete(MYJfiles)
delete(MYJf)
j=i-6
if (j .ge. 3) then
res@tmXBLabelsOn = True
res@tmXBOn = True
else
res@tmXBLabelsOn = False
res@tmXBOn = False
end if
if (j%3 .eq. 0) then
res@tmYLLabelsOn = True
res@tmYLOn = True
else
res@tmYLLabelsOn = False
res@tmYLOn = False
end if
plots(i-6)=gsn_csm_contour_map(wks,result_MYJ_t2,res)
;YSU
;>============================================================<
YSUfiles=systemfunc("ls -1 "+ YSU_name +"*")
YSUf=addfiles(YSUfiles,"r")
ListSetType(YSUf,"cat")
t2=wrf_user_getvar(YSUf[:],"T2",-1)
avg_t2 = dim_avg_n_Wrap(t2, 0)
avg_t2c=avg_t2-273.15
YSU_grid_t2 = rcm2rgrid_Wrap(lat2d,lon2d,avg_t2c,olat,olon,0)
result_YSU_t2=YSU_grid_t2-aws_grid_t2
copy_VarMeta(YSU_grid_t2,result_YSU_t2)
delete(YSU_grid_t2)
delete(aws_grid_t2)
if(i.eq.6)then
result_YSU_t2@long_name="YSU:June"
result_YSU_t2@units="centigrade"
end if
if(i.eq.7)then
result_YSU_t2@long_name="YSU:July"
result_YSU_t2@units="centigrade"
end if
if(i.eq.8)then
result_YSU_t2@long_name="YSU:August"
result_YSU_t2@units="centigrade"
end if
delete(YSUfiles)
delete(YSUf)
delete(t2)
j=i-3
if (j .ge. 3) then
res@tmXBLabelsOn = True
res@tmXBOn = True
else
res@tmXBLabelsOn = False
res@tmXBOn = False
end if
if (j%3 .eq. 0) then
res@tmYLLabelsOn = True
res@tmYLOn = True
else
res@tmYLLabelsOn = False
res@tmYLOn = False
end if
plots(i-3)=gsn_csm_contour_map(wks,result_YSU_t2,res)
delete(result_MYJ_t2)
delete(result_YSU_t2)
print(i)
end do
pres = True ; 设置 panel resources.
pres@gsnMaximize = True ; 在panel中最大化plots.
pres@gsnPanelLabelBar = True ; 打开 panel labelbar.
pres@pmLabelBarWidthF = 0.8 ; 改变 labelbar 宽度.
pres@txString = "Not be corrected"
gsn_panel(wks,plots,(/2,3/),pres)
end
|
-
|