爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4215|回复: 2

用以前已经调通的ncl脚本画图,却画不出来了,提示读不了trmm的3B42文件

[复制链接]
发表于 2015-8-17 10:09:12 | 显示全部楼层 |阅读模式
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

密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-8-17 10:21:23 | 显示全部楼层
本帖最后由 黄小仙儿 于 2015-8-17 10:26 编辑

刚刚把trmm文件ncdump了几次,发现找不到数据,但是我明明就是把数据放在这的啊。好郁闷,重新传了次数据,改了路径还是不行,求大神指点啊
netcdf library version "4.0" of Mar 13 2015 15:12:20 $
[huanglei@node253 ~]$ ncdump -c huanglei/data/0731/3B42.20130731.12.7.nc
ncdump: huanglei/data/0731/3B42.20130731.12.7.nc: No such file or directory
[huanglei@node253 ~]$ ncdump -c public/huanglei/data/0731/3B42.20130731.12.7.nc
ncdump: public/huanglei/data/0731/3B42.20130731.12.7.nc: No such file or directory
[huanglei@node253 ~]$ ncdump -c /public/huanglei/data/0731/3B42.20130731.12.7.nc
ncdump: /public/huanglei/data/0731/3B42.20130731.12.7.nc: No such file or directory
[huanglei@node253 ~]$ ncdump -c /public/huanglei/0731/3B42.20130731.12.7.nc
ncdump: /public/huanglei/0731/3B42.20130731.12.7.nc: No such file or directory
[huanglei@node253 ~]$ ncdump -c /public/huanglei/0731/3B42.20130731.15.7.nc
ncdump: /public/huanglei/0731/3B42.20130731.15.7.nc: No such file or directory
[huanglei@node253 ~]$
{:eb302:}{:eb303:}
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-8-17 17:47:03 | 显示全部楼层
已经解决了,重新下的数据,估计是之前下的数据不对
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表