- 积分
- 1502
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-4-12
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
- |
问题概况: |
用以前已经调通的ncl脚本画图,却画不出来了,提示读不了trmm的3B42文件,实在是想不通 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
3 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
提示错误如下:
fatal:NetCDF: Unknown file format
fatal:Could not open (/public/home/huanglei/data/0731/3B42.20130731.12.7.nc)
fatal:NetCDF: Unknown file format
fatal:Could not open (/public/home/huanglei/data/0731/3B42.20130731.12.7.nc)
fatal:file (g) isn't defined
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 6060 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 33 in file trmmnc2.ncl
我的脚本:(求大神帮忙看看到底是什么问题,我已经看了很久了,没看出来有什么端倪)
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"
begin
fils1 = systemfunc ("ls /public/home/huanglei/data/0731/3B42.*.nc")
a=addfile("/public/home/huanglei/d0320130731"+".nc","r")
times=wrf_user_getvar(a,"times",-1)
ntime=dimsizes(times)
rainnc1= wrf_user_getvar(a,"RAINNC",11)
rainc1 = wrf_user_getvar(a,"RAINC",11)
;printVarSummary(rain)
rain1 = rainnc1 + rainc1
rainnc2= wrf_user_getvar(a,"RAINNC",13)
rainc2 = wrf_user_getvar(a,"RAINC",13)
rain2 = rainnc2 + rainc2
rain=rain2-rain1
lat2=wrf_user_getvar(a,"XLAT",-1)
lon2=wrf_user_getvar(a,"XLONG",-1)
rain@lat2d=lat2(1,:,:)
rain@lon2d=lon2(1,:,:)
printVarSummary(rain)
numfiles1=dimsizes(fils1)
print(numfiles1)
f1 = addfiles (fils1, "r")
pcp1 = addfiles_GetVar (f1, fils1, "pcp")
lat =addfiles_GetVar(f1,fils1,"latitude")
lon =addfiles_GetVar(f1,fils1,"longitude")
printVarSummary(pcp1)
pcp_sum1=dim_sum_n(pcp1(0:0,:,:),0)
pcp_sum1!0="lat"
pcp_sum1!1="lon"
pcp_sum1&lat=lat(0:399)
pcp_sum1&lon=lon(0:1439)
;pcp1!0="lat"
;pcp1!1="lon"
;pcp1&lat=lat(0:400)
;pcp1&lon=lon(0:1440)
printVarSummary(pcp1)
wks=gsn_open_wks("ps","ffpcp11")
;colors = (/"white","black","royal blue","light sky blue",\
; "powder blue","light sea green","pale green","wheat","brown")
gsn_define_colormap(wks, "gsltod")
res=True
res@gsnSpreadColors = True ; spread out color table
res@cnFillOn = True ; turn on color
res@cnLinesOn = False
res@lbLabelBarOn = False
res@cnInfoLabelOn = False
res@cnLineLabelsOn = False
;res@cnLevelSelectionMode = "ExplicitLevels"
;res@cnLevels = (/150,200,250,300,350,400,450,500,550,600,650,700/)
;res@cnFillColors = (/20,10,8,79,74,73,72,106,71,141,51,66,68/)
res@mpPerimOn = True
res@gsnMaximize=True
res@pmTickMarkDisplayMode = "Always"
res@gsnDraw = False ; don't draw yet
res@gsnFrame = False
res@mpGeophysicalLineColor = "Black"
res@mpNationalLineColor = "Black"
res@mpDataSetName = "Earth..4"
res@mpDataBaseVersion = "MediumRes"
res@mpOutlineSpecifiers = ("China:states")
res@mpNationalLineThicknessF= 0.1
res@mpOutlineDrawOrder = "PostDraw"
res@mpLimitMode = "LatLon" ; Limit the map view.
res@mpMinLonF = min(lon2)
res@mpMaxLonF = max(lon2)
res@mpMinLatF = min(lat2)
res@mpMaxLatF = max(lat2)
res1=res
res2=res
res1@gsnLeftString = "(a):WRF"
res1@gsnRightString = ""
res1@sfXCStartV = min(lon2) ; Define where contour
res1@sfXCEndV = max(lon2)
res1@sfYCStartV = min(lat2)
res1@sfYCEndV = max(lat2)
res2@gsnLeftString = "(b):TRMM"
res2@gsnRightString = ""
resP = True ; modify the panel plot
resP@gsnMaximize = False
resP@gsnPanelLabelBar = True
resP@pmLabelBarWidthF = 0.8
resP@lbLabelFontHeightF = 0.01
resP@lbBoxLinesOn = False
resP@lbTitleOn = True ; turn on title
resP@lbTitleString = "mm"
;resP@lbTitlePosition = "Right" ; title position
resP@lbTitleFontHeightF= .015 ; make title smaller
;resP@lbTitleDirection = "Across"
plot=new(2,graphic)
plot(0)=gsn_csm_contour_map(wks,rain,res1)
plot(1)=gsn_csm_contour_map(wks,pcp_sum1,res2)
gsn_panel(wks,plot,(/1,2/),resP)
end
|
|