$ ncl < Vector.T.NCEP.global.ncl
Vector.T.NCEP.global.ncl
; http://www.ncl.ucar.edu/Applications/Scripts/vector_3.ncl
;
; These files are loaded by default in NCL V6.2.0 and newer
; 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"
;
; This file still has to be loaded manually
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
system("export LANG=C")
;---Read in netCDF file
fu = addfile("/work4/data/NCEP.NCAR.Reanalysis1/Pressure.Level/uwnd.2016.nc","r")
fv = addfile("/work4/data/NCEP.NCAR.Reanalysis1/Pressure.Level/vwnd.2016.nc","r")
ft = addfile("/work4/data/NCEP.NCAR.Reanalysis1/Pressure.Level/air.2016.nc","r")
;---Read in zonal [u] and meridional [v] winds
u = fu->uwnd(1,{1000},:,:)
v = fv->vwnd(1,{1000},:,:)
t = ft->air(1,{1000},:,:)
t=t-273.15
;---Create plot
figtype="ps"
figdir="./Fig/"
figname="T+Wnd.2016.1.1_1000hPa"
wks = gsn_open_wks(figtype ,figdir + figname) ; send graphics to PNG file
res = True
res@gsnDraw = False
res@gsnFrame = False
res@mpCenterLonF = 180
res@mpMinLonF = 0
res@mpMaxLonF = 360
; res@mpOutlineOn = True ; turn the map outline on
res@gsnLeftString = "" ; add the gsn titles
res@gsnCenterString = ""
res@gsnRightString = ""
cwd=systemfunc("pwd")
res@tiMainString = cwd
mpres = res
cnres = res
; cnres@cnFillDrawOrder = "PostDraw"
cnres@cnFillOn = True
cnres@cnLinesOn = False
cnres@pmLabelBarWidthF = 0.4
cnres@pmLabelBarHeightF = 0.05
cnres@pmLabelBarOrthogonalPosF = 0.2
cnres@lbLabelFontHeightF = 0.01
cnres@cnFillOpacityF = 0.7
vcres = res ; plot mods desired
vcres@gsnFrame = False ; so we can draw time stamp
vcres@vcRefAnnoOrthogonalPosF = -0.2 ; move ref vector up
vcres@vcRefMagnitudeF = 30.0 ; define vector ref mag
vcres@vcRefLengthF = 0.045 ; define length of vec ref
vcres@vcGlyphStyle = "FillArrow"; "CurlyVector"
vcres@vcMinDistanceF = 0.017
vcres@vcFillArrowWidthF = 0.05
vcres@vcFillArrowHeadInteriorXF =0.3
vcres@vcFillArrowHeadMinFracXF = 0.2
vcres@vcFillArrowHeadMinFracYF = 0.2
;;plot;;
contour = gsn_csm_contour_map(wks,t,cnres)
vector = gsn_csm_vector(wks,u,v,vcres)
;;overlay filled contours and vectors on the map;;
overlay(contour,vector)
;;drawing "map" will draw everything: map, contours, vectors, and text;;
draw(contour)
;---Add time stamp to plot
infoTimeStamp(wks,0.01, figdir + figname) ; arguments are workstation
; size of text desired, and
frame(wks)
end