- 积分
- 146
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-8-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大神,麻烦指点下,感激不尽。
本人新手一枚,是想用wrfout输出的土壤湿度数据与cpc的土壤湿度数据做个相关性检验。但是一直出不了图,或者出图显示无数据前面是先做了一个土壤湿度的月平均,然后进行插值,然后进行相关性计算。基本都是ncl官网的例子截取的部分。
这是报的错
warning:esccr: Non-fatal conditions encountered: all missing or constant values
(0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.
(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:
(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
(0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.
(0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:
(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
这个是ncl程序
begin
InterpMethod= "patch" ; define interpolation method
srcDirName = "/vol6/home/fgz/weiyongheng/"
srcFileName = "wrfout_d02_2017-03-01_00:00:00.nc"
srcFilePath = srcDirName + srcFileName
sfile = addfile(srcFilePath,"r")
sm1 = sfile->SMOIS(0:743,1,:,:)
sm = dim_avg_n_Wrap(sm1,0)
lat2d = sfile->XLAT(0,:,:) ; (south_north,west_east)
lon2d = sfile->XLONG(0,:,:)
dims = dimsizes(lat2d)
nlat = dims(0)
nlon = dims(1)
lat = fspan(min(lat2d), max(lat2d) ,nlat)
lon = fspan(min(lon2d), max(lon2d) ,nlon)
Opt = True
Opt@SrcTitle = "WRF grid" ; optional
Opt@WgtFileName = "WRF_to_Rect.WgtFile_"+InterpMethod+".nc"
Opt@SrcFileName = "WRF.SCRIP_grid_description.nc" ; Name of source and
Opt@SrcRegional = True
Opt@SrcGridLat = lat2d
Opt@SrcGridLon = lon2d
Opt@DstFileName = "Rectilinear.SCRIP_grid_description.nc" ; destination files
Opt@DstGridType = "rectilinear"
Opt@DstGridLat = lat
Opt@DstGridLon = lon
Opt@DstRegional = True
Opt@ForceOverwrite = True
Opt@InterpMethod = InterpMethod
sm_regrid = ESMF_regrid(sm,Opt)
sm_regrid&lat@units = "degree_north"
sm_regrid&lon@units = "degree_east" ; Do the regridding for sm
a2 = addfile("/vol6/home/fgz/weiyongheng/soilw.mon.mean.v2.nc","r")
sm2 = a2->soilw(830,:,:)
sm22 = sm2/1000.
maxlag = 2 ; set lag
ccr = esccr(sm_regrid(34:40,82:98),sm22(34:40,82:98),maxlag) ; calc cross correlations
copy_VarAtts(sm_regrid,ccr)
copy_VarCoords_1(sm22,ccr)
wks = gsn_open_wks("png","corel") ; send graphics to PNG file
res = True ; make plot mods
res@cnFillOn = True ; turn on color
res@cnFillPalette = "BlWhRe" ; set color map
res@cnLinesOn = False ; turn off contour lines
res@cnLevelSelectionMode = "ManualLevels" ; manually set cn levels
res@cnMinLevelValF = 0 ; min level
res@cnMaxLevelValF = 1 ; max level
res@cnLevelSpacingF = 0.1
res@mpMinLonF = 82
res@mpMaxLonF = 98
res@mpMinLatF = 34
res@mpMaxLatF = 40 ; contour level spacing
res@cnLabelBarEndStyle = "ExcludeOuterBoxes" ; remove the two end boxes from the labelbar
res@pmLabelBarWidthF = 0.8
lag = 0
res@tiMainString = "Correlations at lag "+lag
plot = gsn_csm_contour_map(wks,ccr(:,:),res)
end
|
|