- 积分
- 22
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-10-12
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 验证码yyy 于 2020-4-11 16:58 编辑
小弟NCL 刚入门 想通过现有的脚本更改投影方式 可否实现 可以改哪里呢 感谢感谢
以下贴出脚本
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.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_d03_2008-07-16_12:00:00","r")
; We generate plots, but what kind do we prefer?
type = "x11"
; type = "pdf"
; type = "ps"
; type = "ncgm"
wks = gsn_open_wks("pdf","plt_Cloud_moren")
gsn_define_colormap(wks,"WhBlGrYeRe") ; overwrite the .hluresfile color map
; Set some basic resources
res = True
res@MainTitle = "REAL-TIME WRF"
mpres = True ; Map resources
pltres = True ; Plot resources
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; What times and how many time steps are in the data set?
times = wrf_user_getvar(a,"times",-1) ; get all times in the file
ntimes = dimsizes(times) ; number of times in the file
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
do it = 0,ntimes-1,6 ; TIME LOOP
print("Working on time: " + times(it) )
res@TimeLabel = times(it) ; Set Valid time to use on plots
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need
if(isfilevar(a,"QVAPOR"))
qv = wrf_user_getvar(a,"QVAPOR",it)
qv = qv*1000.
qv@units = "g/kg"
end if
if(isfilevar(a,"QCLOUD"))
qc = wrf_user_getvar(a,"QCLOUD",it)
qc = qc*1000.
qc@units = "g/kg"
end if
if(isfilevar(a,"QRAIN"))
qr = wrf_user_getvar(a,"QRAIN",it)
qr = qr*1000.
qr@units = "g/kg"
end if
if(isfilevar(a,"QICE"))
qi = wrf_user_getvar(a,"QICE",it)
qi = qi*1000.
qi@units = "g/kg"
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
do level = 0,24,5 ; LOOP OVER LEVELS
display_level = level + 1
opts = res
opts@cnFillOn = True
opts@gsnSpreadColors = False
opts@PlotLevelID = "Eta Level " + display_level
if (isvar("qv"))
contour = wrf_contour(a,wks,qv(level,:,:),opts)
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
delete(contour)
end if
if (isvar("qc"))
contour = wrf_contour(a,wks,qc(level,:,:),opts)
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
delete(contour)
end if
if (isvar("qr"))
contour = wrf_contour(a,wks,qr(level,:,:),opts)
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
delete(contour)
end if
if (isvar("qi"))
qi_plane = qi(level,:,:)
contour = wrf_contour(a,wks,qi(level,:,:),opts)
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
delete(contour)
end if
delete(opts)
end do ; END OF LEVEL LOOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end do ; END OF TIME LOOP
end
|
-
我想要的方方正正的样子
-
脚本画出来的投影样子
|