- 积分
- 63
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-11-20
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading lat
fatal:Execute: Error occurred at or near line 101 in file read_arwpost_60X60.ncl
how to 解决这些问题??拜谢各位大神
——————————————————————————————————————————————————
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/wrf/WRFUserARW.ncl"
;load "/home/wangxy/wrf_ncl_examples/website/WRFUserARW_add.ncl"
;load "/raid5e2/wangxy/BJClimate/post/WRFwxy11.ncl"
begin
a = "/home/Administrator/basic_res.dat"
b = addfile("/home/Administrator/geo_em.d01.nc","r")
type = "ps"
wks = gsn_open_wks(type,"nox_ave")
gsn_define_colormap(wks,"gui_default")
;****************************************************
; get data
lat = wrf_user_getvar(b,"XLAT_M",0)
lon = wrf_user_getvar(b,"XLONG_M",0)
hgt = wrf_user_getvar(b,"HGT_M",0)
setfileoption ("bin", "ReadByteOrder", "BigEndian")
dim0=80
dim1=80
dim2D = (/dim0,dim1/)
so2=new((/dim0,dim1/),"float")
so2!0="west_east"
so2!1="south_north"
no2=new((/dim0,dim1/),"float")
no2!0="west_east"
no2!1="south_north"
no=new((/dim0,dim1/),"float")
no!0="west_east"
no!1="south_north"
nox=new((/dim0,dim1/),"float")
nox!0="west_east"
nox!1="south_north"
so4=new((/dim0,dim1/),"float")
so4!0="west_east"
so4!1="south_north"
nh4=new((/dim0,dim1/),"float")
nh4!0="west_east"
nh4!1="south_north"
no3=new((/dim0,dim1/),"float")
no3!0="west_east"
no3!1="south_north"
ec=new((/dim0,dim1/),"float")
ec!0="west_east"
ec!1="south_north"
pm25=new((/dim0,dim1/),"float")
pm25!0="west_east"
pm25!1="south_north"
pm10=new((/dim0,dim1/),"float")
pm10!0="west_east"
pm10!1="south_north"
vis=new((/dim0,dim1/),"float")
vis!0="west_east"
vis!1="south_north"
so2 = fbindirread(a, 0 ,dim2D,"float")
no2 = fbindirread(a, 1 ,dim2D,"float")
no = fbindirread(a, 2 ,dim2D,"float")
so4 = fbindirread(a, 3 ,dim2D,"float")
nh4 = fbindirread(a, 4 ,dim2D,"float")
no3 = fbindirread(a, 5 ,dim2D,"float")
ec = fbindirread(a, 6 ,dim2D,"float")
pm25 = fbindirread(a, 7 ,dim2D,"float")
pm10 = fbindirread(a, 8 ,dim2D,"float")
vis = fbindirread(a, 9 ,dim2D,"float")
nox=no2+no
;********************************************************
; creat plot
res = True
res@cnFillOn = True ; turn on color
res@cnLinesOn = False ; no contour lines
res@cnInfoLabelOn = False
res@gsnAddCyclic = False ; regional data
; res@cnLevelSelectionMode = "ExplicitLevels"
; res@cnLevels = (/0., 250., 500., 750., 1000., 2500., 5000., 10000., \
; 200000., 300000. /)
res@cnLevelSelectionMode = "ManualLevels"
; vis 1 15 1; so2/no2/no/nox 0 120 10; pm10/25 0 220 20; ec 0 10 1; so4 0 15 1; nh4 0 4 0.5; no3 0 0.4 0.05
res@cnMinLevelValF = 0.
res@cnMaxLevelValF = 120.
res@cnLevelSpacingF = 10.
; res@cnFillColors = (/4,7,8,9,10,11,13,16,22,23/)
; res@cnFillColors = (/4,6,9,12,14,16,20,23/)
; The following resources are Required to plot this projection correctly
res@mpLimitMode = "Corners" ; method to zoom
res@mpLeftCornerLatF = lat(10,10)
res@mpLeftCornerLonF = lon(10,10)
res@mpRightCornerLatF = lat(dim1-11,dim1-11)
res@mpRightCornerLonF = lon(dim0-11,dim0-11)
res@mpProjection = "LambertConformal" ; projection
res@mpLambertParallel1F = 31.88961
res@mpLambertParallel2F = 31.88961
res@mpLambertMeridianF = 120.5875
res@tfDoNDCOverlay = True ; only it is False can use @lat2d @lon2d
res@pmTickMarkDisplayMode = "Always"
res@pmLabelBarDisplayMode = "Always" ; turn on color bar
res@pmLabelBarSide = "Bottom" ; put it on the bottom of plot
res@pmLabelBarWidthF = 0.6 ; control size of colorbar
res@pmLabelBarHeightF = 0.1 ;
res@pmLabelBarOrthogonalPosF = -0.02 ; position wrt plot
; res@lbLabelAutoStride = True ; every other label
res@lbLabelFontHeightF = 0.016 ; label bar font
res@lbOrientation = "Horizontal" ; label bar orientation
res@lbPerimOn = False ; no box around label bar
res@lbAutoManage = False ; we control how drawn not plot
plot = gsn_csm_contour_map (wks,nox(10:69,10:69),res)
end
|
|