- 积分
- 144
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-24
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2016-1-2 19:42:44
|
显示全部楼层
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
;****************************************************************************
; read in data
;******************************************************************************
f1 = addfile("/cygdrive/d/fnl/fnl_20151209_00_00.grib2","r")
d1 = f1->UGRD_P0_L100_GLL0(:,:,:)
d2 = f1->VGRD_P0_L100_GLL0(:,:,:)
d3 = f1->RH_P0_L100_GLL0(:,:,:)
d4 = f1->ABSV_P0_L100_GLL0(:,:,:)
lat = f1->lat_0(:)
lon = f1->lon_0(:)
vor=uv2vr_cfd(d1(12,:,:),d2(12,:,:),lat,lon,2)
; mm = sqrt(d1^2+d2^2) 全风场
;exit
;***********************************************
; creat plot
;***********************************************
wks = gsn_open_wks("pdf" ,"STORM")
gsn_define_colormap(wks,"BlWhRe")
;================================================
res = True
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
;res@cnFillOn = True
;res@cnFillPalette ="BlWhRe"
;>--------------------------------------------<
; set for the map
;>--------------------------------------------<
res@mpMinLatF = 10.
res@mpMaxLatF = 40.
res@mpMinLonF = 80.
res@mpMaxLonF = 130.
; res@cnLevelSelectionMode ="ManualLevels"
; res@cnMinLevelValF =-5
; res@cnMaxLevelValF = 5
; res@cnLevelSpacingF =50
;>--------------------------------------------<
; set for plot (fillcontour)
;>--------------------------------------------<
res@lbLabelBarOn = True
res@cnFillOn = True
res@gsnLeftString = " "
res@gsnRightString = " "
res@pmTickMarkDisplayMode = "Always"
res@gsnAddCyclic = False
res@cnLineLabelPlacementMode = "Computed"
res@cnLineLabelDensityF = 1.0
res@cnLabelMasking = True
res@cnLineLabelBackgroundColor = "White"
;;res@cnLineLabelFormat = "@^sg"
res@lbOrientation ="vertical"
res@cnLinesOn = True
res@cnLineLabelsOn = True
res@cnLineLabelInterval = 1
res@cnLineLabelFontHeightF = 0.01
plot = gsn_csm_contour_map_ce(wks,vor,res)
;>============================================================<
vcres = True
vcres@gsnAddCyclic = False
vcres@gsnDraw = False ; don't draw yet
vcres@gsnFrame = False ; don't advance frame yet
vcres@pmTickMarkDisplayMode = "Always"
vcres@vcLabelsOn = True
;vcres@lbLabelBarOn = True
vcres@gsnFrame = False ; so we can draw time stamp
vcres@vcRefAnnoOrthogonalPosF = 0.0 ; move ref vector up
vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag
vcres@vcRefLengthF = 0.045 ; define length of vec ref
vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors
vcres@vcMinDistanceF = 0.017
vcres@vcRefAnnoOn = True ; turn on the vector arrow
vcres@vcVectorDrawOrder = "PostDraw"
res@gsnLeftString = ""
res@gsnRightString = ""
plot1=gsn_csm_vector(wks,d1(13,:,:),d2(13,:,:),vcres)
;-------------------------------------------------------------<
; add China map
;>------------------------------------------------------------<
cnres = True
cnres@china = True ;draw china map or not
cnres@river = False ;draw changjiang&huanghe or not
cnres@province = True ;draw province boundary or not
cnres@nanhai = False ;draw nanhai or not
cnres@diqu = False ;draw diqujie or not
res@gsnLeftString = ""
res@gsnRightString = ""
;chinamap = add_china_map(wks,plot1,cnres)
overlay(plot,plot1)
draw (plot)
; frame(wks)
end |
|