;*********************************************** load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;*********************************************** begin ;*********************************************** wks = gsn_open_wks("pdf","meteo") time = stringtofloat( systemfunc("cut -c24-25 dbz.tser") ) dbz = stringtofloat( systemfunc("cut -c54-68 dbz.tser") ) tc = stringtofloat( systemfunc("cut -c54-68 tc.tser") ) slp = stringtofloat( systemfunc("cut -c54-68 slp.tser") ) dbzP = stringtofloat( systemfunc("cut -c54-68 dbz_levs.tser") ) dbz@_FillValue = -20. if( any(ismissing(dbz)) ) then indices = ind(ismissing(dbz)) dbz(indices) = 0. delete (indices) end if dbzP@_FillValue = -20. if( any(ismissing(dbzP)) ) then indices = ind(ismissing(dbzP)) dbzP(indices) = 0. delete (indices) end if dbzPs = (/ onedtond( dbzP, (/9,5/)) /) ; we know the data has 9 pressure levels and 5 time periods levels = (/"1000", "900", "800", "700", \ ; The 9 pressure levels "600", "500", "400", "300", "200" /) res = True res@vpXF = 0.15 ; x location res@vpWidthF = 0.72 ; width res@vpHeightF = 0.10 ; height res@gsnDraw = False ; Don't draw individual plot. res@gsnFrame = False ; Don't advance frame. res@tmYLMinorOn = False ; No Y-left minor tick marks. res@tmXBMode = "Explicit" ; Define own tick mark labels. res@tmXBValues = time ; location of explicit labels res@tmXBLabels = time ; labels same as location res@tmXBMinorOn = False ; No minor tick marks. res@tmXBLabelJust = "CenterCenter" ; label justification res@tmXBLabelFontHeightF = .013 ; Font size res@tiXAxisString = "" ; turn off x-axis string ;;profile of dbz dbzP_res = res dbzP_res@vpYF = 0.93 ; y location dbzP_res@vpHeightF = 0.40 ; height dbzP_res@gsnSpreadColors = True ; use full range of colors dbzP_res@gsnSpreadColorEnd = -2 ; save last color (red) dbzP_res@cnFillOn = True ; turns on color fill dbzP_res@cnLineLabelsOn = False ; no contour labels dbzP_res@cnInfoLabelOn = False dbzP_res@tiMainString = "Meteogram for grid point 55,40" ; title dbzP_res@sfXArray = time ; Define X/Y axes values that dbzP_res@sfYArray = levels ; all three data fields are on ; y-left axis changes dbzP_res@tiYAxisString = "Pressure (mb)" ; Y axes label. dbzP_res@trYReverse = True ; Reverse the Y values. dbzP_res@tmYLMode = "Explicit" ; Define own tick mark labels. dbzP_res@tmYLValues = levels ; location of explicit labels dbzP_res@tmYLLabels = levels txres = True txres@txFont = "helvetica-bold" txres@txFontColor = "Black" txres@txFontHeightF = 0.02 txres@txPerimOn = True txres@txPerimColor = "Black" txres@txJust = "TopRight" txres@txBackgroundFillColor = "White" ;;lowest level dbz dbz_res = res dbz_res@vpYF = 0.49 ; The top side of the plot box location dbz_res@tiYAxisString = "dbz " ; Y axis label. dbz_res@gsnYRefLine = 0.0 ; create a reference line dbz_res@gsnAboveYRefLineColor = "green" ; above ref line fill green dbz_res@gsnBelowYRefLineColor = "blue" ; above ref line fill green dbz_res@gsnXYBarChart = True ; turn on bar chart ;;slp slp_res = res slp_res@vpYF = 0.33 ; The top side of the plot box loc slp_res@tiYAxisString = "slp" ; set y-axis string slp_res@xyLineThicknesses = 2 ; increase line thickness slp_res@xyLineColor = "red" ; set line color ;;temp in C - at level 34 tc_res = res tc_res@vpYF = 0.15 ; The top side of the plot box loc tc_res@tiYAxisString = "Temp" ; set y-axis string tc_res@xyLineThicknesses = 2 ; increase line thickness tc_res@xyLineColor = "blue" ; set line color pdbz = gsn_contour(wks,dbzPs,dbzP_res) met_dbz = gsn_csm_xy(wks,time,dbz,dbz_res) met_slp = gsn_csm_xy(wks,time,slp,slp_res) met_tc = gsn_csm_xy(wks,time,tc,tc_res) draw(pdbz) draw(met_dbz) draw(met_slp) draw(met_tc) gsn_text_ndc(wks,"dbz",0.205,0.92,txres) frame(wks) end