;*********************************************** ; plot_supercell_5km_xsec.ncl ; ; Version 1.0 ;*********************************************** 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" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin ;**************************************************************************** ; DO NOT EDIT ABOVE THIS LINE ;**************************************************************************** ; Read in data and store as follows: ; ; Output: ; w_5km(time, lon, lat) ; 2D vertical velocity field at 5km altitude (units m/s) ; ; Output: ; qr_5km(time, lon, lat) ; 2D rain water mixing ratio at 5km altitude (units g/kg) ; ; Dimensions: ; time: 4 elements at 30, 60, 90 and 120 minutes ; lon: arbitrary ; lat: arbitrary ;---------------------------------------------------------------------------- ; wks = gsn_open_wks("pdf","neptune_supercell_5km_500m_res") filename_string = "neptune_supercell_5km_4km_res" wks = gsn_open_wks("png",filename_string) data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/4deg/neptune.163.r400.L40.latlon.nonhydro.SC3.nc" ; data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/2deg/neptune.163.r200.L40.latlon.nonhydro.SC3.nc" ; data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/1deg/neptune.163.r100.L40.latlon.nonhydro.SC3.nc" ; data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/05deg/neptune.163.r50.L40.latlon.nonhydro.SC3.nc" data = addfile(data_file,"r") ;**************************************************************************** ; DO NOT EDIT BELOW THIS LINE ;**************************************************************************** ;------------------------------------------------ ; Workspace ;------------------------------------------------ gsn_merge_colormaps(wks,"temp_diff_18lev","sunshine_9lev") ;------------------------------------------------ ; Plot resources [options] ;------------------------------------------------ plot = new(2,graphic) ; wplot = new(3,graphic) ; qrplot = new(3,graphic) ; Resources: res = True res@gsnDraw = False res@gsnFrame = False res@vpKeepAspect = True res@vpWidthF = 0.4 res@vpHeightF = 0.8 ; res@gsnSpreadColors = True res@gsnMaximize = True res@gsnPaperOrientation = "portrait" res@cnFillOn = True res@cnLinesOn = True res@cnLineLabelsOn = False res@lbLabelAutoStride = True res@cnInfoLabelOn = False res@tmXBLabelsOn = True res@tmXBOn = True res@tmXTLabelsOn = False res@tmXTOn = False res@gsnSpreadColors = True res@trYMinF = -40.0 res@trYMaxF = 40.0 res@gsnContourZeroLineThicknessF = 0.0 res@gsnContourNegLineDashPattern = 1 res@lbLabelBarOn = True res@tmYLLabelsOn = True resw = res resw@gsnSpreadColorStart = 8 resw@gsnSpreadColorEnd = 19 resw@cnLevelSelectionMode = "ManualLevels" resw@cnLevelSpacingF = 2.0 resw@cnMinLevelValF = -8.0 resw@cnMaxLevelValF = 24.0 resqr = res resqr@gsnSpreadColorStart = 21 resqr@gsnSpreadColorEnd = 30 resqr@cnLevelSelectionMode = "ManualLevels" resqr@cnLevelSpacingF = 1.0 resqr@cnMinLevelValF = 1.0 resqr@cnMaxLevelValF = 12.0 ;------------------------------------------------ ; Vertical velocity plots ;------------------------------------------------ do i = 0,24 w_5km = data->W5000m(i,:,:) qr_5km = data->Qr5000m(i,:,:) qr_5km = qr_5km*1000.0 ;convert from kg/kg to g/kg curr_time = i*5 resw@gsnLeftString = "Time is " + curr_time + " mins" resw@trXMinF = -20.0 resw@trXMaxF = 20.0 plot(0) = gsn_csm_contour(wks, w_5km(:,:), resw) ; resw@trXMinF = -20.0 ; resw@trXMaxF = 20.0 ; wplot(0) = gsn_csm_contour(wks, w_5km(1,:,:), resw) ; resw@trXMinF = -15.0 ; resw@trXMaxF = 25.0 ; wplot(1) = gsn_csm_contour(wks, w_5km(2,:,:), resw) ; resw@trXMinF = -10.0 ; resw@trXMaxF = 30.0 ; wplot(2) = gsn_csm_contour(wks, w_5km(3,:,:), resw) ; mergedw = gsn_attach_plots(plot(0), (/wplot(0),wplot(1),wplot(2)/), False, False) ;------------------------------------------------ ; Rain water plots ;------------------------------------------------ resqr@trXMinF = -20.0 resqr@trXMaxF = 20.0 qr_5km@units = "g/kg" plot(1) = gsn_csm_contour(wks, qr_5km(:,:), resqr) ; resqr@trXMinF = -20.0 ; resqr@trXMaxF = 20.0 ; qrplot(0) = gsn_csm_contour(wks, qr_5km(1,:,:), resqr) ; ; resqr@trXMinF = -15.0 ; resqr@trXMaxF = 25.0 ; qrplot(1) = gsn_csm_contour(wks, qr_5km(2,:,:), resqr) ; ; resqr@trXMinF = -10.0 ; resqr@trXMaxF = 30.0 ; qrplot(2) = gsn_csm_contour(wks, qr_5km(3,:,:), resqr) ; ; mergedqr = gsn_attach_plots(plot(1), (/qrplot(0),qrplot(1),qrplot(2)/), False, False) ;------------------------------------------------ ; Panel plot ;------------------------------------------------ pres = True pres@gsnPanelBottom = 0.1 pres@gsnPanelTop = 0.9 pres@gsnPanelYWhiteSpacePercent = 5 pres@gsnPanelXWhiteSpacePercent = 5 gsn_panel(wks, plot, (/1,2/), pres) end do cmd = "convert -delay 25 "+ filename_string+"*.png "+filename_string+".gif" system(cmd) cmd = "rm "+filename_string+"*.png" system(cmd) end