Include ice if present.
128 type(model_state_type),
target,
intent(inout) :: current_state
131 integer :: current_y_index, current_x_index, target_x_index, target_y_index
133 current_y_index=current_state%column_local_y
134 current_x_index=current_state%column_local_x
135 target_y_index=current_y_index-current_state%local_grid%halo_size(
y_index)
136 target_x_index=current_x_index-current_state%local_grid%halo_size(
x_index)
138 if (current_state%first_timestep_column)
then
146 if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0)
then
160 if (current_state%rain_water_mixing_ratio_index > 0) rwp(:,:)=0.0
162 if (current_state%ice_water_mixing_ratio_index > 0)
then
168 if (current_state%snow_water_mixing_ratio_index > 0) swp(:,:)=0.0
170 if (current_state%graupel_water_mixing_ratio_index > 0) gwp(:,:)=0.0
179 if (.not. current_state%halo_column)
then
181 wmax(target_y_index, target_x_index)=maxval(current_state%w%data(:, current_y_index, current_x_index))
182 wmin(target_y_index, target_x_index)=minval(current_state%w%data(:, current_y_index, current_x_index))
186 (current_state%w%data(:,current_state%column_local_y,current_state%column_local_x)**2.)
187 if (
allocated(current_state%global_grid%configuration%vertical%olubar))
then
189 ((current_state%u%data(:,current_state%column_local_y,current_state%column_local_x) &
190 - (current_state%global_grid%configuration%vertical%olubar(:) - current_state%ugal))**2.)
192 uu_prime_res(:) = 0.0
194 if (
allocated(current_state%global_grid%configuration%vertical%olvbar))
then
196 ((current_state%v%data(:,current_state%column_local_y,current_state%column_local_x) &
197 - (current_state%global_grid%configuration%vertical%olvbar(:) - current_state%vgal))**2.)
199 vv_prime_res(:) = 0.0
202 do k=2, current_state%local_grid%size(
z_index)-1
203 reske(target_y_index, target_x_index) = reske(target_y_index, target_x_index) + &
204 (uu_prime_res(k) + uu_prime_res(k+1) &
205 + vv_prime_res(k) + vv_prime_res(k+1) &
206 + 2_default_precision * ww_prime_res(k))*0.25_default_precision* &
207 current_state%global_grid%configuration%vertical%dzn(k+1)* &
208 current_state%global_grid%configuration%vertical%rho(k)
211 reske(target_y_index, target_x_index) = reske(target_y_index, target_x_index)/ &
212 current_state%global_grid%configuration%vertical%z(current_state%local_grid%size(
z_index))
215 if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0)
then
219 if (current_state%liquid_water_mixing_ratio_index .gt. 0 .and. &
220 current_state%number_q_fields .ge. current_state%liquid_water_mixing_ratio_index)
then
221 qlmax(target_y_index, target_x_index) = &
222 maxval(current_state%q(current_state%liquid_water_mixing_ratio_index)%data &
223 (:,current_y_index, current_x_index))
232 cloud_content(:) = current_state%q(current_state%liquid_water_mixing_ratio_index)%data( &
233 :,current_y_index, current_x_index)
235 if (current_state%ice_water_mixing_ratio_index .gt. 0) &
236 cloud_content(:) = cloud_content(:) + current_state%q(current_state%ice_water_mixing_ratio_index)%data( &
237 :,current_y_index, current_x_index)
238 do k = 2, current_state%local_grid%size(
z_index)
239 if (cloud_content(k) .gt. qlcrit)
then
240 cltop(target_y_index, target_x_index) = &
241 current_state%global_grid%configuration%vertical%zn(k)
243 if (cloud_content(current_state%local_grid%size(
z_index)+1-k) .gt. qlcrit)
then
244 clbas(target_y_index, target_x_index) = &
245 current_state%global_grid%configuration%vertical%zn(current_state%local_grid%size(
z_index)+1-k)
252 if (current_state%water_vapour_mixing_ratio_index .gt. 0 .and. &
253 current_state%number_q_fields .ge. current_state%water_vapour_mixing_ratio_index)
then
254 do k = 2, current_state%local_grid%size(
z_index)
255 vwp(target_y_index, target_x_index)=vwp(target_y_index, target_x_index) &
256 +dz_rhon_fac(k)*current_state%q(current_state%water_vapour_mixing_ratio_index)%data(k, &
257 current_y_index, current_x_index)
258 lwp(target_y_index, target_x_index)=lwp(target_y_index, target_x_index) &
259 +dz_rhon_fac(k)*current_state%q(current_state%liquid_water_mixing_ratio_index)%data(k, &
260 current_y_index, current_x_index)
262 if (current_state%rain_water_mixing_ratio_index > 0)
then
263 do k = 2, current_state%local_grid%size(
z_index)
264 rwp(target_y_index, target_x_index)=rwp(target_y_index, target_x_index) &
265 +dz_rhon_fac(k)*current_state%q(iqr)%data(k,current_y_index, current_x_index)
268 if (current_state%ice_water_mixing_ratio_index > 0)
then
269 do k = 2, current_state%local_grid%size(
z_index)
270 iwp(target_y_index, target_x_index)=iwp(target_y_index, target_x_index) &
271 +dz_rhon_fac(k)*current_state%q(iqi)%data(k,current_y_index, current_x_index)
273 tot_iwp(target_y_index, target_x_index)=tot_iwp(target_y_index, target_x_index)+ &
274 iwp(target_y_index, target_x_index)
276 if (current_state%snow_water_mixing_ratio_index > 0)
then
277 do k = 2, current_state%local_grid%size(
z_index)
278 swp(target_y_index, target_x_index)=swp(target_y_index, target_x_index) &
279 +dz_rhon_fac(k)*current_state%q(iqs)%data(k,current_y_index, current_x_index)
281 tot_iwp(target_y_index, target_x_index)=tot_iwp(target_y_index, target_x_index)+ &
282 swp(target_y_index, target_x_index)
284 if (current_state%graupel_water_mixing_ratio_index > 0)
then
285 do k = 2, current_state%local_grid%size(
z_index)
286 gwp(target_y_index, target_x_index)=gwp(target_y_index, target_x_index) &
287 +dz_rhon_fac(k)*current_state%q(iqg)%data(k,current_y_index, current_x_index)
289 tot_iwp(target_y_index, target_x_index)=tot_iwp(target_y_index, target_x_index)+ &
290 gwp(target_y_index, target_x_index)
296 if (current_state%use_surface_boundary_conditions)
then
297 if (current_state%water_vapour_mixing_ratio_index .gt. 0 .and. &
298 current_state%number_q_fields .ge. current_state%water_vapour_mixing_ratio_index)
then
299 lathf(target_y_index, target_x_index)= (current_state%diff_coefficient%data(1, current_y_index, current_x_index) * &
300 current_state%global_grid%configuration%vertical%rdzn(2) * &
301 (current_state%q(current_state%water_vapour_mixing_ratio_index)%data(1,current_y_index,current_x_index) - &
302 current_state%q(current_state%water_vapour_mixing_ratio_index)%data(2,current_y_index,current_x_index))) &
303 * rlvap * current_state%global_grid%configuration%vertical%rhon(1)
306 if (current_state%th%active)
then
307 senhf(target_y_index, target_x_index)=(current_state%diff_coefficient%data(1, current_y_index, current_x_index) &
308 * current_state%global_grid%configuration%vertical%rdzn(2) &
309 * (current_state%th%data(1, current_y_index, current_x_index) &
310 - current_state%th%data(2, current_y_index, current_x_index) &
311 - current_state%global_grid%configuration%vertical%dthref(1))) &
312 * current_state%global_grid%configuration%vertical%rhon(1)*
cp