@@ -16,6 +16,9 @@ def plot_results(file_bl, file_rt=None, vars2plt=None):
1616 vars2plot_ALL = \
1717 ["pres" , "pres_i" ,"sigma" ,"sigma_i" ,"pres_s" ,"qv" ,"T" ,"u" ,"v" ,"ql" , \
1818 "qi" ,"qc" ,"qv_force_tend" ,"T_force_tend" ,"u_force_tend" , \
19+ "rad_cloud_fraction" ,"rad_cloud_lwp" ,"rad_cloud_iwp" ,"rad_cloud_rwp" , \
20+ "rad_cloud_swp" ,"rad_eff_rad_ql" ,"rad_eff_rad_qi" ,"rad_eff_rad_qr" , \
21+ "rad_eff_rad_qs" , \
1922 "v_force_tend" ,"w_ls" ,"u_g" ,"v_g" ,"dT_dt_rad_forc" ,"h_advec_thil" , \
2023 "h_advec_qt" , "v_advec_thil" ,"v_advec_qt" ,"T_s" ,"lhf" ,"shf" , \
2124 "tprcp_inst" ,"tprcp_rate_inst" ,"t2m" ,"q2m" ,"ustar" ,"tsfc" ,"tau_u" , \
@@ -108,25 +111,28 @@ def plot_results(file_bl, file_rt=None, vars2plt=None):
108111
109112 # Make figure
110113 if (np .size (x1 ) > 1 ):
111- #fig = plt.figure(figsize=(13 ,10))
114+ #fig = plt.figure(figsize=(8 ,10))
112115 fig = plt .figure (figsize = (5 ,10 ))
113116
114117 # Baselines and RTs on same plot
115118 if plot_diff : plt .subplot (2 ,1 ,1 )
116119 plt .title (SCM_BL [var ].description )
117- plt .plot (x1 , y1 , color = 'orange ' )
118- if plot_diff : plt .plot (x2 , y2 , color = 'red ' )
120+ plt .plot (x1 , y1 , color = 'red ' )
121+ if plot_diff : plt .plot (x2 , y2 , color = 'black ' )
119122 plt .ylabel ('(' + SCM_BL [var ].units + ')' )
120123 plt .xlabel ('(hours)' )
121-
124+ #plt.xlim(0,240)
125+ plt .xlim (0 ,np .max (x1 ))
122126 # Difference (Baseline-MRT)
123127 if plot_diff :
124128 plt .subplot (2 ,1 ,2 )
125- plt .title ("Difference (Orange - red )" )
129+ plt .title ("Difference (red - black )" )
126130 plt .plot (x1 , y1 - y2 , color = 'black' )
127131 plt .plot (x1 , np .zeros (len (y1 )), color = 'grey' ,linestyle = 'dashed' )
128132 plt .ylabel ('(' + SCM_BL [var ].units + ')' )
129133 plt .xlabel ('(hours)' )
134+ #plt.xlim(0,240)
135+ plt .xlim (0 ,np .max (x1 ))
130136 # Save figure
131137 fileOUT = 'scm.' + var + '.png'
132138 plt .savefig (fileOUT )
@@ -155,7 +161,7 @@ def plot_results(file_bl, file_rt=None, vars2plt=None):
155161
156162 # Finally, make figure.
157163 if (np .size (x1 ) > 1 ):
158- #fig = plt.figure(figsize=(13 ,10))
164+ #fig = plt.figure(figsize=(8 ,10))
159165
160166 z_min = min (np .min (z1 ), np .min (z2 ))
161167 z_max = max (np .max (z1 ), np .max (z2 ))
@@ -165,10 +171,11 @@ def plot_results(file_bl, file_rt=None, vars2plt=None):
165171 #mz Compute limits for color bar
166172 vmin1 , vmax1 = np .min (z1 ), np .max (z1 )
167173 if file_rt is not None : plt .subplot (3 ,1 ,1 )
168- plt .contourf (x1 , y1 , z1 , 20 , cmap = 'gist_ncar' , vmin = vmin1 , vmax = vmax1 )
169- #plt.contourf(x1, y1, z1, levels=np.linspace(z_min, z_max, 20), cmap='gist_ncar', vmin=z_min, vmax=z_max )
174+ plt .contourf (x1 , y1 , z1 , 30 , cmap = 'gist_ncar' , vmin = z_min , vmax = z_max )
175+ #plt.contourf(x1, y1, z1, levels=np.linspace(z_min, z_max, 20), cmap='gist_ncar')
170176 plt .ylim (1000 ,100 )
171177 plt .xlim (0 ,np .max (x1 ))
178+ #plt.xlim(0,240)
172179 plt .ylabel ('(Pa)' )
173180 plt .xlabel ('(hours)' )
174181 cbr = plt .colorbar ()
@@ -177,21 +184,26 @@ def plot_results(file_bl, file_rt=None, vars2plt=None):
177184 # Set custom y-ticks for the first subplot
178185 #y_ticks = [1000, 900, 850, 700, 500, 250, 100, 50, 0.1]
179186 y_ticks = [1000 , 925 , 850 , 700 , 500 , 250 , 100 ]
187+ #y_ticks = [1000, 950, 900, 850, 800, 750, 700]
188+ x_ticks = [0 ,24 ,48 ,72 ,96 ,120 ,144 ,168 ,192 ,216 ,240 ,264 ,288 ,312 ,336 ]
180189 plt .yticks (y_ticks , fontsize = 10 )
190+ #plt.xticks(x_ticks, fontsize=10)
181191 # Add only y-axis grid lines
182192 plt .grid (axis = 'y' , linestyle = '--' , linewidth = 0.5 , color = 'gray' )
183193 if file_rt is not None :
184194 # SCM RTs
185195 plt .subplot (3 ,1 ,2 )
186- plt .contourf (x2 , y2 , z2 , 20 , vmin = vmin1 , vmax = vmax1 , cmap = 'gist_ncar' )
187- #plt.contourf(x2, y2, z2, levels=np.linspace(z_min, z_max, 20), cmap='gist_ncar', vmin=z_min, vmax=z_max )
196+ plt .contourf (x2 , y2 , z2 , 30 , vmin = z_min , vmax = z_max , cmap = 'gist_ncar' )
197+ #plt.contourf(x2, y2, z2, levels=np.linspace(z_min, z_max, 20), cmap='gist_ncar')
188198 plt .ylim (1000 ,100 )
189199 plt .xlim (0 ,np .max (x1 ))
200+ #plt.xlim(0,240)
190201 plt .ylabel ('(Pa)' )
191202 plt .xlabel ('(hours)' )
192203 cbr = plt .colorbar ()
193204 cbr .set_label ('(' + SCM_RT [var ].units + ')' )
194205 plt .yticks (y_ticks , fontsize = 10 )
206+ #plt.xticks(x_ticks, fontsize=10)
195207 # Add only y-axis grid lines
196208 plt .grid (axis = 'y' , linestyle = '--' , linewidth = 0.5 , color = 'gray' )
197209 # end if
@@ -201,17 +213,20 @@ def plot_results(file_bl, file_rt=None, vars2plt=None):
201213 if (np .count_nonzero (dz ) > 0 ):
202214 plt .subplot (3 ,1 ,3 )
203215 #mz Set symmetric color limits for the difference
204- vmin = - np .max (np .abs (dz ))
205- vmax = np .max (np .abs (dz ))
206- c3 = plt .contourf (x2 , y2 , dz , 20 , cmap = 'bwr' , vmin = vmin , vmax = - vmin )
216+ vmin2 = - np .max (np .abs (dz ))
217+ vmax2 = np .max (np .abs (dz ))
218+ c3 = plt .contourf (x2 , y2 , dz , 20 , cmap = 'bwr' , vmin = vmin2 , vmax = vmax2 )
207219 # plt.title("Difference (top - middle)", fontsize=8)
208220 # plt.contourf(x2, y2, dz, 20, cmap='bwr')
221+ #plt.xlim(0,240)
222+ plt .xlim (0 ,np .max (x1 ))
209223 plt .ylim (1000 ,100 )
210224 plt .ylabel ('(Pa)' )
211225 plt .xlabel ('(hours)' )
212226 cbr = plt .colorbar (c3 )
213227 cbr .set_label ('(' + SCM_RT [var ].units + ')' )
214228 plt .yticks (y_ticks , fontsize = 10 )
229+ #plt.xticks(x_ticks, fontsize=10)
215230 # Add only y-axis grid lines
216231 plt .grid (axis = 'y' , linestyle = '--' , linewidth = 0.5 , color = 'gray' )
217232 # end if (no differences exist)
0 commit comments