;*********************************************** 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" ;*********************************************** begin xmin = -1. xmax = 24. ymin = 0. ; min height to be plotted ymax = 1000. ; max height to be plotted nhour = 24 nlvl = 25 ncol = 10 ; number of columns of data ; (Each ascii file has the same number of columns) wks = gsn_open_wks("ps","profiler") ; gsn_define_colormap(wks,"WhBlGrYeRe") gsn_define_colormap(wks,"BlAqGrYeOrReVi200") hour = new(24,"float") temp2D = new((/nhour,nlvl/),"float") do i=0,23 hour(i) = i end do ; print(hour) do iday=335,355 fils = systemfunc("ls CCO_temp_2011_Dec/cco11335.*t") nfiles = dimsizes(fils) do gg = 0,nfiles-1 t = asciiread(fils(gg) ,(/-1/), "float") nlvl = dimsizes(t)/ncol ; figure out number of levels in the ascii file ; print(nlvl) delete(t) TestData = asciiread(fils(gg) ,(/nlvl,ncol/), "float") height = TestData (:,0)*1000. temp1D = TestData (:,1) ; create 1D array temp2D(gg,:) = temp1D delete(TestData) end do print(temp2D) res = True res@gsnDraw = False res@gsnFrame = False res@vpWidthF = 0.8 res@vpHeightF = 0.5 res@vpXF = 0.1 res@vpYF = 0.9 res@trXMinF = xmin res@trXMaxF = xmax res@trYMinF = ymin res@trYMaxF = ymax res@sfXArray = hour res@sfYArray = height res@tiMainString = "" res@cnMonoLineColor = False ; Turn off the drawing of ; contours lines in one color. xc = (/xmin,xmax,xmax,xmin,xmin/) yc = (/ymin,ymin,ymax,ymax,ymin/) plot = gsn_csm_xy(wks,xc,yc,res) ; draw blank xy plot by ; outlining min/max of X/Y axes contours = ispan(10,30,2)*1. ; set contours colors = (/20,30,40,45,50,55,60,65,70,75,80,85,90,95/) ; set colors plot = gsn_contour(wks,temp2D,res) ;-------------------------------------------------------------------------- ; Draw Labelbar ;-------------------------------------------------------------------------- lbres = True lbres@lbPerimOn = False ; no label bar box lbres@lbOrientation = "Horizontal" ; orientation lbres@vpWidthF = 0.5 ; size lbres@vpHeightF = 0.075 lbres@lbLabelFontHeightF = 0.015 ; label font height lbres@lbLabelAlignment = "InteriorEdges" ; where to label lbres@lbMonoFillPattern = True ; fill sold lbres@lbFillColors = colors lbres@lbTitleOn = True ; turn on labelbar title lbres@lbTitleString = "T(C)" ; labelbar title string lbres@lbTitleFontHeightF = .02 ; make labelbar title smaller lbres@lbTitleDirection = "Across" ; labelbar title direction gsn_labelbar_ndc (wks,dimsizes(contours)+1,sprintf("%3.0f",contours),0.25,0.32,lbres) draw(plot) ; draw the plot frame(wks) ; advance the frame delete(fils) end do end