- 积分
- 10605
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-10-10
- 最后登录
- 1970-1-1
|
发表于 2014-5-8 20:02:31
|
显示全部楼层
本帖最后由 longlivehj 于 2014-5-8 20:03 编辑
我改了一下,你运行试试。比较乱,见谅!
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
fi = addfile("/home/Huanglei/data/fnl_20100724_00_00_c.grb","r")
; print(fi) ;
hgt =fi->HGT_3_ISBL({500},{15:40},{100:125})
u =fi->U_GRD_3_ISBL({500},{15:40},{100:125})
v =fi->V_GRD_3_ISBL({500},{15:40},{100:125})
printVarSummary(hgt)
printVarSummary(u)
printVarSummary(v)
wks = gsn_open_wks("pdf","hj")
res = True
res@gsnDraw = False
res@gsnFrame = False
mpres = True
mpres@gsnDraw = False
mpres@gsnFrame = False
mpres@mpGeophysicalLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpDataBaseVersion = "Ncarg4_1"
mpres@mpDataSetName = "Earth..4"
mpres@mpOutlineSpecifiers = (/"China:states"/)
mpres@mpGridLineColor = "Black"
mpres@mpLimbLineColor = "Black"
mpres@mpPerimLineColor = "Black"
mpres@mpGeophysicalLineThicknessF = 2.0
mpres@mpGridLineThicknessF = 2.0
mpres@mpLimbLineThicknessF = 2.0
mpres@mpNationalLineThicknessF = 2.0
;res@gsnSpreadColors = True ; 6.1.0
mpres@mpMinLatF = 15
mpres@mpMaxLatF = 40
mpres@mpMinLonF = 100
mpres@mpMaxLonF = 125
; The specific pressure levels that we want the data interpolated to.
spd = (u*u + v*v)^(0.5) ; m/sec
spd@description = "Wind Speed"
spd@units = "m/s"
u = u*1.94386 ; kts
v = v*1.94386 ; kts
u@units = "kts"
v@units = "kts"
copy_VarCoords(u, spd)
; Plotting options for Wind Speed
opts = res
opts@cnLineColor = "MediumSeaGreen"
;opts@ContourParameters = (/ 10. /)
;opts@cnInfoLabelOrthogonalPosF = 0.07 ; offset second label information
opts@gsnContourLineThicknessesScale = 3.0
contour_spd = gsn_csm_contour(wks,spd,opts)
delete(opts)
; Plotting options for Wind Vectors
opts = res
;opts@cnInfoLabelString = "Wind" ; overwrite Field Title
;opts@NumVectors = 47 ; wind barb density
vector = gsn_csm_vector(wks,u,v,opts)
delete(opts)
; Plotting options for Geopotential Heigh
opts_z = res
opts_z@cnLineColor = "Blue"
opts_z@gsnContourLineThicknessesScale = 3.0
;opts_z@ContourParameters = (/ 60.0 /)
contour_height = gsn_csm_contour(wks, hgt,opts_z)
delete(opts_z)
mpid = gsn_csm_map(wks,mpres)
overlay( mpid,contour_height)
overlay( mpid,contour_spd)
overlay(mpid,vector)
draw(mpid)
frame(wks)
;
end |
|