- 积分
- 1782
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-4-23
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近装好了NCL绘图软件,在使用中出现了一些小问题,经查询官网例子和论坛帖子无果后,只好发帖问一下大家,希望能得到前辈们的帮助。
我使用的是NCEP再分析资料,其中包含了某一月份每日的位势涡度资料,分为三层,即500hPa,700hPa以及850hPa。在一位前辈的ncl脚本文件基础上进行了修改,最终出现问题如下。我的资料中time为int格式数据,应转为double格式资料才可以读取,不然出现错误如下。望有热心的前辈给予帮助,谢谢。
另附代码
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/cnmap/cnmap.ncl"
begin
f = addfile("data/pv.nc","r")
pv = short2flt( f->pv )
time = f->time
lat = f->latitude
lon = f->longitude
level = f->level
pv!0 = "time"
pv!1 = "lat"
pv!2 = "lon"
pv!3 = "level"
pv&time = time
pv&lat = lat
pv&lon = lon
pv&level =level
pv&lat@units = "degrees_north"
pv&lon@units = "degrees_east"
;************************************************
; create plot
;************************************************
wks = gsn_open_wks("png","plot/pv") ; open a pdf file
gsn_define_colormap(wks,"rainbow") ; choose color map
plot= new(4,graphic)
res = True ; plot mods desired
res@gsnFrame = False
res@gsnDraw = False
res@gsnSpreadColors = True ; use full colormap
res@mpOutlineOn = True
res@mpFillOn = True
res@mpMinLatF = 17. ; zoom in on a subregion
res@mpMaxLatF = 55.
res@mpMinLonF = 72.
res@mpMaxLonF = 136.
res@mpGeophysicalLineThicknessF=1.3
res@cnFillOn = True ; turn on color
res@cnLinesOn = False
res@cnLineLabelsOn = False ; no contour line labels
res@cnInfoLabelOn = False ; no info label
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = 180. ; set min contour level
res@cnMaxLevelValF = 300. ; set max contour level
res@cnLevelSpacingF = 2. ; set contour spacing
res@lbLabelBarOn = False ; turn off individual cb's
res@gsnLeftString = "Temprature in 7.30 0"
plot(0) = gsn_csm_contour_map_ce(wks,pv(1,:,:),res)
delete(res@gsnLeftString)
res@gsnLeftString = "Temprature in 7.30 6"
plot(1) = gsn_csm_contour_map_ce(wks,pv(1,:,:),res)
delete(res@gsnLeftString)
res@gsnLeftString = "Temprature in 7.30 12"
plot(2) = gsn_csm_contour_map_ce(wks,pv(1,:,:),res)
delete(res@gsnLeftString)
res@gsnLeftString = "Temprature in 7.30 18"
plot(3) = gsn_csm_contour_map_ce(wks,pv(1,:,:),res)
;************************************************
; create panel
;************************************************
resP = True
resP@gsnFrame = False
resP@gsnPanelLabelBar = True ; add common colorbar
resP@gsnPanelFigureStrings = (/"(a)","(b)","(c)","(d)"/)
gsn_panel(wks,plot,(/2,2/),resP)
frame(wks)
end
|
-
-
|