Called for each column per timestep this will apply a forcing term to the aerosol fields.
268 type(model_state_type),
target,
intent(inout) :: current_state
270 real(DEFAULT_PRECISION) :: TdegK
271 real(DEFAULT_PRECISION) :: Pmb
272 real(DEFAULT_PRECISION) :: exner
273 real(DEFAULT_PRECISION) :: one_over_exner
274 real(DEFAULT_PRECISION) :: qv,qc
275 real(DEFAULT_PRECISION) :: qs
276 real(DEFAULT_PRECISION) :: dqsdT
277 real(DEFAULT_PRECISION) :: qsatfac
278 real(DEFAULT_PRECISION) :: dmass
281 integer :: icol, jcol
283 real(DEFAULT_PRECISION) :: dtm
284 integer :: target_x_index, target_y_index
287 if (current_state%first_timestep_column)
then
288 if (l_tend_pr_tot_th)
then
289 tend_pr_tot_th(:)=0.0_default_precision
291 if (l_tend_pr_tot_qv)
then
292 tend_pr_tot_qv(:)=0.0_default_precision
294 if (l_tend_pr_tot_ql)
then
295 tend_pr_tot_ql(:)=0.0_default_precision
297 if (l_tend_pr_tot_tabs)
then
298 tend_pr_tot_tabs(:)=0.0_default_precision
303 if (current_state%halo_column)
return
306 dtm = current_state%dtm*2.0
307 if (current_state%field_stepping == forward_stepping) dtm=current_state%dtm
309 icol=current_state%column_local_x
310 jcol=current_state%column_local_y
311 target_y_index=jcol-current_state%local_grid%halo_size(
y_index)
312 target_x_index=icol-current_state%local_grid%halo_size(
x_index)
314 if (mod(current_state%timestep, diagnostic_generation_frequency) == 0)
then
315 call save_precomponent_tendencies(current_state, icol, jcol, target_x_index, target_y_index)
320 exner = current_state%global_grid%configuration%vertical%rprefrcp(k)
321 one_over_exner = current_state%global_grid%configuration%vertical%prefrcp(k)
322 pmb = (current_state%global_grid%configuration%vertical%prefn(k)/100.)
324 if (current_state%field_stepping == forward_stepping)
then
325 qv = current_state%q(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
326 qc = current_state%q(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
327 tdegk = (current_state%th%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
328 + current_state%global_grid%configuration%vertical%thref(k))*exner
330 qv = current_state%zq(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
331 qc = current_state%zq(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
332 tdegk = (current_state%zth%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
333 + current_state%global_grid%configuration%vertical%thref(k))*exner
337 qs = qsaturation(tdegk, pmb)
339 if (qv > qs .or. qc >0.0)
then
340 dqsdt = dqwsatdt(qs, tdegk)
342 qsatfac = 1.0/(1.0 + rlvap_over_cp*dqsdt)
344 dmass = max(-qc,(qv-qs)*qsatfac)/dtm
346 current_state%sq(iqv)%data(k, jcol, icol) = current_state%sq(iqv)%data(k, jcol, icol) - dmass
347 current_state%sq(iql)%data(k, jcol, icol) = current_state%sq(iql)%data(k, jcol, icol) + dmass
349 current_state%sth%data(k, jcol, icol) = current_state%sth%data(k, jcol, icol) &
350 + rlvap_over_cp*dmass*one_over_exner
357 do k=k_cloudmax+1, current_state%local_grid%size(
z_index)
358 if (current_state%scalar_stepping == forward_stepping)
then
359 qv = current_state%q(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
360 qc = current_state%q(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
361 tdegk = (current_state%th%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
362 + current_state%global_grid%configuration%vertical%thref(k))*exner
364 qv = current_state%zq(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
365 qc = current_state%zq(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
366 tdegk = (current_state%zth%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
367 + current_state%global_grid%configuration%vertical%thref(k))*exner
372 current_state%sq(iqv)%data(k, jcol, icol) = current_state%sq(iqv)%data(k, jcol, icol) - dmass
373 current_state%sq(iql)%data(k, jcol, icol) = current_state%sq(iql)%data(k, jcol, icol) + dmass
375 current_state%sth%data(k, jcol, icol) = current_state%sth%data(k, jcol, icol) &
376 + rlvap_over_cp*dmass*one_over_exner
381 if (mod(current_state%timestep, diagnostic_generation_frequency) == 0)
then
382 call compute_component_tendencies(current_state, icol, jcol, target_x_index, target_y_index)