load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin f = addfile ("wrfout_d01_2003-07-15_00:00:00.nc", "r") p = f->P(0,:,:,:) ; Read pressure, preserve metadata p = p*0.01 ; Convert to hPA p@units = "hPa" ; Update units attribute wks = gsn_open_wks("ps" ,"panel1i") ; Open PS file "panel1i.ps" gsn_define_colormap(wks,"BlAqGrYeOrReVi200") res = True ; Plot options desired res@gsnDraw = False ; Don't draw plots res@gsnFrame = False ; Don't advance frames res@cnFillOn = True ; Turn on color res@cnLineLabelsOn = False ; Turn off line labels res@cnInfoLabelOn = False ; Turn off info label res@lbLabelBarOn = False ; Turn off individual labelbars res@cnLevelSelectionMode = "ManualLevels" ; Set contour levels res@cnMinLevelValF = -10 ; the same for each plot. res@cnMaxLevelValF = 20 res@cnLevelSpacingF = 2 res@gsnLeftString = "" ; Turn off left subtitle res@gsnRightString = "" ; Turn off right subtitle ;---Loop across six levels and create a contour plot for each one. plots = new(6,graphic) do i=0,5 res@gsnCenterString = "bottom_top index " + i plots(i) = gsn_csm_contour(wks,p(i,:,:),res) end do ;---Create a panel of plots with 2 rows and 3 columns. pres = True ; Set panel resources. pres@gsnPanelRowSpec = True ; Specify plots per row pres@gsnMaximize = True ; Maximize plots in panel. pres@gsnPanelLabelBar = True ; Turn on panel labelbar. pres@pmLabelBarWidthF = 0.8 ; Change labelbar width. pres@txString = "Perturbation pressure (hPa)" gsn_panel(wks,plots,(/2,1,3/),pres) end