;******************************************* ;******************************************* ; load ncl and user contributed shareraries load "$NCARG_ROOT/share/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/share/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/share/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/share/ncarg/nclscripts/csm/shea_util.ncl" ;******************************************* begin ;******************************************* in = addfile("xadala_pi00002011050215_utc.nc", "r") tlat = in->latitude ; 2D true latitude tlon = in->longitude ; 2D true longitude ;******************************************* mslp =in->w_model_levs(11,6,:,:) mslp@lat2d = tlat mslp@lon2d = tlon u10m = in->zonal_wind(11,3,:,:)+1 v10m = in->merid_wind(11,3,:,:)+8. vor = mslp do i=100, 500 do j=100, 500 xx=(v10m(i,j+1)-v10m(i,j-1))/200. yy=(u10m(i+1,j)-u10m(i-1,j))/200. vor(i,j)=xx-yy end do end do mslp = vor*100. ;************************************************ ; plotting parameters ;************************************************ res1 = True ; plot resource (clouds) res1@gsnSpreadColors = True ; spread out color table res1@gsnDraw = False ; don't draw straight away res1@gsnFrame = False ; don't advance frame res1@cnLineLabelsOn = False ; no contour line labels res1@mpPerimDrawOrder = "PostDraw" ; draw perimeter after plot res1@mpPerimLineColor = "black" ; black perimeter res1@mpPerimLineThicknessF = 3.0 ; perimeter thickness res1@mpDataBaseVersion = "HighRes" ; high resolution map res1@mpFillOn = True ; Turn on Filling - so we can colour land and sea areas res1@mpMonoFillColor = False res1@mpFillColors =(/1, 41, 2, 41/) ; Assumes eco_colourmap_1, Black (1), DarkGreen (2), DarkBlue (41) res1@mpGeophysicalLineColor = "black" ; map outline colour res1@mpGeophysicalLineThicknessF = 1.5 res1@mpGridLineColor = "DarkSlateGrey" ; grid line colour res1@mpLabelFontColor = "DarkSlateGray" res1@lbOrientation = "vertical" ; colour bar orientation res1@lbBoxLinesOn = False ; no boxes in colour bar ; We want to add a label title res1@lbTitleOn = True ; we want a label title drawn res1@lbTitlePosition = "Right" ; put it on the right hand side res1@lbTitleDirection = "Across" ; set it "Across", then rotate by 90 deg res1@lbTitleAngleF = -90.0 ; this is where we rotate it to read top to bottom res1@lbLabelFontHeightF = 0.012 ; label font height res1@lbTitleFontHeightF = 0.015 ; height of title font res1@pmLabelBarWidthF = 0.075 ; specifies the width of the label bar res1@cnFillOn = True res1@cnLinesOn = False res1@cnSmoothingOn = False res1@cnSmoothingDistanceF = 0.03 res1@gsnSpreadColorStart = 2 ; start colour res1@gsnSpreadColorEnd = 253 ; end colour res1@cnFillMode = "AreaFill" res1@lbLabelStride = 2 ; colour bar label stride res1@mpFillDrawOrder = "PreDraw" res1@lbTitleString = "Vorticity (10**-2/s)" res1@mpGridAndLimbOn = False res1@cnLineColor = "white" ; white, dark green (eco_colourmap_1) res1@cnLevelSelectionMode = "ManualLevels"; Define own levels. res1@cnMinLevelValF = -1 ; contour minimum value res1@cnMaxLevelValF = 1. ; contour maximum value res1@cnLevelSpacingF = 0.1 ; contour spacing res1@cnInfoLabelOn = False res1@gsnLeftString = "Plot_1 " res1@gsnRightString = "" res1@cnInfoLabelOn = False res1@gsnContourZeroLineThicknessF = 0. res1@gsnContourLineThicknessesScale=1. res1@gsnContourNegLineDashPattern = 11 vecres = True ; plot resource for wind barbs vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame ; Following 3 resources repalced by latter 3 (see "NB" above) vecres@vcLineArrowThicknessF = 1.1 ; increase the "thickness" of the arrows vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@vcRefAnnoPerimOn = False ; no perimeter for reference vecres@vcUseRefAnnoRes = True ; copy resources vecres@vcRefAnnoOrthogonalPosF= -1.0 ; move ref vector into plot vecres@vcRefAnnoString2On = False ; no 'reference vector' string vecres@vcRefAnnoArrowUseVecColor = False ; vac and ref cam be different colours vecres@vcLineArrowColor = "black" ; black vectors vecres@vcRefAnnoArrowLineColor = "black" ; black ref vector vecres@vcGlyphStyle = "CurlyVector" vecres@vcMonoWindBarbColor = True vecres@vcRefAnnoOn = True ; turns off the ref vector vecres@vcRefMagnitudeF = 5.0 vecres@vcLineArrowThicknessF = 2.5 vecres@vcMonoWindBarbColor = False ; Use colours (not foreground or background) vecres@vcWindBarbTickAngleF = -62.0 ; For SH convention ; vecres@lbLabelBarOn = False ; to turn off the label (for scalar colouring) ;************************************************ ; e-nzlam12-lc area ;************************************************ wks = gsn_open_wks ("eps","plot_1") ; open workstation gsn_define_colormap(wks,"BlueRed") ; grey scale for clouds ; res1@vpHeightF = 0.705 ; view port width res1@mpProjection = "LambertConformal" res1@mpLimitMode = "Corners" ; choose range of map res1@mpLambertParallel1F = -43.012 ; map parameter res1@mpLambertParallel2F = -38.024 ; map parameter res1@mpLambertMeridianF = 172.911 ; map parameter res1@mpLeftCornerLatF = -36.85 res1@mpLeftCornerLonF = 174.54 res1@mpRightCornerLatF = -36.6 res1@mpRightCornerLonF = 174.85 plot = gsn_csm_contour_map(wks,mslp,res1) ; generate the base map & overlay u = u10m ; we need buffer variables v = v10m inc = 10 ; plot at every "inc" grid point u@lat2d = tlat(::inc,::inc) u@lon2d = tlon(::inc,::inc) v@lat2d = tlat(::inc,::inc) v@lon2d = tlon(::inc,::inc) plotvec = gsn_csm_vector(wks, u(::inc,::inc), v(::inc,::inc),vecres) overlay (plot, plotvec) ; overlay vector plot ontop of orog, pmsl & cloud plot draw(plot) ; finally draw plot and advance frame frame(wks) delete(plot) ; free resources delete(wks) ;************************************************ ; e-nz1-lc area ;************************************************ end