;************************************************* load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "./gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" load "$HAO_NCL_LIB/halfzp2full.ncl" load "$HAO_NCL_LIB/axis.ncl" ;************************************************ begin ;************************************************ ; before the data can be plotted, there is a ; sequence of things that have to be done to it: ;************************************************ in = addfile("/chewy/d/murphys/files/pyrj001.nc","r") x = in->UN ; read in data x = halfzp("UN",x) ; convert to full zp t2plt = 0 ; time index to plot l2plt = 5 ; level value to plot ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("ps" ,"polar") ; open a ps file gsn_define_colormap(wks,"BlWhRe"); choose colormap res = True ; plot mods desired res@gsnPolar = "NH" ; choose hemisphere res@mpMinLatF = 60 ; mpMaxLatF for NH res@cnLineLabelPlacementMode = "constant" ; best line label mode title = "Perim lat = -30"+" zplev= "+in->lev({l2plt})+" UT = "+in->ut(t2plt) res@tiMainString = title res@cnFillOn = True ; add color res@gsnSpreadColors = True ; use full range of color map res@lbLabelAutoStride = True ; nice lb labels res@cnLineLabelsOn = True ; turn on line labels res@gsnDraw = False ; don't draw yet res@gsnFrame = False ; don't advance frame yet ; these four resources set the contour min and max res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels res@cnMinLevelValF = -400. ; set min contour level res@cnMaxLevelValF = 400. ; set max contour level res@cnLevelSpacingF = 50. ; set contour spacing ; calc min/max of data minx = min(x(t2plt,{l2plt},:,:)) maxx = max(x(t2plt,{l2plt},:,:)) plot = gsn_csm_contour_map_polar(wks,x(t2plt,{l2plt},:,:), res) plot = ZeroNegDashLineContour(plot) ; add a text string that indicates the time type. The addition of a ; color and the resulting label bar makes the default label disappear ; so we have to add one manually. txres = True ; text mods desired txres@txFontHeightF = 0.015 ; increase font a bit for this label gsn_text_ndc(wks,"min = "+minx+" max = "+maxx,.5,.13,txres) draw(plot) frame(wks) end