25 qlmax,
hqlmax,
cltop,
clbas,
senhf,
lathf,
rwp,
iwp,
swp,
gwp,
tot_iwp, &
65 type(model_state_type),
target,
intent(inout) :: current_state
68 integer :: y_size_local, x_size_local
71 qlcrit=options_get_real(current_state%options_database,
"qlcrit")
73 y_size_local = current_state%local_grid%size(y_index)
74 x_size_local = current_state%local_grid%size(x_index)
79 allocate(
wmax(y_size_local, x_size_local),
wmin(y_size_local, x_size_local), &
80 reske(y_size_local, x_size_local), &
81 senhf(y_size_local, x_size_local),
lathf(y_size_local, x_size_local))
83 allocate(
ww_prime_res(current_state%local_grid%size(z_index)), &
90 if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0)
then
91 iqv = current_state%water_vapour_mixing_ratio_index
92 iql = current_state%liquid_water_mixing_ratio_index
93 allocate(
vwp(y_size_local, x_size_local),
lwp(y_size_local, x_size_local), &
94 qlmax(y_size_local, x_size_local),
hqlmax(y_size_local, x_size_local), &
95 cltop(y_size_local, x_size_local),
clbas(y_size_local, x_size_local))
96 allocate(
cloud_content(current_state%local_grid%size(z_index)))
99 if (current_state%rain_water_mixing_ratio_index > 0)
then
100 iqr = current_state%rain_water_mixing_ratio_index
101 allocate(
rwp(y_size_local, x_size_local))
103 if (current_state%ice_water_mixing_ratio_index > 0)
then
104 iqi = current_state%ice_water_mixing_ratio_index
105 allocate(
iwp(y_size_local, x_size_local))
106 allocate(
tot_iwp(y_size_local, x_size_local))
108 if (current_state%snow_water_mixing_ratio_index > 0)
then
109 iqs = current_state%snow_water_mixing_ratio_index
110 allocate(
swp(y_size_local, x_size_local))
112 if (current_state%graupel_water_mixing_ratio_index > 0)
then
113 iqg = current_state%graupel_water_mixing_ratio_index
114 allocate(
gwp(y_size_local, x_size_local))
118 allocate(
dz_rhon_fac(current_state%local_grid%size(z_index)))
119 do k=2, current_state%local_grid%size(z_index)
121 dz_rhon_fac(k)=current_state%global_grid%configuration%vertical%dz(k)*&
122 current_state%global_grid%configuration%vertical%rhon(k)
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.)
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.)
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) + &
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) &
237 :,current_y_index, current_x_index)
238 do k = 2, current_state%local_grid%size(z_index)
240 cltop(target_y_index, target_x_index) = &
241 current_state%global_grid%configuration%vertical%zn(k)
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
323 type(model_state_type),
target,
intent(inout) :: current_state
324 character(len=*),
intent(in) :: name
325 type(component_field_information_type),
intent(out) :: field_information
327 field_information%field_type=component_array_field_type
328 field_information%number_dimensions=2
329 field_information%dimension_sizes(1)=current_state%local_grid%size(y_index)
330 field_information%dimension_sizes(2)=current_state%local_grid%size(x_index)
331 field_information%data_type=component_double_data_type
333 if (name .eq.
"senhf")
then
334 field_information%enabled=current_state%use_surface_boundary_conditions .and. current_state%th%active
335 else if (name .eq.
"lathf")
then
336 field_information%enabled=current_state%use_surface_boundary_conditions .and. &
337 current_state%water_vapour_mixing_ratio_index .gt. 0 .and. &
338 current_state%number_q_fields .ge. current_state%water_vapour_mixing_ratio_index
339 else if (name .eq.
"qlmax".or. name .eq.
"cltop" .or. name .eq.
"clbas")
then
340 field_information%enabled=.not. current_state%passive_q .and. current_state%liquid_water_mixing_ratio_index .gt. 0 &
341 .and. current_state%number_q_fields .ge. current_state%liquid_water_mixing_ratio_index
342 else if (name .eq.
"vwp" .or. name .eq.
"lwp")
then
343 field_information%enabled=current_state%number_q_fields .gt. 0 .and. current_state%water_vapour_mixing_ratio_index .gt. 0 &
344 .and. current_state%number_q_fields .ge. current_state%water_vapour_mixing_ratio_index
345 else if (name .eq.
"rwp" )
then
346 field_information%enabled= current_state%rain_water_mixing_ratio_index .gt. 0
347 else if (name .eq.
"iwp" .or. name .eq.
'tot_iwp')
then
348 field_information%enabled= current_state%ice_water_mixing_ratio_index .gt. 0
349 else if (name .eq.
"swp" )
then
350 field_information%enabled= current_state%snow_water_mixing_ratio_index .gt. 0
351 else if (name .eq.
"gwp" )
then
352 field_information%enabled= current_state%graupel_water_mixing_ratio_index .gt. 0
354 field_information%enabled=.true.
364 type(model_state_type),
target,
intent(inout) :: current_state
365 character(len=*),
intent(in) :: name
366 type(component_field_value_type),
intent(out) :: field_value
370 if (name .eq.
"wmax")
then
371 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
372 current_state%local_grid%size(x_index)))
373 field_value%real_2d_array(:,:)=
wmax(:,:)
374 else if (name .eq.
"wmin")
then
375 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
376 current_state%local_grid%size(x_index)))
377 field_value%real_2d_array(:,:)=
wmin(:,:)
378 else if (name .eq.
'reske')
then
379 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
380 current_state%local_grid%size(x_index)))
381 field_value%real_2d_array(:,:)=
reske(:,:)
382 else if (name .eq.
"qlmax")
then
383 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
384 current_state%local_grid%size(x_index)))
385 field_value%real_2d_array(:,:)=
qlmax(:,:)
390 else if (name .eq.
"cltop")
then
391 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
392 current_state%local_grid%size(x_index)))
393 field_value%real_2d_array(:,:)=
cltop(:,:)
394 else if (name .eq.
"clbas")
then
395 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
396 current_state%local_grid%size(x_index)))
397 field_value%real_2d_array(:,:)=
clbas(:,:)
398 else if (name .eq.
"vwp")
then
399 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
400 current_state%local_grid%size(x_index)))
401 field_value%real_2d_array(:,:)=
vwp(:,:)
402 else if (name .eq.
"lwp")
then
403 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
404 current_state%local_grid%size(x_index)))
405 field_value%real_2d_array(:,:)=
lwp(:,:)
406 else if (name .eq.
"rwp")
then
407 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
408 current_state%local_grid%size(x_index)))
409 field_value%real_2d_array(:,:)=
rwp(:,:)
410 else if (name .eq.
"iwp")
then
411 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
412 current_state%local_grid%size(x_index)))
413 field_value%real_2d_array(:,:)=
iwp(:,:)
414 else if (name .eq.
"swp")
then
415 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
416 current_state%local_grid%size(x_index)))
417 field_value%real_2d_array(:,:)=
swp(:,:)
418 else if (name .eq.
"gwp")
then
419 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
420 current_state%local_grid%size(x_index)))
421 field_value%real_2d_array(:,:)=
gwp(:,:)
422 else if (name .eq.
"tot_iwp")
then
423 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
424 current_state%local_grid%size(x_index)))
425 field_value%real_2d_array(:,:)=
tot_iwp(:,:)
426 else if (name .eq.
"senhf")
then
427 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
428 current_state%local_grid%size(x_index)))
429 field_value%real_2d_array(:,:)=
senhf(:,:)
430 else if (name .eq.
"lathf")
then
431 allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
432 current_state%local_grid%size(x_index)))
433 field_value%real_2d_array(:,:)=
lathf(:,:)