Called for each column per timestep this will apply a forcing term to the aerosol fields.
72 type(model_state_type),
target,
intent(inout) :: current_state
74 real(DEFAULT_PRECISION) :: tdegk
75 real(DEFAULT_PRECISION) :: pmb
76 real(DEFAULT_PRECISION) :: exner
77 real(DEFAULT_PRECISION) :: one_over_exner
78 real(DEFAULT_PRECISION) :: qv,qc
79 real(DEFAULT_PRECISION) :: qs
80 real(DEFAULT_PRECISION) :: dqsdt
81 real(DEFAULT_PRECISION) :: qsatfac
82 real(DEFAULT_PRECISION) :: dmass
87 real(DEFAULT_PRECISION) :: dtm
89 if (current_state%halo_column)
return 91 dtm = current_state%dtm*2.0
92 if (current_state%field_stepping == forward_stepping) dtm=current_state%dtm
94 icol=current_state%column_local_x
95 jcol=current_state%column_local_y
99 exner = current_state%global_grid%configuration%vertical%rprefrcp(k)
100 one_over_exner = current_state%global_grid%configuration%vertical%prefrcp(k)
101 pmb = (current_state%global_grid%configuration%vertical%prefn(k)/100.)
103 if (current_state%field_stepping == forward_stepping)
then 104 qv = current_state%q(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
105 qc = current_state%q(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
106 tdegk = (current_state%th%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
107 + current_state%global_grid%configuration%vertical%thref(k))*exner
109 qv = current_state%zq(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
110 qc = current_state%zq(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
111 tdegk = (current_state%zth%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
112 + current_state%global_grid%configuration%vertical%thref(k))*exner
116 qs = qsaturation(tdegk, pmb)
118 if (qv > qs .or. qc >0.0)
then 119 dqsdt = dqwsatdt(qs, tdegk)
121 qsatfac = 1.0/(1.0 + rlvap_over_cp*dqsdt)
123 dmass = max(-qc,(qv-qs)*qsatfac)/dtm
125 current_state%sq(iqv)%data(k, jcol, icol) = current_state%sq(iqv)%data(k, jcol, icol) - dmass
126 current_state%sq(iql)%data(k, jcol, icol) = current_state%sq(iql)%data(k, jcol, icol) + dmass
128 current_state%sth%data(k, jcol, icol) = current_state%sth%data(k, jcol, icol) &
129 + rlvap_over_cp*dmass*one_over_exner
136 do k=k_cloudmax+1, current_state%local_grid%size(z_index)
137 if (current_state%scalar_stepping == forward_stepping)
then 138 qv = current_state%q(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
139 qc = current_state%q(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
140 tdegk = (current_state%th%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
141 + current_state%global_grid%configuration%vertical%thref(k))*exner
143 qv = current_state%zq(iqv)%data(k, jcol, icol) + current_state%sq(iqv)%data(k, jcol, icol)*dtm
144 qc = current_state%zq(iql)%data(k, jcol, icol) + current_state%sq(iql)%data(k, jcol, icol)*dtm
145 tdegk = (current_state%zth%data(k, jcol, icol) + current_state%sth%data(k, jcol, icol)*dtm &
146 + current_state%global_grid%configuration%vertical%thref(k))*exner
151 current_state%sq(iqv)%data(k, jcol, icol) = current_state%sq(iqv)%data(k, jcol, icol) - dmass
152 current_state%sq(iql)%data(k, jcol, icol) = current_state%sq(iql)%data(k, jcol, icol) + dmass
154 current_state%sth%data(k, jcol, icol) = current_state%sth%data(k, jcol, icol) &
155 + rlvap_over_cp*dmass*one_over_exner