- 积分
- 614
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-4-17
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
不知道为什么我画出来的地图和等值线填图没法叠加,ncl新手求大神看看脚本哪里不对,或者给个链接也行,多谢~
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
- begin
- ;
- ; The WRF ARW input file.
- ; This needs to have a ".nc" appended, so just do it.
- a = addfile("wrfout_d01_2008-07-22_19:00:00.nc","r")
- b = addfile("wrfout_d01_2008-07-22_20:00:00.nc","r")
- ; We generate plots, but what kind do we prefer?
- ;type = "x11"
- ; type = "pdf"
- type = "png"
- ;type="ps"
- ; type = "ncgm"
- wks = gsn_open_wks(type,"plt_Precip")
- ; Set some basic resources
- res = True
- res@MainTitle = "REAL-TIME WRF"
- pltres = True
- mpres = True
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;First get the variables we will need
- ; Get non-convective, convective and total precipitation
- ; Calculate tendency values
- ;-------------------------------------------------------------------------------------------------------------------
- rain_exp1 = wrf_user_getvar(a,"RAINNC",0)
- rain_con1 = wrf_user_getvar(a,"RAINC",0)
- rain_exp2 = wrf_user_getvar(b,"RAINNC",0)
- rain_con2 = wrf_user_getvar(b,"RAINC",0)
- rain_exp=rain_exp2-rain_exp1
- rain_con=rain_con2-rain_con1
- rain_tot = rain_exp + rain_con
- rain_tot@description = "Total Precipitation"
- ;------------------------------------------------------------------------------------------------------------ -------------------
- ; Plotting options for Precipitation
- opts_r = res
- opts_r@UnitLabel = "mm"
- opts_r@cnLevelSelectionMode = "ExplicitLevels"
- opts_r@cnLevels = (/ .1, .2, .4, .8, 1.6, 3.2, 6.4, \
- 12.8, 25.6, 51.2, 102.4/)
- opts_r@cnFillColors = (/"White","White","DarkOliveGreen1", \
- "DarkOliveGreen3","Chartreuse", \
- "Chartreuse3","Green","ForestGreen", \
- "Yellow","Orange","Red","Violet"/)
- opts_r@cnInfoLabelOn = False
- opts_r@cnConstFLabelOn = False
- opts_r@cnFillOn = True
-
- lat = wrf_user_getvar(a,"XLAT",0)
- lon = wrf_user_getvar(a, "XLONG", 0)
- ;----------------------------------------------------------------------
- ; Plot full domain first.
- ;----------------------------------------------------------------------
- opts_r@cnFillOn=True
- contour = wrf_contour(a,wks,rain_tot,opts_r)
-
- ;----------------------------------------------------------------------
- ; Plot partial domain.
- ;----------------------------------------------------------------------
- opts_r@sfXArray = lon
- opts_r@sfYArray = lat
- contour = wrf_contour(a,wks,rain_tot,opts_r)
- ;---Set special resource to indicate we are using XLAT/XLONG coordinates.
- pltres@LatLonOverlay = True
- ;---Zoom in on map, which we can do because we're using lat/lon coordinates.
- mpres@mpLeftCornerLatF = 28.
- mpres@mpRightCornerLatF = 34.
- mpres@mpLeftCornerLonF = 110.
- mpres@mpRightCornerLonF = 122.
- contour_tot = wrf_contour(a,wks, rain_tot, opts_r)
-
- delete(opts_r)
- ; MAKE PLOTS
- plot = wrf_map_overlays(a,wks,contour_tot,pltres,mpres)
-
- ;--------------------------------------------------------------------------------------------------------------------------------------------
- ;---------------------------------------------------
- ; add China map
- ;----------------------------------------------------
- map=wrf_map(wks, a, mpres)
- shp_name1="/usr/local/NCL/lib/ncarg/nclscripts/cnmap/cnmap.shp"
- lnres1=True
- lnres1@gsLineColor = "black"
- lnres1@gsLineThicknessF = 2.0
- poly1=gsn_add_shapefile_polylines(wks, map, shp_name1,lnres1)
- shp_name2="/usr/local/NCL/lib/ncarg/nclscripts/cnmap/river.shp"
- lnres2=True
- lnres2@gsLineThicknessF = 2.0
- lnres2@gsLineColor = "blue"
- poly2=gsn_add_shapefile_polylines(wks, map, shp_name2, lnres2)
- shp_name3="/usr/local/NCL/lib/ncarg/nclscripts/cnmap/cnhimap.shp"
- lnres3=True
- lnres3@gsLineThicknessF = 2.0
- lnres3@gsLineColor = "black"
- poly3=gsn_add_shapefile_polylines(wks, map, shp_name3, lnres3)
- draw(map)
- frame(wks)
- end
复制代码
|
-
-
|