[439] | 1 | ;*********************************************** |
---|
| 2 | ; plot_supercell_5km_xsec.ncl |
---|
| 3 | ; |
---|
| 4 | ; Version 1.0 |
---|
| 5 | ;*********************************************** |
---|
| 6 | |
---|
| 7 | load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" |
---|
| 8 | load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" |
---|
| 9 | load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" |
---|
| 10 | load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" |
---|
| 11 | |
---|
| 12 | begin |
---|
| 13 | |
---|
| 14 | ;**************************************************************************** |
---|
| 15 | ; DO NOT EDIT ABOVE THIS LINE |
---|
| 16 | ;**************************************************************************** |
---|
| 17 | ; Read in data and store as follows: |
---|
| 18 | ; |
---|
| 19 | ; Output: |
---|
| 20 | ; w_5km(time, lon, lat) |
---|
| 21 | ; 2D vertical velocity field at 5km altitude (units m/s) |
---|
| 22 | ; |
---|
| 23 | ; Output: |
---|
| 24 | ; qr_5km(time, lon, lat) |
---|
| 25 | ; 2D rain water mixing ratio at 5km altitude (units g/kg) |
---|
| 26 | ; |
---|
| 27 | ; Dimensions: |
---|
| 28 | ; time: 4 elements at 30, 60, 90 and 120 minutes |
---|
| 29 | ; lon: arbitrary |
---|
| 30 | ; lat: arbitrary |
---|
| 31 | ;---------------------------------------------------------------------------- |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | ; wks = gsn_open_wks("pdf","neptune_supercell_5km_500m_res") |
---|
| 35 | filename_string = "neptune_supercell_5km_4km_res" |
---|
| 36 | wks = gsn_open_wks("png",filename_string) |
---|
| 37 | |
---|
| 38 | data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/4deg/neptune.163.r400.L40.latlon.nonhydro.SC3.nc" |
---|
| 39 | ; data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/2deg/neptune.163.r200.L40.latlon.nonhydro.SC3.nc" |
---|
| 40 | ; data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/1deg/neptune.163.r100.L40.latlon.nonhydro.SC3.nc" |
---|
| 41 | ; data_file = "/glade/scratch/menchaca/run_NEPTUNE/runFILES/SC3/05deg/neptune.163.r50.L40.latlon.nonhydro.SC3.nc" |
---|
| 42 | |
---|
| 43 | data = addfile(data_file,"r") |
---|
| 44 | |
---|
| 45 | ;**************************************************************************** |
---|
| 46 | ; DO NOT EDIT BELOW THIS LINE |
---|
| 47 | ;**************************************************************************** |
---|
| 48 | |
---|
| 49 | ;------------------------------------------------ |
---|
| 50 | ; Workspace |
---|
| 51 | ;------------------------------------------------ |
---|
| 52 | |
---|
| 53 | gsn_merge_colormaps(wks,"temp_diff_18lev","sunshine_9lev") |
---|
| 54 | |
---|
| 55 | ;------------------------------------------------ |
---|
| 56 | ; Plot resources [options] |
---|
| 57 | ;------------------------------------------------ |
---|
| 58 | plot = new(2,graphic) |
---|
| 59 | ; wplot = new(3,graphic) |
---|
| 60 | ; qrplot = new(3,graphic) |
---|
| 61 | |
---|
| 62 | ; Resources: |
---|
| 63 | res = True |
---|
| 64 | |
---|
| 65 | res@gsnDraw = False |
---|
| 66 | res@gsnFrame = False |
---|
| 67 | |
---|
| 68 | res@vpKeepAspect = True |
---|
| 69 | res@vpWidthF = 0.4 |
---|
| 70 | res@vpHeightF = 0.8 |
---|
| 71 | ; res@gsnSpreadColors = True |
---|
| 72 | res@gsnMaximize = True |
---|
| 73 | res@gsnPaperOrientation = "portrait" |
---|
| 74 | |
---|
| 75 | res@cnFillOn = True |
---|
| 76 | res@cnLinesOn = True |
---|
| 77 | res@cnLineLabelsOn = False |
---|
| 78 | res@lbLabelAutoStride = True |
---|
| 79 | res@cnInfoLabelOn = False |
---|
| 80 | res@tmXBLabelsOn = True |
---|
| 81 | res@tmXBOn = True |
---|
| 82 | |
---|
| 83 | res@tmXTLabelsOn = False |
---|
| 84 | res@tmXTOn = False |
---|
| 85 | |
---|
| 86 | res@gsnSpreadColors = True |
---|
| 87 | |
---|
| 88 | res@trYMinF = -40.0 |
---|
| 89 | res@trYMaxF = 40.0 |
---|
| 90 | |
---|
| 91 | res@gsnContourZeroLineThicknessF = 0.0 |
---|
| 92 | res@gsnContourNegLineDashPattern = 1 |
---|
| 93 | |
---|
| 94 | res@lbLabelBarOn = True |
---|
| 95 | res@tmYLLabelsOn = True |
---|
| 96 | |
---|
| 97 | resw = res |
---|
| 98 | resw@gsnSpreadColorStart = 8 |
---|
| 99 | resw@gsnSpreadColorEnd = 19 |
---|
| 100 | resw@cnLevelSelectionMode = "ManualLevels" |
---|
| 101 | resw@cnLevelSpacingF = 2.0 |
---|
| 102 | resw@cnMinLevelValF = -8.0 |
---|
| 103 | resw@cnMaxLevelValF = 24.0 |
---|
| 104 | |
---|
| 105 | resqr = res |
---|
| 106 | resqr@gsnSpreadColorStart = 21 |
---|
| 107 | resqr@gsnSpreadColorEnd = 30 |
---|
| 108 | resqr@cnLevelSelectionMode = "ManualLevels" |
---|
| 109 | resqr@cnLevelSpacingF = 1.0 |
---|
| 110 | resqr@cnMinLevelValF = 1.0 |
---|
| 111 | resqr@cnMaxLevelValF = 12.0 |
---|
| 112 | |
---|
| 113 | ;------------------------------------------------ |
---|
| 114 | ; Vertical velocity plots |
---|
| 115 | ;------------------------------------------------ |
---|
| 116 | do i = 0,24 |
---|
| 117 | |
---|
| 118 | w_5km = data->W5000m(i,:,:) |
---|
| 119 | qr_5km = data->Qr5000m(i,:,:) |
---|
| 120 | |
---|
| 121 | qr_5km = qr_5km*1000.0 ;convert from kg/kg to g/kg |
---|
| 122 | |
---|
| 123 | curr_time = i*5 |
---|
| 124 | resw@gsnLeftString = "Time is " + curr_time + " mins" |
---|
| 125 | |
---|
| 126 | resw@trXMinF = -20.0 |
---|
| 127 | resw@trXMaxF = 20.0 |
---|
| 128 | plot(0) = gsn_csm_contour(wks, w_5km(:,:), resw) |
---|
| 129 | |
---|
| 130 | ; resw@trXMinF = -20.0 |
---|
| 131 | ; resw@trXMaxF = 20.0 |
---|
| 132 | ; wplot(0) = gsn_csm_contour(wks, w_5km(1,:,:), resw) |
---|
| 133 | |
---|
| 134 | ; resw@trXMinF = -15.0 |
---|
| 135 | ; resw@trXMaxF = 25.0 |
---|
| 136 | ; wplot(1) = gsn_csm_contour(wks, w_5km(2,:,:), resw) |
---|
| 137 | |
---|
| 138 | ; resw@trXMinF = -10.0 |
---|
| 139 | ; resw@trXMaxF = 30.0 |
---|
| 140 | ; wplot(2) = gsn_csm_contour(wks, w_5km(3,:,:), resw) |
---|
| 141 | |
---|
| 142 | ; mergedw = gsn_attach_plots(plot(0), (/wplot(0),wplot(1),wplot(2)/), False, False) |
---|
| 143 | |
---|
| 144 | ;------------------------------------------------ |
---|
| 145 | ; Rain water plots |
---|
| 146 | ;------------------------------------------------ |
---|
| 147 | |
---|
| 148 | resqr@trXMinF = -20.0 |
---|
| 149 | resqr@trXMaxF = 20.0 |
---|
| 150 | qr_5km@units = "g/kg" |
---|
| 151 | plot(1) = gsn_csm_contour(wks, qr_5km(:,:), resqr) |
---|
| 152 | |
---|
| 153 | ; resqr@trXMinF = -20.0 |
---|
| 154 | ; resqr@trXMaxF = 20.0 |
---|
| 155 | ; qrplot(0) = gsn_csm_contour(wks, qr_5km(1,:,:), resqr) |
---|
| 156 | ; |
---|
| 157 | ; resqr@trXMinF = -15.0 |
---|
| 158 | ; resqr@trXMaxF = 25.0 |
---|
| 159 | ; qrplot(1) = gsn_csm_contour(wks, qr_5km(2,:,:), resqr) |
---|
| 160 | ; |
---|
| 161 | ; resqr@trXMinF = -10.0 |
---|
| 162 | ; resqr@trXMaxF = 30.0 |
---|
| 163 | ; qrplot(2) = gsn_csm_contour(wks, qr_5km(3,:,:), resqr) |
---|
| 164 | ; |
---|
| 165 | ; mergedqr = gsn_attach_plots(plot(1), (/qrplot(0),qrplot(1),qrplot(2)/), False, False) |
---|
| 166 | |
---|
| 167 | ;------------------------------------------------ |
---|
| 168 | ; Panel plot |
---|
| 169 | ;------------------------------------------------ |
---|
| 170 | |
---|
| 171 | pres = True |
---|
| 172 | pres@gsnPanelBottom = 0.1 |
---|
| 173 | pres@gsnPanelTop = 0.9 |
---|
| 174 | pres@gsnPanelYWhiteSpacePercent = 5 |
---|
| 175 | pres@gsnPanelXWhiteSpacePercent = 5 |
---|
| 176 | gsn_panel(wks, plot, (/1,2/), pres) |
---|
| 177 | |
---|
| 178 | end do |
---|
| 179 | |
---|
| 180 | cmd = "convert -delay 25 "+ filename_string+"*.png "+filename_string+".gif" |
---|
| 181 | system(cmd) |
---|
| 182 | cmd = "rm "+filename_string+"*.png" |
---|
| 183 | system(cmd) |
---|
| 184 | |
---|
| 185 | end |
---|
| 186 | |
---|