23 SUBROUTINE cloud_driver_d(dt, im, jm, lm, th, thd, q, qd, ple, cnv_dqldt&
24 & , cnv_dqldtd, cnv_mfd, cnv_mfdd, cnv_prc3, cnv_prc3d, cnv_updf, &
25 & cnv_updfd, qi_ls, qi_lsd, ql_ls, ql_lsd, qi_con, qi_cond, ql_con, &
26 & ql_cond, cf_ls, cf_lsd, cf_con, cf_cond, frland, physparams, estblx, &
27 & khu, khl, cons_runiv, cons_kappa, cons_airmw, cons_h2omw, cons_grav, &
28 & cons_alhl, cons_alhf, cons_pi, cons_rgas, cons_cp, cons_vireps, &
29 & cons_alhs, cons_tice, cons_rvap, cons_p00, do_moist_physics)
32 INTEGER,
INTENT(IN) :: im, jm, lm, do_moist_physics
33 REAL*8,
INTENT(IN) :: dt, frland(im, jm), physparams(:)
34 REAL*8,
DIMENSION(im, jm, lm),
INTENT(IN) :: cnv_dqldt, cnv_mfd, &
36 REAL*8,
DIMENSION(im, jm, lm),
INTENT(IN) :: cnv_dqldtd, cnv_mfdd, &
37 & cnv_updfd, cnv_prc3d
38 REAL*8,
INTENT(IN) :: estblx(:)
39 REAL*8,
DIMENSION(im, jm, 0:lm),
INTENT(IN) :: ple
40 INTEGER,
DIMENSION(im, jm),
INTENT(IN) :: khu, khl
42 REAL*8,
INTENT(IN) :: cons_runiv, cons_kappa, cons_airmw
43 REAL*8,
INTENT(IN) :: cons_h2omw, cons_grav, cons_alhl
44 REAL*8,
INTENT(IN) :: cons_alhf, cons_pi, cons_rgas
45 REAL*8,
INTENT(IN) :: cons_cp, cons_vireps, cons_alhs
46 REAL*8,
INTENT(IN) :: cons_tice, cons_rvap, cons_p00
48 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: th, q
49 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: thd, qd
50 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: qi_ls, ql_ls, qi_con, &
51 & ql_con, cf_con, cf_ls
52 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: qi_lsd, ql_lsd, &
53 & qi_cond, ql_cond, cf_cond, cf_lsd
56 INTEGER :: i, j, k, l, ktop
57 REAL*8,
DIMENSION(im, jm, lm) :: ph, pih, mass, imass, t, dzet, qddf3&
59 REAL*8,
DIMENSION(im, jm, lm) :: td, dzetd, qddf3d
60 REAL*8,
DIMENSION(im, jm, lm + 1) :: zet
61 REAL*8,
DIMENSION(im, jm, lm+1) :: zetd
62 REAL*8,
DIMENSION(im, jm, 0:lm) :: p, pi
63 REAL*8,
DIMENSION(im, jm, lm) :: qs, dqsdt, dqs
64 REAL*8,
DIMENSION(im, jm, lm) :: qsd, dqsdtd, dqsd
65 REAL*8,
DIMENSION(im, jm) :: vmip
66 REAL*8,
DIMENSION(im, jm) :: vmipd
70 REAL*8 :: alpha, alhx3, rhcrit
75 REAL*8,
PARAMETER :: pi_0=4.*atan(1.)
77 REAL*8,
PARAMETER :: rho_w=1.0e3
80 REAL*8 :: cnv_beta, anv_beta, ls_beta, rh00, c_00, lwcrit, c_acc, &
81 & c_ev_r, c_ev_s, cldvol2frc
82 REAL*8 :: rhsup_ice, shr_evap_fac, min_cld_water, cld_evp_eff, &
83 & ls_sdqv2, ls_sdqv3, ls_sdqvt1
84 REAL*8 :: anv_sdqv2, anv_sdqv3, anv_sdqvt1, anv_to_ls, n_warm, n_ice, &
86 REAL*8 :: anv_icefall_c, ls_icefall_c, revap_off_p, cnvenvfc, wrhodep&
87 & , t_ice_all, cnviceparam
88 REAL*8 :: cnvddrfc, anvddrfc, lsddrfc, minrhcrit, maxrhcrit, &
89 & turnrhcrit, maxrhcritland
90 REAL*8 :: min_rl, min_ri, max_rl, max_ri, ri_anv
91 INTEGER :: nsmax, disable_rad, icefrpwr, tanhrhcrit, fr_ls_wat, &
92 & fr_ls_ice, fr_an_wat, fr_an_ice, pdfflag
93 REAL*8 :: lsenvfc, anvenvfc
94 REAL*8 :: qrn_cu, qsn_cu, qrn_an, qsn_an, qrn_ls, qsn_ls, qrn_cu_1d
95 REAL*8 :: qsn_cud, qrn_and, qsn_and, qrn_lsd, qsn_lsd, qrn_cu_1dd
96 REAL*8 :: qt_tmpi_1, qt_tmpi_2, qlt_tmp, qit_tmp
97 REAL*8 :: qt_tmpi_1d, qt_tmpi_2d, qlt_tmpd, qit_tmpd
98 REAL*8 :: prn_above_cu_new, prn_above_an_new, prn_above_ls_new
99 REAL*8 :: prn_above_cu_newd, prn_above_an_newd, prn_above_ls_newd
100 REAL*8 :: prn_above_cu_old, prn_above_an_old, prn_above_ls_old
101 REAL*8 :: prn_above_cu_oldd, prn_above_an_oldd, prn_above_ls_oldd
102 REAL*8 :: psn_above_cu_new, psn_above_an_new, psn_above_ls_new
103 REAL*8 :: psn_above_cu_newd, psn_above_an_newd, psn_above_ls_newd
104 REAL*8 :: psn_above_cu_old, psn_above_an_old, psn_above_ls_old
105 REAL*8 :: psn_above_cu_oldd, psn_above_an_oldd, psn_above_ls_oldd
106 REAL*8 :: evap_dd_cu_above_new, evap_dd_an_above_new, &
107 & evap_dd_ls_above_new
108 REAL*8 :: evap_dd_cu_above_newd, evap_dd_an_above_newd, &
109 & evap_dd_ls_above_newd
110 REAL*8 :: evap_dd_cu_above_old, evap_dd_an_above_old, &
111 & evap_dd_ls_above_old
112 REAL*8 :: evap_dd_cu_above_oldd, evap_dd_an_above_oldd, &
113 & evap_dd_ls_above_oldd
114 REAL*8 :: subl_dd_cu_above_new, subl_dd_an_above_new, &
115 & subl_dd_ls_above_new
116 REAL*8 :: subl_dd_cu_above_newd, subl_dd_an_above_newd, &
117 & subl_dd_ls_above_newd
118 REAL*8 :: subl_dd_cu_above_old, subl_dd_an_above_old, &
119 & subl_dd_ls_above_old
120 REAL*8 :: subl_dd_cu_above_oldd, subl_dd_an_above_oldd, &
121 & subl_dd_ls_above_oldd
122 REAL*8 :: area_ls_prc1, area_upd_prc1, area_anv_prc1
123 REAL*8 :: area_ls_prc1d, area_upd_prc1d, area_anv_prc1d
124 REAL*8 :: tot_prec_upd, tot_prec_anv, tot_prec_ls, area_upd_prc, &
125 & area_anv_prc, area_ls_prc
126 REAL*8 :: tot_prec_updd, tot_prec_anvd, tot_prec_lsd, area_upd_prcd, &
127 & area_anv_prcd, area_ls_prcd
129 REAL*8 :: rhexcess, tpw, negtpw
130 REAL*8 :: tpwd, negtpwd
131 INTEGER :: cloud_pertmod
136 REAL*8,
DIMENSION(im, jm, 0:lm) :: pwx1
138 REAL*8,
DIMENSION(im, jm, lm) :: pwx10
143 real(8) :: ttraj, qtraj, qi_lstraj, qi_contraj, ql_lstraj, ql_contraj, cf_lstraj, cf_contraj, phtraj
144 real(8) :: tpert, qpert, qi_lspert, qi_conpert, ql_lspert, ql_conpert, cf_lspert, cf_conpert
145 real(8) :: jacobian(8,8), a(8,8)
148 integer,
parameter :: n1 = 8
149 integer,
parameter :: lda = 8
150 REAL(8) :: wr(n1), wi(n1)
151 INTEGER,
PARAMETER :: ldvl = n1
152 REAL(8) :: vl(ldvl,n1)
153 INTEGER,
PARAMETER :: ldvr = n1
154 REAL(8) :: vr(ldvr,n1)
155 INTEGER :: info, lwork
156 INTEGER,
PARAMETER :: lwmax = 10000
157 REAL(8) :: work(lwmax)
162 real(8) :: totfilt_t, totfilt_ql, totfilt_qi
163 real(8) :: t_p_preall, ql_ls_p_preall, ql_con_p_preall, qi_ls_p_preall, qi_con_p_preall
166 real(8) :: sinkfilt_ql, sinkfilt_qi, sinkfilt_cf
167 real(8) :: t_p_presink, q_p_presink
168 real(8) :: ql_ls_p_presink, ql_con_p_presink
169 real(8) :: qi_ls_p_presink, qi_con_p_presink
176 cnv_beta = physparams(1)
178 anv_beta = physparams(2)
180 ls_beta = physparams(3)
184 lwcrit = physparams(6)
185 c_acc = physparams(7)
186 c_ev_r = physparams(8)
187 c_ev_s = physparams(56)
188 cldvol2frc = physparams(9)
189 rhsup_ice = physparams(10)
190 shr_evap_fac = physparams(11)
191 min_cld_water = physparams(12)
192 cld_evp_eff = physparams(13)
193 nsmax = int(physparams(14))
194 ls_sdqv2 = physparams(15)
195 ls_sdqv3 = physparams(16)
196 ls_sdqvt1 = physparams(17)
197 anv_sdqv2 = physparams(18)
198 anv_sdqv3 = physparams(19)
199 anv_sdqvt1 = physparams(20)
200 anv_to_ls = physparams(21)
201 n_warm = physparams(22)
202 n_ice = physparams(23)
203 n_anvil = physparams(24)
204 n_pbl = physparams(25)
205 disable_rad = int(physparams(26))
206 anv_icefall_c = physparams(28)
207 ls_icefall_c = physparams(29)
208 revap_off_p = physparams(30)
209 cnvenvfc = physparams(31)
210 wrhodep = physparams(32)
211 t_ice_all = physparams(33) + cons_tice
212 cnviceparam = physparams(34)
213 icefrpwr = int(physparams(35) + .001)
214 cnvddrfc = physparams(36)
215 anvddrfc = physparams(37)
216 lsddrfc = physparams(38)
217 tanhrhcrit = int(physparams(41))
218 minrhcrit = physparams(42)
219 maxrhcrit = physparams(43)
220 turnrhcrit = physparams(45)
221 maxrhcritland = physparams(46)
222 fr_ls_wat = int(physparams(47))
223 fr_ls_ice = int(physparams(48))
224 fr_an_wat = int(physparams(49))
225 fr_an_ice = int(physparams(50))
226 min_rl = physparams(51)
227 min_ri = physparams(52)
228 max_rl = physparams(53)
229 max_ri = physparams(54)
230 ri_anv = physparams(55)
231 pdfflag = int(physparams(57))
232 t_ice_max = cons_tice
234 prn_above_cu_new = 0.
235 prn_above_an_new = 0.
236 prn_above_ls_new = 0.
237 psn_above_cu_new = 0.
238 psn_above_an_new = 0.
239 psn_above_ls_new = 0.
240 evap_dd_cu_above_new = 0.
241 evap_dd_an_above_new = 0.
242 evap_dd_ls_above_new = 0.
243 subl_dd_cu_above_new = 0.
244 subl_dd_an_above_new = 0.
245 subl_dd_ls_above_new = 0.
248 ph = 0.5*(p(:, :, 0:lm-1)+p(:, :, 1:lm))
251 pwy1 = cons_rgas/cons_cp
254 pwy1 = cons_rgas/cons_cp
262 CALL dqsat_bac_d(dqsdt, dqsdtd, qs, qsd, t, td, ph, im, jm, lm, estblx&
263 & , cons_h2omw, cons_airmw)
267 mass = (p(:, :, 1:lm)-p(:, :, 0:lm-1))*100./cons_grav
270 dzetd(:, :, 1:lm) = (pi(:, :, 1:lm)-pi(:, :, 0:lm-1))*cons_cp*thd(:, :&
272 dzet(:, :, 1:lm) = th(:, :, 1:lm)*(pi(:, :, 1:lm)-pi(:, :, 0:lm-1))*&
275 zetd(:, :, lm+1) = 0.0_8
276 zet(:, :, lm+1) = 0.0
279 zetd(:, :, k) = zetd(:, :, k+1) + dzetd(:, :, k)
280 zet(:, :, k) = zet(:, :, k+1) + dzet(:, :, k)
283 WHERE (zet(:, :, 1:lm) .LT. 3000.)
284 qddf3d = -(mass*(zetd(:, :, 1:lm)*zet(:, :, 1:lm)+(zet(:, :, 1:lm)-&
285 & 3000.)*zetd(:, :, 1:lm)))
286 qddf3 = -((zet(:, :, 1:lm)-3000.)*zet(:, :, 1:lm)*mass)
294 vmipd(i, j) = sum(qddf3d(i, j, :))
295 vmip(i, j) = sum(qddf3(i, j, :))
299 qddf3d(:, :, k) = (qddf3d(:, :, k)*vmip-qddf3(:, :, k)*vmipd)/vmip**&
301 qddf3(:, :, k) = qddf3(:, :, k)/vmip
304 dp = ple(:, :, 1:lm) - ple(:, :, 0:lm-1)
305 dm = dp*(1./cons_grav)
306 prn_above_cu_newd = 0.0_8
307 psn_above_cu_newd = 0.0_8
308 evap_dd_an_above_newd = 0.0_8
309 area_upd_prcd = 0.0_8
310 prn_above_ls_newd = 0.0_8
311 evap_dd_ls_above_newd = 0.0_8
312 evap_dd_cu_above_newd = 0.0_8
313 psn_above_ls_newd = 0.0_8
316 tot_prec_updd = 0.0_8
317 prn_above_an_newd = 0.0_8
318 area_anv_prcd = 0.0_8
319 psn_above_an_newd = 0.0_8
321 subl_dd_an_above_newd = 0.0_8
322 tot_prec_anvd = 0.0_8
323 subl_dd_ls_above_newd = 0.0_8
324 subl_dd_cu_above_newd = 0.0_8
331 t_p_preall = td(i, j, k)
332 ql_ls_p_preall = ql_lsd(i, j, k)
333 ql_con_p_preall = ql_cond(i, j, k)
334 qi_ls_p_preall = qi_lsd(i, j, k)
335 qi_con_p_preall = qi_cond(i, j, k)
337 IF (k .EQ. ktop)
THEN 344 area_upd_prcd = 0.0_8
347 tot_prec_updd = 0.0_8
348 area_anv_prcd = 0.0_8
349 tot_prec_anvd = 0.0_8
359 qrn_cu_1dd = cnv_prc3d(i, j, k)
360 qrn_cu_1d = cnv_prc3(i, j, k)
362 CALL cloud_tidy_d(q(i, j, k), qd(i, j, k), t(i, j, k), td(i, j, &
363 & k), ql_ls(i, j, k), ql_lsd(i, j, k), qi_ls(i, j, k)&
364 & , qi_lsd(i, j, k), cf_ls(i, j, k), cf_lsd(i, j, k), &
365 & ql_con(i, j, k), ql_cond(i, j, k), qi_con(i, j, k), &
366 & qi_cond(i, j, k), cf_con(i, j, k), cf_cond(i, j, k)&
367 & , cons_alhl, cons_alhs, cons_cp)
369 CALL meltfreeze_d(dt, t(i, j, k), td(i, j, k), ql_ls(i, j, k), &
370 & ql_lsd(i, j, k), qi_ls(i, j, k), qi_lsd(i, j, k), &
371 & t_ice_all, t_ice_max, icefrpwr, cons_alhl, cons_alhs&
374 CALL meltfreeze_d(dt, t(i, j, k), td(i, j, k), ql_con(i, j, k), &
375 & ql_cond(i, j, k), qi_con(i, j, k), qi_cond(i, j, k)&
376 & , t_ice_all, t_ice_max, icefrpwr, cons_alhl, &
377 & cons_alhs, cons_cp)
379 CALL convec_src_d(dt, mass(i, j, k), imass(i, j, k), t(i, j, k)&
380 & , td(i, j, k), q(i, j, k), qd(i, j, k), cnv_dqldt(i&
381 & , j, k), cnv_dqldtd(i, j, k), cnv_mfd(i, j, k), &
382 & cnv_mfdd(i, j, k), ql_con(i, j, k), ql_cond(i, j, k)&
383 & , qi_con(i, j, k), qi_cond(i, j, k), cf_con(i, j, k)&
384 & , cf_cond(i, j, k), qs(i, j, k), qsd(i, j, k), &
385 & cons_alhs, cons_alhl, cons_cp, t_ice_all, t_ice_max&
388 CALL pdf_width(ph(i, j, k), frland(i, j), maxrhcrit, &
389 & maxrhcritland, turnrhcrit, minrhcrit, pi_0, alpha)
390 IF (alpha .LT. 1.0 - rh00)
THEN 400 if (do_moist_physics == 1)
then 405 elseif (do_moist_physics == 2)
then 419 qi_lstraj = qi_ls(i,j,k)
420 qi_contraj = qi_con(i,j,k)
421 ql_lstraj = ql_ls(i,j,k)
422 ql_contraj = ql_con(i,j,k)
423 cf_lstraj = cf_ls(i,j,k)
424 cf_contraj = cf_con(i,j,k)
436 CALL ls_cloud_d(dt, alpha, pdfflag, phtraj, ttraj, tpert, qtraj, qpert, &
437 ql_lstraj, ql_lspert, ql_contraj, ql_conpert, &
438 qi_lstraj, qi_lspert, qi_contraj, qi_conpert, &
439 cf_lstraj, cf_lspert, cf_contraj, cf_conpert, &
440 cons_alhl, cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw, &
441 t_ice_all, t_ice_max, icefrpwr, estblx, 0, do_moist_physics)
443 jacobian(1,ii) = tpert
444 jacobian(2,ii) = qpert
445 jacobian(3,ii) = qi_lspert
446 jacobian(4,ii) = qi_conpert
447 jacobian(5,ii) = ql_lspert
448 jacobian(6,ii) = ql_conpert
449 jacobian(7,ii) = cf_lspert
450 jacobian(8,ii) = cf_conpert
461 CALL dgeev(
'Vectors',
'Vectors', n1, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, info )
463 lwork =
min( lwmax, int( work( 1 ) ) )
464 CALL dgeev(
'Vectors',
'Vectors', n1, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, info )
466 maxeval = maxval(abs(wr))
469 if (maxeval > 1.001)
then 474 if ( ( jacobian(1,1) < 0.6 ) .or. &
475 ( jacobian(2,1) > 0.75e-4 ) .or. &
476 ( jacobian(5,1) < -0.75e-4 ) .or. &
477 ( jacobian(7,1) < -1.10 ) )
then 483 CALL ls_cloud_d(dt, alpha, pdfflag, ph(i, j, k), t(i, j, k), td(&
484 & i, j, k), q(i, j, k), qd(i, j, k), ql_ls(i, j, k), &
485 & ql_lsd(i, j, k), ql_con(i, j, k), ql_cond(i, j, k), &
486 & qi_ls(i, j, k), qi_lsd(i, j, k), qi_con(i, j, k), &
487 & qi_cond(i, j, k), cf_ls(i, j, k), cf_lsd(i, j, k), &
488 & cf_con(i, j, k), cf_cond(i, j, k), cons_alhl, &
489 & cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw&
490 & , t_ice_all, t_ice_max, icefrpwr, estblx, &
491 & cloud_pertmod, do_moist_physics)
494 t_p_presink = td(i,j,k)
495 q_p_presink = qd(i,j,k)
496 qi_ls_p_presink = qi_lsd(i,j,k)
497 qi_con_p_presink = qi_cond(i,j,k)
498 ql_ls_p_presink = ql_lsd(i,j,k)
499 ql_con_p_presink = ql_cond(i,j,k)
503 cf_totd = cf_lsd(i, j, k) + cf_cond(i, j, k)
504 cf_tot = cf_ls(i, j, k) + cf_con(i, j, k)
505 IF (cf_tot .GT. 1.00)
THEN 506 cf_lsd(i, j, k) = cf_lsd(i, j, k)/cf_tot - cf_ls(i, j, k)*&
508 cf_ls(i, j, k) = cf_ls(i, j, k)*(1.00/cf_tot)
509 cf_cond(i, j, k) = cf_cond(i, j, k)/cf_tot - cf_con(i, j, k)*&
511 cf_con(i, j, k) = cf_con(i, j, k)*(1.00/cf_tot)
513 cf_tot = cf_ls(i, j, k) + cf_con(i, j, k)
516 CALL evap_cnv_d(dt, rhcrit, ph(i, j, k), t(i, j, k), td(i, j, k)&
517 & , q(i, j, k), qd(i, j, k), ql_con(i, j, k), ql_cond(i&
518 & , j, k), qi_con(i, j, k), qi_cond(i, j, k), cf_con(i, &
519 & j, k), cf_cond(i, j, k), cf_ls(i, j, k), qs(i, j, k), &
520 & qsd(i, j, k), rho_w, cld_evp_eff, cons_h2omw, &
521 & cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, &
523 CALL subl_cnv_d(dt, rhcrit, ph(i, j, k), t(i, j, k), td(i, j, k)&
524 & , q(i, j, k), qd(i, j, k), ql_con(i, j, k), ql_cond(i&
525 & , j, k), qi_con(i, j, k), qi_cond(i, j, k), cf_con(i, &
526 & j, k), cf_cond(i, j, k), cf_ls(i, j, k), qs(i, j, k), &
527 & qsd(i, j, k), rho_w, cld_evp_eff, cons_h2omw, &
528 & cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, &
529 & cons_cp, cons_alhs)
532 & qrn_ls, qrn_lsd, t(i, j, k), td(i, j, k), ph(&
533 & i, j, k), cf_ls(i, j, k), cf_lsd(i, j, k), &
534 & ls_sdqv2, ls_sdqv3, ls_sdqvt1, c_00, lwcrit, &
537 & , qrn_an, qrn_and, t(i, j, k), td(i, j, k), &
538 & ph(i, j, k), cf_con(i, j, k), cf_cond(i, j, &
539 & k), anv_sdqv2, anv_sdqv3, anv_sdqvt1, c_00, &
540 & lwcrit, dzet(i, j, k))
543 & , k), ph(i, j, k), t(i, j, k), td(i, j, k), &
544 & cf_con(i, j, k), cf_cond(i, j, k), cons_rgas&
545 & , khu(i, j), khl(i, j), k, dt, dzet(i, j, k)&
546 & , dzetd(i, j, k), qsn_an, qsn_and, &
549 & ), ph(i, j, k), t(i, j, k), td(i, j, k), &
550 & cf_ls(i, j, k), cf_lsd(i, j, k), cons_rgas, &
551 & khu(i, j), khl(i, j), k, dt, dzet(i, j, k), &
552 & dzetd(i, j, k), qsn_ls, qsn_lsd, ls_icefall_c&
557 IF (t(i, j, k) .LT. cons_tice)
THEN 562 td(i, j, k) = td(i, j, k) + (cons_alhs-cons_alhl)*qsn_cud/&
564 t(i, j, k) = t(i, j, k) + qsn_cu*(cons_alhs-cons_alhl)/cons_cp
573 tot_prec_updd = tot_prec_updd + mass(i, j, k)*(qrn_cu_1dd+&
575 tot_prec_upd = tot_prec_upd + (qrn_cu_1d+qsn_cu)*mass(i, j, k)
576 area_upd_prcd = area_upd_prcd + mass(i, j, k)*(cnv_updfd(i, j, k&
577 & )*(qrn_cu_1d+qsn_cu)+cnv_updf(i, j, k)*(qrn_cu_1dd+qsn_cud))
578 area_upd_prc = area_upd_prc + cnv_updf(i, j, k)*(qrn_cu_1d+&
579 & qsn_cu)*mass(i, j, k)
580 tot_prec_anvd = tot_prec_anvd + mass(i, j, k)*(qrn_and+qsn_and)
581 tot_prec_anv = tot_prec_anv + (qrn_an+qsn_an)*mass(i, j, k)
582 area_anv_prcd = area_anv_prcd + mass(i, j, k)*(cf_cond(i, j, k)*&
583 & (qrn_an+qsn_an)+cf_con(i, j, k)*(qrn_and+qsn_and))
584 area_anv_prc = area_anv_prc + cf_con(i, j, k)*(qrn_an+qsn_an)*&
586 tot_prec_lsd = tot_prec_lsd + mass(i, j, k)*(qrn_lsd+qsn_lsd)
587 tot_prec_ls = tot_prec_ls + (qrn_ls+qsn_ls)*mass(i, j, k)
588 area_ls_prcd = area_ls_prcd + mass(i, j, k)*(cf_lsd(i, j, k)*(&
589 & qrn_ls+qsn_ls)+cf_ls(i, j, k)*(qrn_lsd+qsn_lsd))
590 area_ls_prc = area_ls_prc + cf_ls(i, j, k)*(qrn_ls+qsn_ls)*mass(&
592 IF (tot_prec_anv .GT. 0.0)
THEN 593 IF (area_anv_prc/tot_prec_anv .LT. 1.e-6)
THEN 594 area_anv_prc1 = 1.e-6
595 area_anv_prc1d = 0.0_8
597 area_anv_prc1d = (area_anv_prcd*tot_prec_anv-area_anv_prc*&
598 & tot_prec_anvd)/tot_prec_anv**2
599 area_anv_prc1 = area_anv_prc/tot_prec_anv
602 area_anv_prc1d = 0.0_8
604 IF (tot_prec_upd .GT. 0.0)
THEN 605 IF (area_upd_prc/tot_prec_upd .LT. 1.e-6)
THEN 606 area_upd_prc1 = 1.e-6
607 area_upd_prc1d = 0.0_8
609 area_upd_prc1d = (area_upd_prcd*tot_prec_upd-area_upd_prc*&
610 & tot_prec_updd)/tot_prec_upd**2
611 area_upd_prc1 = area_upd_prc/tot_prec_upd
614 area_upd_prc1d = 0.0_8
616 IF (tot_prec_ls .GT. 0.0)
THEN 617 IF (area_ls_prc/tot_prec_ls .LT. 1.e-6)
THEN 619 area_ls_prc1d = 0.0_8
621 area_ls_prc1d = (area_ls_prcd*tot_prec_ls-area_ls_prc*&
622 & tot_prec_lsd)/tot_prec_ls**2
623 area_ls_prc1 = area_ls_prc/tot_prec_ls
626 area_ls_prc1d = 0.0_8
628 area_ls_prc1d = ls_beta*area_ls_prc1d
629 area_ls_prc1 = ls_beta*area_ls_prc1
630 area_upd_prc1d = cnv_beta*area_upd_prc1d
631 area_upd_prc1 = cnv_beta*area_upd_prc1
632 area_anv_prc1d = anv_beta*area_anv_prc1d
633 area_anv_prc1 = anv_beta*area_anv_prc1
636 IF (tot_prec_anv .GT. 0.0)
THEN 637 IF (area_anv_prc/tot_prec_anv .LT. 1.e-6)
THEN 639 area_anv_prcd = 0.0_8
641 area_anv_prcd = (area_anv_prcd*tot_prec_anv-area_anv_prc*&
642 & tot_prec_anvd)/tot_prec_anv**2
643 area_anv_prc = area_anv_prc/tot_prec_anv
646 IF (tot_prec_upd .GT. 0.0)
THEN 647 IF (area_upd_prc/tot_prec_upd .LT. 1.e-6)
THEN 649 area_upd_prcd = 0.0_8
651 area_upd_prcd = (area_upd_prcd*tot_prec_upd-area_upd_prc*&
652 & tot_prec_updd)/tot_prec_upd**2
653 area_upd_prc = area_upd_prc/tot_prec_upd
656 IF (tot_prec_ls .GT. 0.0)
THEN 657 IF (area_ls_prc/tot_prec_ls .LT. 1.e-6)
THEN 661 area_ls_prcd = (area_ls_prcd*tot_prec_ls-area_ls_prc*&
662 & tot_prec_lsd)/tot_prec_ls**2
663 area_ls_prc = area_ls_prc/tot_prec_ls
666 area_ls_prcd = ls_beta*area_ls_prcd
667 area_ls_prc = ls_beta*area_ls_prc
668 area_upd_prcd = cnv_beta*area_upd_prcd
669 area_upd_prc = cnv_beta*area_upd_prc
670 area_anv_prcd = anv_beta*area_anv_prcd
671 area_anv_prc = anv_beta*area_anv_prc
674 CALL cons_alhx_d(t(i, j, k), td(i, j, k), alhx3, alhx3d, &
675 & t_ice_max, t_ice_all, cons_alhs, cons_alhl)
677 & , j, k), qsd(i, j, k), aa, aad, bb, bbd, &
678 & cons_h2omw, cons_airmw, cons_rvap, alhx3, alhx3d&
681 qlt_tmpd = ql_lsd(i, j, k) + ql_cond(i, j, k)
682 qlt_tmp = ql_ls(i, j, k) + ql_con(i, j, k)
683 qit_tmpd = qi_lsd(i, j, k) + qi_cond(i, j, k)
684 qit_tmp = qi_ls(i, j, k) + qi_con(i, j, k)
685 prn_above_cu_oldd = prn_above_cu_newd
686 prn_above_cu_old = prn_above_cu_new
687 psn_above_cu_oldd = psn_above_cu_newd
688 psn_above_cu_old = psn_above_cu_new
689 evap_dd_cu_above_oldd = evap_dd_cu_above_newd
690 evap_dd_cu_above_old = evap_dd_cu_above_new
691 subl_dd_cu_above_oldd = subl_dd_cu_above_newd
692 subl_dd_cu_above_old = subl_dd_cu_above_new
695 & qrn_cu_1d, qrn_cu_1dd, qsn_cu, qsn_cud, qlt_tmp, &
696 & qlt_tmpd, qit_tmp, t(i, j, k), td(i, j, k), q(i, &
697 & j, k), qd(i, j, k), mass(i, j, k), imass(i, j, k)&
698 & , ph(i, j, k), dzet(i, j, k), dzetd(i, j, k), &
699 & qddf3(i, j, k), qddf3d(i, j, k), aa, aad, bb, bbd&
700 & , area_upd_prc1, area_upd_prc1d, prn_above_cu_old&
701 & , prn_above_cu_oldd, prn_above_cu_new, &
702 & prn_above_cu_newd, psn_above_cu_old, &
703 & psn_above_cu_oldd, psn_above_cu_new, &
704 & psn_above_cu_newd, evap_dd_cu_above_old, &
705 & evap_dd_cu_above_oldd, evap_dd_cu_above_new, &
706 & evap_dd_cu_above_newd, subl_dd_cu_above_old, &
707 & subl_dd_cu_above_oldd, subl_dd_cu_above_new, &
708 & subl_dd_cu_above_newd, cnvenvfc, cnvddrfc, &
709 & cons_alhf, cons_alhs, cons_alhl, cons_cp, &
710 & cons_tice, cons_h2omw, cons_airmw, revap_off_p, &
711 & c_acc, c_ev_r, c_ev_s, rho_w, estblx)
712 prn_above_an_oldd = prn_above_an_newd
713 prn_above_an_old = prn_above_an_new
714 psn_above_an_oldd = psn_above_an_newd
715 psn_above_an_old = psn_above_an_new
716 evap_dd_an_above_oldd = evap_dd_an_above_newd
717 evap_dd_an_above_old = evap_dd_an_above_new
718 subl_dd_an_above_oldd = subl_dd_an_above_newd
719 subl_dd_an_above_old = subl_dd_an_above_new
723 & qrn_an, qrn_and, qsn_an, qsn_and, qlt_tmp, &
724 & qlt_tmpd, qit_tmp, t(i, j, k), td(i, j, k), q(i, &
725 & j, k), qd(i, j, k), mass(i, j, k), imass(i, j, k)&
726 & , ph(i, j, k), dzet(i, j, k), dzetd(i, j, k), &
727 & qddf3(i, j, k), qddf3d(i, j, k), aa, aad, bb, bbd&
728 & , area_anv_prc1, area_anv_prc1d, prn_above_an_old&
729 & , prn_above_an_oldd, prn_above_an_new, &
730 & prn_above_an_newd, psn_above_an_old, &
731 & psn_above_an_oldd, psn_above_an_new, &
732 & psn_above_an_newd, evap_dd_an_above_old, &
733 & evap_dd_an_above_oldd, evap_dd_an_above_new, &
734 & evap_dd_an_above_newd, subl_dd_an_above_old, &
735 & subl_dd_an_above_oldd, subl_dd_an_above_new, &
736 & subl_dd_an_above_newd, anvenvfc, anvddrfc, &
737 & cons_alhf, cons_alhs, cons_alhl, cons_cp, &
738 & cons_tice, cons_h2omw, cons_airmw, revap_off_p, &
739 & c_acc, c_ev_r, c_ev_s, rho_w, estblx)
740 prn_above_ls_oldd = prn_above_ls_newd
741 prn_above_ls_old = prn_above_ls_new
742 psn_above_ls_oldd = psn_above_ls_newd
743 psn_above_ls_old = psn_above_ls_new
744 evap_dd_ls_above_oldd = evap_dd_ls_above_newd
745 evap_dd_ls_above_old = evap_dd_ls_above_new
746 subl_dd_ls_above_oldd = subl_dd_ls_above_newd
747 subl_dd_ls_above_old = subl_dd_ls_above_new
751 & qrn_ls, qrn_lsd, qsn_ls, qsn_lsd, qlt_tmp, &
752 & qlt_tmpd, qit_tmp, t(i, j, k), td(i, j, k), q(i, &
753 & j, k), qd(i, j, k), mass(i, j, k), imass(i, j, k)&
754 & , ph(i, j, k), dzet(i, j, k), dzetd(i, j, k), &
755 & qddf3(i, j, k), qddf3d(i, j, k), aa, aad, bb, bbd&
756 & , area_ls_prc1, area_ls_prc1d, prn_above_ls_old, &
757 & prn_above_ls_oldd, prn_above_ls_new, &
758 & prn_above_ls_newd, psn_above_ls_old, &
759 & psn_above_ls_oldd, psn_above_ls_new, &
760 & psn_above_ls_newd, evap_dd_ls_above_old, &
761 & evap_dd_ls_above_oldd, evap_dd_ls_above_new, &
762 & evap_dd_ls_above_newd, subl_dd_ls_above_old, &
763 & subl_dd_ls_above_oldd, subl_dd_ls_above_new, &
764 & subl_dd_ls_above_newd, lsenvfc, lsddrfc, &
765 & cons_alhf, cons_alhs, cons_alhl, cons_cp, &
766 & cons_tice, cons_h2omw, cons_airmw, revap_off_p, &
767 & c_acc, c_ev_r, c_ev_s, rho_w, estblx)
768 IF (ql_ls(i, j, k) + ql_con(i, j, k) .GT. 0.00)
THEN 769 qt_tmpi_1d = -((ql_lsd(i, j, k)+ql_cond(i, j, k))/(ql_ls(i, j&
770 & , k)+ql_con(i, j, k))**2)
771 qt_tmpi_1 = 1./(ql_ls(i, j, k)+ql_con(i, j, k))
776 ql_lsd(i, j, k) = ql_lsd(i, j, k)*qlt_tmp*qt_tmpi_1 + ql_ls(i, j&
777 & , k)*(qlt_tmpd*qt_tmpi_1+qlt_tmp*qt_tmpi_1d)
778 ql_ls(i, j, k) = ql_ls(i, j, k)*qlt_tmp*qt_tmpi_1
779 ql_cond(i, j, k) = ql_cond(i, j, k)*qlt_tmp*qt_tmpi_1 + ql_con(i&
780 & , j, k)*(qlt_tmpd*qt_tmpi_1+qlt_tmp*qt_tmpi_1d)
781 ql_con(i, j, k) = ql_con(i, j, k)*qlt_tmp*qt_tmpi_1
782 IF (qi_ls(i, j, k) + qi_con(i, j, k) .GT. 0.00)
THEN 783 qt_tmpi_2d = -((qi_lsd(i, j, k)+qi_cond(i, j, k))/(qi_ls(i, j&
784 & , k)+qi_con(i, j, k))**2)
785 qt_tmpi_2 = 1./(qi_ls(i, j, k)+qi_con(i, j, k))
790 qi_lsd(i, j, k) = qi_lsd(i, j, k)*qit_tmp*qt_tmpi_2 + qi_ls(i, j&
791 & , k)*(qit_tmpd*qt_tmpi_2+qit_tmp*qt_tmpi_2d)
792 qi_ls(i, j, k) = qi_ls(i, j, k)*qit_tmp*qt_tmpi_2
793 qi_cond(i, j, k) = qi_cond(i, j, k)*qit_tmp*qt_tmpi_2 + qi_con(i&
794 & , j, k)*(qit_tmpd*qt_tmpi_2+qit_tmp*qt_tmpi_2d)
795 qi_con(i, j, k) = qi_con(i, j, k)*qit_tmp*qt_tmpi_2
798 if (do_moist_physics == 1)
then 802 elseif (do_moist_physics == 2)
then 810 qi_lsd(i,j,k) = sinkfilt_qi * qi_lsd(i,j,k) + (1.0-sinkfilt_qi) * qi_ls_p_presink
811 qi_cond(i,j,k) = sinkfilt_qi * qi_cond(i,j,k) + (1.0-sinkfilt_qi) * qi_con_p_presink
812 qd(i,j,k) = sinkfilt_qi * qd(i,j,k) + (1.0-sinkfilt_qi) * q_p_presink
816 if ( abs(k-62) .le. 2)
then 817 ql_lsd(i,j,k) = sinkfilt_ql * ql_lsd(i,j,k) + (1.0-sinkfilt_ql) * ql_ls_p_presink
818 ql_cond(i,j,k) = sinkfilt_ql * ql_cond(i,j,k) + (1.0-sinkfilt_ql) * ql_con_p_presink
825 td(i,j,k) = totfilt_t * td(i,j,k) + (1.0-totfilt_t) * t_p_preall
827 if (do_moist_physics == 1)
then 830 elseif (do_moist_physics == 2)
then 835 ql_lsd(i,j,k) = totfilt_ql * ql_lsd(i,j,k) + (1.0-totfilt_ql) * ql_ls_p_preall
836 ql_cond(i,j,k) = totfilt_ql * ql_cond(i,j,k) + (1.0-totfilt_ql) * ql_con_p_preall
838 qi_lsd(i,j,k) = totfilt_qi * qi_lsd(i,j,k) + (1.0-totfilt_qi) * qi_ls_p_preall
839 qi_cond(i,j,k) = totfilt_qi * qi_cond(i,j,k) + (1.0-totfilt_qi) * qi_con_p_preall
846 CALL dqsat_bac_d(dqsdt, dqsdtd, qs, qsd, t, td, ph, im, jm, lm, estblx&
847 & , cons_h2omw, cons_airmw)
849 WHERE (q .GT. rhexcess*qs)
850 dqsd = ((qd-rhexcess*qsd)*(1.0+rhexcess*dqsdt*cons_alhl/cons_cp)-(q-&
851 & rhexcess*qs)*rhexcess*cons_alhl*dqsdtd/cons_cp)/(1.0+rhexcess*&
852 & dqsdt*cons_alhl/cons_cp)**2
853 dqs = (q-rhexcess*qs)/(1.0+rhexcess*dqsdt*cons_alhl/cons_cp)
860 td = td + cons_alhl*dqsd/cons_cp
861 t = t + cons_alhl/cons_cp*dqs
866 tpwd = sum(dm(i, j, :)*qd(i, j, :))
867 tpw = sum(q(i, j, :)*dm(i, j, :))
871 IF (q(i, j, l) .LT. 0.0)
THEN 872 negtpwd = negtpwd + dm(i, j, l)*qd(i, j, l)
873 negtpw = negtpw + q(i, j, l)*dm(i, j, l)
879 IF (q(i, j, l) .GE. 0.0)
THEN 880 qd(i, j, l) = qd(i, j, l)*(1.0+negtpw/(tpw-negtpw)) + q(i, j, &
881 & l)*(negtpwd*(tpw-negtpw)-negtpw*(tpwd-negtpwd))/(tpw-negtpw)&
883 q(i, j, l) = q(i, j, l)*(1.0+negtpw/(tpw-negtpw))
897 SUBROUTINE cloud_tidy_d(qv, qvd, te, ted, qlc, qlcd, qic, qicd, cf, cfd&
898 & , qla, qlad, qia, qiad, af, afd, cons_alhl, cons_alhs, cons_cp)
900 REAL*8,
INTENT(INOUT) :: te, qv, qlc, cf, qla, af, qic, qia
901 REAL*8,
INTENT(INOUT) :: ted, qvd, qlcd, cfd, qlad, afd, qicd, qiad
902 REAL*8,
INTENT(IN) :: cons_alhl, cons_alhs, cons_cp
904 IF (af .LT. 1.e-5)
THEN 905 qvd = qvd + qlad + qiad
907 ted = ted - cons_alhl*qlad/cons_cp - cons_alhs*qiad/cons_cp
908 te = te - cons_alhl/cons_cp*qla - cons_alhs/cons_cp*qia
925 IF (qlc .LT. 1.e-8)
THEN 928 ted = ted - cons_alhl*qlcd/cons_cp
929 te = te - cons_alhl/cons_cp*qlc
934 IF (qic .LT. 1.e-8)
THEN 937 ted = ted - cons_alhs*qicd/cons_cp
938 te = te - cons_alhs/cons_cp*qic
943 IF (qla .LT. 1.e-8)
THEN 946 ted = ted - cons_alhl*qlad/cons_cp
947 te = te - cons_alhl/cons_cp*qla
952 IF (qia .LT. 1.e-8)
THEN 955 ted = ted - cons_alhs*qiad/cons_cp
956 te = te - cons_alhs/cons_cp*qia
961 IF (qla + qia .LT. 1.e-8)
THEN 962 qvd = qvd + qlad + qiad
964 ted = ted - cons_alhl*qlad/cons_cp - cons_alhs*qiad/cons_cp
965 te = te - cons_alhl/cons_cp*qla - cons_alhs/cons_cp*qia
974 IF (qlc + qic .LT. 1.e-8)
THEN 975 qvd = qvd + qlcd + qicd
977 ted = ted - cons_alhl*qlcd/cons_cp - cons_alhs*qicd/cons_cp
978 te = te - cons_alhl/cons_cp*qlc - cons_alhs/cons_cp*qic
991 SUBROUTINE meltfreeze_d(dt, te, ted, ql, qld, qi, qid, t_ice_all, &
992 & t_ice_max, icefrpwr, cons_alhl, cons_alhs, cons_cp)
995 REAL*8,
INTENT(IN) :: dt, t_ice_all, t_ice_max
996 INTEGER,
INTENT(IN) :: icefrpwr
997 REAL*8,
INTENT(IN) :: cons_alhl, cons_alhs, cons_cp
999 REAL*8,
INTENT(INOUT) :: te, ql, qi
1000 REAL*8,
INTENT(INOUT) :: ted, qld, qid
1003 REAL*8 :: fqid, dqild
1004 REAL*8,
PARAMETER :: taufrz=1000.
1015 IF (te .LE. t_ice_max)
THEN 1016 arg1d = -(dt*fqid/taufrz)
1017 arg1 = -(dt*fqi/taufrz)
1018 dqild = qld*(1.0-exp(arg1)) - ql*arg1d*exp(arg1)
1019 dqil = ql*(1.0-exp(arg1))
1023 IF (0. .LT. dqil)
THEN 1033 ted = ted + (cons_alhs-cons_alhl)*dqild/cons_cp
1034 te = te + (cons_alhs-cons_alhl)*dqil/cons_cp
1037 IF (te .GT. t_ice_max)
THEN 1043 IF (0. .GT. dqil)
THEN 1053 ted = ted + (cons_alhs-cons_alhl)*dqild/cons_cp
1054 te = te + (cons_alhs-cons_alhl)*dqil/cons_cp
1060 SUBROUTINE convec_src_d(dt, mass, imass, te, ted, qv, qvd, dcf, dcfd, &
1061 & dmf, dmfd, qla, qlad, qia, qiad, af, afd, qs, qsd, cons_alhs, &
1062 & cons_alhl, cons_cp, t_ice_all, t_ice_max, icefrpwr)
1065 REAL*8,
INTENT(IN) :: dt, t_ice_all, t_ice_max
1066 INTEGER,
INTENT(IN) :: icefrpwr
1067 REAL*8,
INTENT(IN) :: mass, imass, qs
1068 REAL*8,
INTENT(IN) :: qsd
1069 REAL*8,
INTENT(IN) :: dmf, dcf
1070 REAL*8,
INTENT(IN) :: dmfd, dcfd
1071 REAL*8,
INTENT(IN) :: cons_alhs, cons_alhl, cons_cp
1073 REAL*8,
INTENT(INOUT) :: te, qv
1074 REAL*8,
INTENT(INOUT) :: ted, qvd
1075 REAL*8,
INTENT(INOUT) :: qla, qia, af
1076 REAL*8,
INTENT(INOUT) :: qlad, qiad, afd
1079 REAL*8,
PARAMETER :: minrhx=0.001
1080 REAL*8 :: tend, qvx, fqi
1081 REAL*8 :: tendd, fqid
1104 qlad = qlad + dt*((1.0-fqi)*tendd-fqid*tend)
1105 qla = qla + (1.0-fqi)*tend*dt
1106 qiad = qiad + dt*(fqid*tend+fqi*tendd)
1107 qia = qia + fqi*tend*dt
1109 ted = ted + (cons_alhs-cons_alhl)*dt*(fqid*tend+fqi*tendd)/cons_cp
1110 te = te + (cons_alhs-cons_alhl)*fqi*tend*dt/cons_cp
1114 afd = afd + dt*tendd
1116 IF (af .GT. 0.99)
THEN 1124 IF (af .LT. 1.0)
THEN 1125 qvx = (qv-qs*af)/(1.-af)
1130 IF (qvx - minrhx*qs .LT. 0.0 .AND. af .GT. 0.)
THEN 1131 afd = ((qvd-minrhx*qsd)*qs*(1.0-minrhx)-(qv-minrhx*qs)*(1.0-minrhx)*&
1132 & qsd)/(qs*(1.0-minrhx))**2
1133 af = (qv-minrhx*qs)/(qs*(1.0-minrhx))
1135 IF (af .LT. 0.)
THEN 1138 qvd = qvd + qlad + qiad
1140 ted = ted - (cons_alhl*qlad+cons_alhs*qiad)/cons_cp
1141 te = te - (cons_alhl*qla+cons_alhs*qia)/cons_cp
1153 SUBROUTINE ls_cloud_d(dt, alpha, pdfshape, pl, te, ted, qv, qvd, qcl, &
1154 & qcld, qal, qald, qci, qcid, qai, qaid, cf, cfd, af, afd, cons_alhl, &
1155 & cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw, t_ice_all, &
1156 & t_ice_max, icefrpwr, estblx, cloud_pertmod, dmp)
1159 REAL*8,
INTENT(IN) :: dt, alpha, pl, t_ice_all, t_ice_max
1160 INTEGER,
INTENT(IN) :: pdfshape, cloud_pertmod, dmp
1161 INTEGER,
INTENT(IN) :: icefrpwr
1162 REAL*8,
INTENT(IN) :: cons_alhl, cons_alhf, cons_alhs, cons_cp, &
1163 & cons_h2omw, cons_airmw
1164 REAL*8,
INTENT(IN) :: estblx(:)
1166 REAL*8,
INTENT(INOUT) :: te, qv, qcl, qci, qal, qai, cf, af
1167 REAL*8,
INTENT(INOUT) :: ted, qvd, qcld, qcid, qald, qaid, cfd, afd
1170 REAL*8 :: qco, cfo, qao, qt, qmx, qmn, dq
1171 REAL*8 :: qcod, cfod, qaod, qtd
1172 REAL*8 :: teo, qsx, dqsx, qs, dqs, tmparr
1173 REAL*8 :: teod, qsxd, dqsxd, dqsd, tmparrd
1174 REAL*8 :: qcx, qvx, cfx, qax, qc, qa, fqi, fqi_a, dqai, dqal, dqci, &
1176 REAL*8 :: qcxd, qvxd, cfxd, qaxd, qcd, qad, fqid, dqaid, dqald, dqcid&
1178 REAL*8 :: ten, qsp, cfp, qvp, qcp
1179 REAL*8 :: tend, qcpd
1180 REAL*8 :: tep, qsn, cfn, qvn, qcn
1181 REAL*8 :: tepd, qsnd, cfnd, qcnd
1182 REAL*8 :: alhx, sigmaqt1, sigmaqt2
1183 REAL*8 :: alhxd, sigmaqt1d, sigmaqt2d
1184 REAL*8,
DIMENSION(1) :: dqsx1, qsx1, teo1, pl1
1202 IF (qa .GT. 0.0)
THEN 1209 CALL dqsats_bac_d(dqsx, dqsxd, qsx, qsxd, teo, teod, pl, estblx, &
1210 & cons_h2omw, cons_airmw)
1211 IF (af .LT. 1.0)
THEN 1212 IF (dmp .EQ. 1)
THEN 1213 IF (1. - af .GT. 0.02)
THEN 1214 tmparrd = -((-afd)/(1.-af)**2)
1217 tmparrd = -((-afd)/(0.02)**2)
1220 ELSE IF (dmp .EQ. 2)
THEN 1221 tmparrd = -((-afd)/(1.-af)**2)
1230 cfxd = cfd*tmparr + cf*tmparrd
1232 qcxd = qcd*tmparr + qc*tmparrd
1234 qvxd = (qvd-qsxd*af-qsx*afd)*tmparr + (qv-qsx*af)*tmparrd
1235 qvx = (qv-qsx*af)*tmparr
1236 IF (af .GE. 1.0)
THEN 1240 IF (af .GT. 0.)
THEN 1241 qaxd = (qad*af-qa*afd)/af**2
1277 sigmaqt1d = alpha*qsnd
1278 sigmaqt1 = alpha*qsn
1279 sigmaqt2d = alpha*qsnd
1280 sigmaqt2 = alpha*qsn
1281 IF (pdfshape .EQ. 2)
THEN 1284 sigmaqt1d = alpha*qsnd
1285 sigmaqt1 = alpha*qsn
1286 sigmaqt2d = alpha*qsnd
1287 sigmaqt2 = alpha*qsn
1290 IF (cloud_pertmod .EQ. 0)
THEN 1291 CALL pdffrac_d(1, qt, qtd, sigmaqt1, sigmaqt1d, sigmaqt2, sigmaqt2d&
1292 & , qsn, qsnd, cfn, cfnd)
1293 ELSE IF (cloud_pertmod .EQ. 1)
THEN 1294 CALL pdffrac_d(4, qt, qtd, sigmaqt1, sigmaqt1d, sigmaqt2, sigmaqt2d&
1295 & , qsn, qsnd, cfn, cfnd)
1298 CALL pdfcondensate_d(pdfshape, qt, qtd, sigmaqt1, sigmaqt1d, sigmaqt2&
1299 & , sigmaqt2d, qsn, qsnd, qcn, qcnd)
1302 IF (af .GT. 0.)
THEN 1310 alhxd = cons_alhs*fqid - cons_alhl*fqid
1311 alhx = (1.0-fqi)*cons_alhl + fqi*cons_alhs
1312 IF (pdfshape .EQ. 1)
THEN 1313 qcnd = qcpd + ((qcnd-qcpd)*(1.-(cfn*(alpha-1.)-qcn/qsn)*dqs*alhx/&
1314 & cons_cp)+(qcn-qcp)*(((alpha-1.)*cfnd-(qcnd*qsn-qcn*qsnd)/qsn**2)*&
1315 & dqs*alhx+(cfn*(alpha-1.)-qcn/qsn)*(dqsd*alhx+dqs*alhxd))/cons_cp)/&
1316 & (1.-(cfn*(alpha-1.)-qcn/qsn)*dqs*alhx/cons_cp)**2
1317 qcn = qcp + (qcn-qcp)/(1.-(cfn*(alpha-1.)-qcn/qsn)*dqs*alhx/cons_cp)
1318 ELSE IF (pdfshape .EQ. 2)
THEN 1322 qcnd = qcpd + 0.5*(qcnd-qcpd)
1323 qcn = qcp + (qcn-qcp)*0.5
1326 qvn = qvp - (qcn-qcp)
1327 ten = tep + (1.0-fqi)*(cons_alhl/cons_cp)*((qcn-qcp)*(1.-af)+(qao-qax)&
1328 & *af) + fqi*(cons_alhs/cons_cp)*((qcn-qcp)*(1.-af)+(qao-qax)*af)
1337 IF (af .LT. 1.0)
THEN 1338 cfd = cfod*(1.-af) - cfo*afd
1340 qcod = qcod*(1.-af) - qco*afd
1342 qaod = qaod*af + qao*afd
1357 IF (qt - qsx .LT. 0.)
THEN 1373 dqcld = (1.0-fqi)*qcxd - fqid*qcx
1374 dqcl = (1.0-fqi)*qcx
1375 dqcid = fqid*qcx + fqi*qcxd
1378 IF (qcl + dqcl .LT. 0.)
THEN 1379 dqcid = dqcid + qcld + dqcld
1380 dqci = dqci + (qcl+dqcl)
1385 IF (qci + dqci .LT. 0.)
THEN 1386 dqcld = dqcld + qcid + dqcid
1387 dqcl = dqcl + (qci+dqci)
1400 IF (qal + dqal .LT. 0.)
THEN 1401 dqaid = qald + dqald
1402 dqai = dqai + (qal+dqal)
1408 IF (qai + dqai .LT. 0.)
THEN 1409 dqald = dqald + qaid + dqaid
1410 dqal = dqal + (qai+dqai)
1415 IF (af .LT. 1.e-5)
THEN 1421 IF (cf .LT. 1.e-5)
THEN 1436 qvd = qvd - dqaid - dqcid - dqald - dqcld
1437 qv = qv - (dqai+dqci+dqal+dqcl)
1439 ted = ted + (cons_alhl*(dqaid+dqcid+dqald+dqcld)+cons_alhf*(dqaid+&
1441 te = te + (cons_alhl*(dqai+dqci+dqal+dqcl)+cons_alhf*(dqai+dqci))/&
1445 IF (qao .LE. 0.)
THEN 1446 qvd = qvd + qaid + qald
1448 ted = ted - cons_alhs*qaid/cons_cp - cons_alhl*qald/cons_cp
1449 te = te - cons_alhs/cons_cp*qai - cons_alhl/cons_cp*qal
1463 SUBROUTINE pdffrac_d(flag, qtmean, qtmeand, sigmaqt1, sigmaqt1d, &
1464 & sigmaqt2, sigmaqt2d, qstar, qstard, clfrac, clfracd)
1469 INTEGER,
INTENT(IN) :: flag
1470 REAL*8,
INTENT(IN) :: qtmean, sigmaqt1, sigmaqt2, qstar
1471 REAL*8,
INTENT(IN) :: qtmeand, sigmaqt1d, sigmaqt2d, qstard
1473 REAL*8,
INTENT(INOUT) :: clfrac
1474 REAL*8,
INTENT(INOUT) :: clfracd
1476 REAL*8 :: qtmode, qtmin, qtmax
1477 REAL*8 :: qtmoded, qtmind, qtmaxd
1478 REAL*8 :: rh, rhd, q1, q2
1484 IF (flag .EQ. 1)
THEN 1486 IF (qtmean + sigmaqt1 .LT. qstar)
THEN 1489 ELSE IF (sigmaqt1 .GT. 0.)
THEN 1490 IF (qtmean + sigmaqt1 - qstar .GT. 2.*sigmaqt1)
THEN 1491 min1d = 2.*sigmaqt1d
1494 min1d = qtmeand + sigmaqt1d - qstard
1495 min1 = qtmean + sigmaqt1 - qstar
1497 clfracd = (min1d*2.*sigmaqt1-min1*2.*sigmaqt1d)/(2.*sigmaqt1)**2
1498 clfrac = min1/(2.*sigmaqt1)
1503 ELSE IF (flag .EQ. 2)
THEN 1505 qtmoded = qtmeand + (sigmaqt1d-sigmaqt2d)/3.
1506 qtmode = qtmean + (sigmaqt1-sigmaqt2)/3.
1507 IF (qtmode - sigmaqt1 .GT. 0.)
THEN 1511 qtmind = qtmoded - sigmaqt1d
1512 qtmin = qtmode - sigmaqt1
1514 qtmaxd = qtmoded + sigmaqt2d
1515 qtmax = qtmode + sigmaqt2
1516 IF (qtmax .LT. qstar)
THEN 1519 ELSE IF (qtmode .LE. qstar .AND. qstar .LT. qtmax)
THEN 1520 clfracd = (((qtmaxd-qstard)*(qtmax-qstar)+(qtmax-qstar)*(qtmaxd-&
1521 & qstard))*(qtmax-qtmin)*(qtmax-qtmode)-(qtmax-qstar)**2*((qtmaxd-&
1522 & qtmind)*(qtmax-qtmode)+(qtmax-qtmin)*(qtmaxd-qtmoded)))/((qtmax-&
1523 & qtmin)*(qtmax-qtmode))**2
1524 clfrac = (qtmax-qstar)*(qtmax-qstar)/((qtmax-qtmin)*(qtmax-qtmode)&
1526 ELSE IF (qtmin .LE. qstar .AND. qstar .LT. qtmode)
THEN 1527 clfracd = -((((qstard-qtmind)*(qstar-qtmin)+(qstar-qtmin)*(qstard-&
1528 & qtmind))*(qtmax-qtmin)*(qtmode-qtmin)-(qstar-qtmin)**2*((qtmaxd-&
1529 & qtmind)*(qtmode-qtmin)+(qtmax-qtmin)*(qtmoded-qtmind)))/((qtmax-&
1530 & qtmin)*(qtmode-qtmin))**2)
1531 clfrac = 1. - (qstar-qtmin)*(qstar-qtmin)/((qtmax-qtmin)*(qtmode-&
1533 ELSE IF (qstar .LE. qtmin)
THEN 1537 ELSE IF (flag .EQ. 3)
THEN 1540 IF (qtmean + sigmaqt1 .LT. qstar)
THEN 1542 ELSE IF (sigmaqt1 .GT. 0.)
THEN 1543 IF (qtmean + sigmaqt1 - qstar .GT. 2.*sigmaqt1)
THEN 1544 min1d = 2.*sigmaqt1d
1547 min1d = qtmeand + sigmaqt1d - qstard
1548 min1 = qtmean + sigmaqt1 - qstar
1550 clfrac = min1/(2.*sigmaqt1)
1556 rhd0 = (qtmeand*qstar-qtmean*qstard)/qstar**2
1559 clfracd = 0.5*q1*rhd0*(1.0-tanh(q1*(rh-1.0))**2)
1562 clfracd = (0.66*( cosh(10*(rh-1.0))**-2)) * clfracd
1564 ELSE IF (flag .EQ. 4)
THEN 1567 IF (qtmean + sigmaqt1 .LT. qstar)
THEN 1569 ELSE IF (sigmaqt1 .GT. 0.)
THEN 1570 IF (qtmean + sigmaqt1 - qstar .GT. 2.*sigmaqt1)
THEN 1571 min1d = 2.*sigmaqt1d
1574 min1d = qtmeand + sigmaqt1d - qstard
1575 min1 = qtmean + sigmaqt1 - qstar
1577 clfrac = min1/(2.*sigmaqt1)
1583 rhd0 = (qtmeand*qstar-qtmean*qstard)/qstar**2
1587 IF (rh .LT. q1)
THEN 1589 ELSE IF (rh .GE. q1 .AND. rh .LT. q2)
THEN 1590 clfracd = rhd0/((q2/q1-1)*q1)
1596 clfracd = clfracd * 0.2
1606 & sigmaqt14d, sigmaqt24, sigmaqt24d, qstar4, qstar4d, condensate4, &
1610 INTEGER,
INTENT(IN) :: flag
1611 REAL*8,
INTENT(IN) :: qtmean4, sigmaqt14, sigmaqt24, qstar4
1612 REAL*8,
INTENT(IN) :: qtmean4d, sigmaqt14d, sigmaqt24d, qstar4d
1614 REAL*8,
INTENT(INOUT) :: condensate4
1615 REAL*8,
INTENT(INOUT) :: condensate4d
1617 REAL*8 :: qtmode, qtmin, qtmax, consta, constb, cloudf
1618 REAL*8 :: qtmoded, qtmind, qtmaxd, constad, constbd, cloudfd
1619 REAL*8 :: term1, term2, term3
1620 REAL*8 :: term1d, term2d, term3d
1621 REAL*8 :: qtmean, sigmaqt1, sigmaqt2, qstar, condensate
1622 REAL*8 :: qtmeand, sigmaqt1d, sigmaqt2d, qstard, condensated
1628 sigmaqt1d = sigmaqt14d
1629 sigmaqt1 = sigmaqt14
1630 sigmaqt2d = sigmaqt24d
1631 sigmaqt2 = sigmaqt24
1634 IF (flag .EQ. 1)
THEN 1635 IF (qtmean + sigmaqt1 .LT. qstar)
THEN 1638 ELSE IF (qstar .GT. qtmean - sigmaqt1)
THEN 1639 IF (sigmaqt1 .GT. 0.d0)
THEN 1640 IF (qtmean + sigmaqt1 - qstar .GT. 2.d0*sigmaqt1)
THEN 1641 min1d = 2.d0*sigmaqt1d
1642 min1 = 2.d0*sigmaqt1
1644 min1d = qtmeand + sigmaqt1d - qstard
1645 min1 = qtmean + sigmaqt1 - qstar
1647 condensated = (2*min1*min1d*4.d0*sigmaqt1-min1**2*4.d0*sigmaqt1d&
1648 & )/(4.d0*sigmaqt1)**2
1649 condensate = min1**2/(4.d0*sigmaqt1)
1651 condensated = qtmeand - qstard
1652 condensate = qtmean - qstar
1655 condensated = qtmeand - qstard
1656 condensate = qtmean - qstar
1658 ELSE IF (flag .EQ. 2)
THEN 1659 qtmoded = qtmeand + (sigmaqt1d-sigmaqt2d)/3.d0
1660 qtmode = qtmean + (sigmaqt1-sigmaqt2)/3.d0
1661 IF (qtmode - sigmaqt1 .GT. 0.d0)
THEN 1665 qtmind = qtmoded - sigmaqt1d
1666 qtmin = qtmode - sigmaqt1
1668 qtmaxd = qtmoded + sigmaqt2d
1669 qtmax = qtmode + sigmaqt2
1670 IF (qtmax .LT. qstar)
THEN 1673 ELSE IF (qtmode .LE. qstar .AND. qstar .LT. qtmax)
THEN 1674 constbd = -(2.d0*((qtmaxd-qtmind)*(qtmax-qtmode)+(qtmax-qtmin)*(&
1675 & qtmaxd-qtmoded))/((qtmax-qtmin)*(qtmax-qtmode))**2)
1676 constb = 2.d0/((qtmax-qtmin)*(qtmax-qtmode))
1677 cloudfd = (((qtmaxd-qstard)*(qtmax-qstar)+(qtmax-qstar)*(qtmaxd-&
1678 & qstard))*(qtmax-qtmin)*(qtmax-qtmode)-(qtmax-qstar)**2*((qtmaxd-&
1679 & qtmind)*(qtmax-qtmode)+(qtmax-qtmin)*(qtmaxd-qtmoded)))/((qtmax-&
1680 & qtmin)*(qtmax-qtmode))**2
1681 cloudf = (qtmax-qstar)*(qtmax-qstar)/((qtmax-qtmin)*(qtmax-qtmode)&
1683 term1d = ((qstard*qstar+qstar*qstard)*qstar+qstar**2*qstard)/3.d0
1684 term1 = qstar*qstar*qstar/3.d0
1685 term2d = ((qtmaxd*qstar+qtmax*qstard)*qstar+qtmax*qstar*qstard)/&
1687 term2 = qtmax*qstar*qstar/2.d0
1688 term3d = ((qtmaxd*qtmax+qtmax*qtmaxd)*qtmax+qtmax**2*qtmaxd)/6.d0
1689 term3 = qtmax*qtmax*qtmax/6.d0
1690 condensated = constbd*(term1-term2+term3) + constb*(term1d-term2d+&
1691 & term3d) - qstard*cloudf - qstar*cloudfd
1692 condensate = constb*(term1-term2+term3) - qstar*cloudf
1693 ELSE IF (qtmin .LE. qstar .AND. qstar .LT. qtmode)
THEN 1694 constad = -(2.d0*((qtmaxd-qtmind)*(qtmode-qtmin)+(qtmax-qtmin)*(&
1695 & qtmoded-qtmind))/((qtmax-qtmin)*(qtmode-qtmin))**2)
1696 consta = 2.d0/((qtmax-qtmin)*(qtmode-qtmin))
1697 cloudfd = -((((qstard-qtmind)*(qstar-qtmin)+(qstar-qtmin)*(qstard-&
1698 & qtmind))*(qtmax-qtmin)*(qtmode-qtmin)-(qstar-qtmin)**2*((qtmaxd-&
1699 & qtmind)*(qtmode-qtmin)+(qtmax-qtmin)*(qtmoded-qtmind)))/((qtmax-&
1700 & qtmin)*(qtmode-qtmin))**2)
1701 cloudf = 1.d0 - (qstar-qtmin)*(qstar-qtmin)/((qtmax-qtmin)*(qtmode&
1703 term1d = ((qstard*qstar+qstar*qstard)*qstar+qstar**2*qstard)/3.d0
1704 term1 = qstar*qstar*qstar/3.d0
1705 term2d = ((qtmind*qstar+qtmin*qstard)*qstar+qtmin*qstar*qstard)/&
1707 term2 = qtmin*qstar*qstar/2.d0
1708 term3d = ((qtmind*qtmin+qtmin*qtmind)*qtmin+qtmin**2*qtmind)/6.d0
1709 term3 = qtmin*qtmin*qtmin/6.d0
1710 condensated = qtmeand - constad*(term1-term2+term3) - consta*(&
1711 & term1d-term2d+term3d) - qstard*cloudf - qstar*cloudfd
1712 condensate = qtmean - consta*(term1-term2+term3) - qstar*cloudf
1713 ELSE IF (qstar .LE. qtmin)
THEN 1714 condensated = qtmeand - qstard
1715 condensate = qtmean - qstar
1719 ELSE IF (flag .EQ. 3)
THEN 1738 IF (qtmean - qstar .GT. -0.5e-3)
THEN 1739 condensated = qtmeand - qstard
1740 condensate = qtmean - qstar
1748 condensate4d = condensated
1749 condensate4 = condensate
1755 SUBROUTINE evap_cnv_d(dt, rhcr, pl, te, ted, qv, qvd, ql, qld, qi, qid, &
1756 & f, fd, xf, qs, qsd, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, &
1757 & cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp)
1760 REAL*8,
INTENT(IN) :: dt, rhcr, pl, xf, qs, rho_w, cld_evp_eff
1761 REAL*8,
INTENT(IN) :: qsd
1762 REAL*8,
INTENT(IN) :: cons_h2omw, cons_airmw, cons_alhl, cons_rvap, &
1763 & cons_rgas, cons_pi, cons_cp
1765 REAL*8,
INTENT(INOUT) :: te, qv, ql, qi, f
1766 REAL*8,
INTENT(INOUT) :: ted, qvd, qld, qid, fd
1768 REAL*8 :: es, radius, k1, k2, teff, qcm, evap, rhx, qc, a_eff, epsilon
1769 REAL*8 :: esd, radiusd, k1d, k2d, teffd, qcmd, evapd, rhxd, qcd
1770 REAL*8,
PARAMETER :: k_cond=2.4e-2
1771 REAL*8,
PARAMETER :: diffu=2.2e-5
1772 REAL*8,
PARAMETER :: nn=50.*1.0e6
1774 epsilon = cons_h2omw/cons_airmw
1778 esd = (100.*pl*qsd*(epsilon+(1.0-epsilon)*qs)-100.*pl*qs*(1.0-epsilon)&
1779 & *qsd)/(epsilon+(1.0-epsilon)*qs)**2
1780 es = 100.*pl*qs/(epsilon+(1.0-epsilon)*qs)
1781 IF (qv/qs .GT. 1.00)
THEN 1785 rhxd = (qvd*qs-qv*qsd)/qs**2
1788 k1d = -(cons_alhl**2*rho_w*k_cond*cons_rvap*2*te*ted/(k_cond*cons_rvap&
1790 k1 = cons_alhl**2*rho_w/(k_cond*cons_rvap*te**2)
1791 k2d = (cons_rvap*rho_w*ted*diffu*1000.*es/pl-cons_rvap*te*rho_w*diffu*&
1792 & 1000.*esd/pl)/(diffu*(1000./pl)*es)**2
1793 k2 = cons_rvap*te*rho_w/(diffu*(1000./pl)*es)
1795 IF (f .GT. 0. .AND. ql .GT. 0.)
THEN 1796 qcmd = (qld*f-ql*fd)/f**2
1803 CALL ldradius_d(pl, te, ted, qcm, qcmd, nn, rho_w, radius, radiusd, &
1804 & cons_rgas, cons_pi)
1805 IF (rhx .LT. rhcr .AND. radius .GT. 0.0)
THEN 1807 teffd = (-(rhxd*(k1+k2)*radius**2)-(rhcr-rhx)*((k1d+k2d)*radius**2+(&
1808 & k1+k2)*2*radius*radiusd))/((k1+k2)*radius**2)**2
1809 teff = (rhcr-rhx)/((k1+k2)*radius**2)
1815 evapd = a_eff*dt*(qld*teff+ql*teffd)
1816 evap = a_eff*ql*dt*teff
1817 IF (evap .GT. ql)
THEN 1825 IF (qc .GT. 0.)
THEN 1826 fd = ((fd*(qc-evap)+f*(qcd-evapd))*qc-f*(qc-evap)*qcd)/qc**2
1833 ted = ted - cons_alhl*evapd/cons_cp
1834 te = te - cons_alhl/cons_cp*evap
1840 SUBROUTINE subl_cnv_d(dt, rhcr, pl, te, ted, qv, qvd, ql, qld, qi, qid, &
1841 & f, fd, xf, qs, qsd, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, &
1842 & cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp, cons_alhs)
1845 REAL*8,
INTENT(IN) :: dt, rhcr, pl, xf, qs, rho_w, cld_evp_eff
1846 REAL*8,
INTENT(IN) :: qsd
1847 REAL*8,
INTENT(IN) :: cons_h2omw, cons_airmw, cons_alhl, cons_rvap, &
1848 & cons_rgas, cons_pi, cons_cp, cons_alhs
1850 REAL*8,
INTENT(INOUT) :: te, qv, ql, qi, f
1851 REAL*8,
INTENT(INOUT) :: ted, qvd, qld, qid, fd
1853 REAL*8 :: es, radius, k1, k2, teff, qcm, subl, rhx, qc, a_eff, nn, &
1855 REAL*8 :: esd, radiusd, k1d, k2d, teffd, qcmd, subld, rhxd, qcd
1856 REAL*8,
PARAMETER :: k_cond=2.4e-2
1857 REAL*8,
PARAMETER :: diffu=2.2e-5
1859 epsilon = cons_h2omw/cons_airmw
1863 esd = (100.*pl*qsd*(epsilon+(1.0-epsilon)*qs)-100.*pl*qs*(1.0-epsilon)&
1864 & *qsd)/(epsilon+(1.0-epsilon)*qs)**2
1865 es = 100.*pl*qs/(epsilon+(1.0-epsilon)*qs)
1866 IF (qv/qs .GT. 1.00)
THEN 1870 rhxd = (qvd*qs-qv*qsd)/qs**2
1873 k1d = -(cons_alhl**2*rho_w*k_cond*cons_rvap*2*te*ted/(k_cond*cons_rvap&
1875 k1 = cons_alhl**2*rho_w/(k_cond*cons_rvap*te**2)
1876 k2d = (cons_rvap*rho_w*ted*diffu*1000.*es/pl-cons_rvap*te*rho_w*diffu*&
1877 & 1000.*esd/pl)/(diffu*(1000./pl)*es)**2
1878 k2 = cons_rvap*te*rho_w/(diffu*(1000./pl)*es)
1880 IF (f .GT. 0. .AND. qi .GT. 0.)
THEN 1881 qcmd = (qid*f-qi*fd)/f**2
1888 CALL ldradius_d(pl, te, ted, qcm, qcmd, nn, rho_w, radius, radiusd, &
1889 & cons_rgas, cons_pi)
1890 IF (rhx .LT. rhcr .AND. radius .GT. 0.0)
THEN 1892 teffd = (-(rhxd*(k1+k2)*radius**2)-(rhcr-rhx)*((k1d+k2d)*radius**2+(&
1893 & k1+k2)*2*radius*radiusd))/((k1+k2)*radius**2)**2
1894 teff = (rhcr-rhx)/((k1+k2)*radius**2)
1900 subld = a_eff*dt*(qid*teff+qi*teffd)
1901 subl = a_eff*qi*dt*teff
1902 IF (subl .GT. qi)
THEN 1910 IF (qc .GT. 0.)
THEN 1911 fd = ((fd*(qc-subl)+f*(qcd-subld))*qc-f*(qc-subl)*qcd)/qc**2
1918 ted = ted - cons_alhs*subld/cons_cp
1919 te = te - cons_alhs/cons_cp*subl
1925 SUBROUTINE ldradius_d(pl, te, ted, qcl, qcld, nn, rho_w, radius, radiusd&
1926 & , cons_rgas, cons_pi)
1929 REAL*8,
INTENT(IN) :: te, pl, nn, qcl, rho_w
1930 REAL*8,
INTENT(IN) :: ted, qcld
1931 REAL*8,
INTENT(IN) :: cons_rgas, cons_pi
1933 REAL*8,
INTENT(OUT) :: radius
1934 REAL*8,
INTENT(OUT) :: radiusd
1938 pwx1d = (qcld*100.*pl/(cons_rgas*te)-qcl*100.*pl*ted/(cons_rgas*te**2)&
1939 & )/(nn*rho_w*(4./3.)*cons_pi)
1940 pwx1 = qcl*(100.*pl/(cons_rgas*te))/(nn*rho_w*(4./3.)*cons_pi)
1941 IF (pwx1 .GT. 0.0 .OR. (pwx1 .LT. 0.0 .AND. 1./3. .EQ. int(1./3.))) &
1943 radiusd = pwx1**(1./3.-1)*pwx1d/3.
1944 ELSE IF (pwx1 .EQ. 0.0 .AND. 1./3. .EQ. 1.0)
THEN 1949 radius = pwx1**(1./3.)
1956 & , sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
1959 REAL*8,
INTENT(IN) :: dt, te, pl, dzet, sundqv2, sundqv3, sundqt1, &
1961 REAL*8,
INTENT(IN) :: ted
1963 REAL*8,
INTENT(INOUT) :: qc, qp, f
1964 REAL*8,
INTENT(INOUT) :: qcd, qpd, fd
1966 REAL*8 :: acf0, acf, c00x, iqccrx, f2, f3, rate, dqp, qcm, dqfac
1967 REAL*8 :: c00xd, iqccrxd, f2d, f3d, rated, dqpd, qcmd, dqfacd
1991 CALL cons_sundq3_d(te, ted, sundqv2, sundqv3, sundqt1, f2, f2d, f3)
1995 iqccrxd = f3*f2d/lwcrit
1996 iqccrx = f2*f3/lwcrit
1997 IF (f .GT. 0. .AND. qc .GT. 0.)
THEN 1998 qcmd = (qcd*f-qc*fd)/f**2
2004 arg1d = -(2*qcm*iqccrx*(qcmd*iqccrx+qcm*iqccrxd))
2005 arg1 = -((qcm*iqccrx)**2)
2006 rated = c00xd*(1.0-exp(arg1)) - c00x*arg1d*exp(arg1)
2007 rate = c00x*(1.0-exp(arg1))
2013 IF (pl .GE. 775. .AND. te .LE. 275.) f3 = 0.2
2015 IF (pl .GE. 825. .AND. te .LE. 282.) f3 = 0.2
2017 IF (pl .GE. 775. .AND. pl .LT. 825. .AND. te .LE. 282. .AND. te .GT. &
2020 IF (pl .GE. 825. .AND. te .LE. 275.) f3 = 0.2
2021 IF (pl .LE. 775. .OR. te .GT. 282.) f3 = 1.
2023 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 2024 IF (0.2*te - 56 .GT. 2.)
THEN 2034 IF (pl .GE. 925. .AND. te .GE. 290.)
THEN 2035 IF (0.04*pl - 36. .GT. 2.)
THEN 2043 IF (pl .GE. 925. .AND. pl .LT. 950. .AND. te .GT. 285. .AND. te .LT. &
2045 IF (0.04*pl + 0.2*te - 94. .GT. 2.)
THEN 2050 x1 = 0.04*pl + 0.2*te - 94.
2052 IF (x1 .LT. 1.)
THEN 2060 IF (pl .GE. 950. .AND. te .GE. 290.)
THEN 2064 IF (f3 .LT. 0.1)
THEN 2070 rated = f3d*rate + f3*rated
2072 dqpd = qcd*(1.0-exp(-(rate*dt))) + qc*dt*rated*exp(-(rate*dt))
2073 dqp = qc*(1.0-exp(-(rate*dt)))
2074 IF (dqp .LT. 0.0)
THEN 2082 IF (pl .GE. 975. .AND. te .GE. 280.)
THEN 2083 IF (0.2*te - 56. .GT. 1.)
THEN 2090 IF (x2 .LT. 0.)
THEN 2100 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 2101 IF (0.04*pl - 38. .GT. 1.)
THEN 2106 IF (x3 .LT. 0.)
THEN 2114 IF (pl .GE. 950. .AND. pl .LT. 975. .AND. te .GT. 280. .AND. te .LT. &
2116 IF (0.04*pl + 0.2*te - 95. .GT. 1.)
THEN 2121 x4 = 0.04*pl + 0.2*te - 95.
2123 IF (x4 .LT. 0.)
THEN 2131 IF (pl .GE. 975. .AND. te .GE. 285.)
THEN 2135 IF (dqp .LT. dqfac*qc)
THEN 2136 dqpd = dqfacd*qc + dqfac*qcd
2146 IF (qc + dqp .GT. 0.)
THEN 2147 fd = ((qcd*f+qc*fd)*(qc+dqp)-qc*f*(qcd+dqpd))/(qc+dqp)**2
2156 & , sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
2159 REAL*8,
INTENT(IN) :: dt, te, pl, dzet, sundqv2, sundqv3, sundqt1, &
2161 REAL*8,
INTENT(IN) :: ted
2163 REAL*8,
INTENT(INOUT) :: qc, qp, f
2164 REAL*8,
INTENT(INOUT) :: qcd, qpd, fd
2166 REAL*8 :: acf0, acf, c00x, iqccrx, f2, f3, rate, dqp, qcm, dqfac
2167 REAL*8 :: c00xd, iqccrxd, f2d, f3d, rated, dqpd, qcmd, dqfacd
2191 CALL cons_sundq3_d(te, ted, sundqv2, sundqv3, sundqt1, f2, f2d, f3)
2195 iqccrxd = f3*f2d/lwcrit
2196 iqccrx = f2*f3/lwcrit
2197 IF (f .GT. 0. .AND. qc .GT. 0.)
THEN 2198 qcmd = (qcd*f-qc*fd)/f**2
2204 arg1d = -(2*qcm*iqccrx*(qcmd*iqccrx+qcm*iqccrxd))
2205 arg1 = -((qcm*iqccrx)**2)
2206 rated = c00xd*(1.0-exp(arg1)) - c00x*arg1d*exp(arg1)
2207 rate = c00x*(1.0-exp(arg1))
2213 IF (pl .GE. 775. .AND. te .LE. 275.) f3 = 0.2
2215 IF (pl .GE. 825. .AND. te .LE. 282.) f3 = 0.2
2217 IF (pl .GE. 775. .AND. pl .LT. 825. .AND. te .LE. 282. .AND. te .GT. &
2220 IF (pl .GE. 825. .AND. te .LE. 275.) f3 = 0.2
2221 IF (pl .LE. 775. .OR. te .GT. 282.) f3 = 1.
2223 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 2224 IF (0.2*te - 56 .GT. 2.)
THEN 2234 IF (pl .GE. 925. .AND. te .GE. 290.)
THEN 2235 IF (0.04*pl - 36. .GT. 2.)
THEN 2243 IF (pl .GE. 925. .AND. pl .LT. 950. .AND. te .GT. 285. .AND. te .LT. &
2245 IF (0.04*pl + 0.2*te - 94. .GT. 2.)
THEN 2250 x1 = 0.04*pl + 0.2*te - 94.
2252 IF (x1 .LT. 1.)
THEN 2260 IF (pl .GE. 950. .AND. te .GE. 290.)
THEN 2264 IF (f3 .LT. 0.1)
THEN 2270 rated = f3d*rate + f3*rated
2272 dqpd = qcd*(1.0-exp(-(rate*dt))) + qc*dt*rated*exp(-(rate*dt))
2273 dqp = qc*(1.0-exp(-(rate*dt)))
2274 IF (dqp .LT. 0.0)
THEN 2282 IF (pl .GE. 975. .AND. te .GE. 280.)
THEN 2283 IF (0.2*te - 56. .GT. 1.)
THEN 2290 IF (x2 .LT. 0.)
THEN 2300 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 2301 IF (0.04*pl - 38. .GT. 1.)
THEN 2306 IF (x3 .LT. 0.)
THEN 2314 IF (pl .GE. 950. .AND. pl .LT. 975. .AND. te .GT. 280. .AND. te .LT. &
2316 IF (0.04*pl + 0.2*te - 95. .GT. 1.)
THEN 2321 x4 = 0.04*pl + 0.2*te - 95.
2323 IF (x4 .LT. 0.)
THEN 2331 IF (pl .GE. 975. .AND. te .GE. 285.)
THEN 2335 IF (dqp .LT. dqfac*qc)
THEN 2336 dqpd = dqfacd*qc + dqfac*qcd
2351 & icefrpwr, icefrct, icefrctd)
2354 REAL*8,
INTENT(IN) :: temp, t_ice_all, t_ice_max
2355 REAL*8,
INTENT(IN) :: tempd
2356 INTEGER,
INTENT(IN) :: icefrpwr
2358 REAL*8,
INTENT(OUT) :: icefrct
2359 REAL*8,
INTENT(OUT) :: icefrctd
2363 IF (temp .LE. t_ice_all)
THEN 2366 ELSE IF (temp .GT. t_ice_all .AND. temp .LE. t_ice_max)
THEN 2367 icefrctd = -(tempd/(t_ice_max-t_ice_all))
2368 icefrct = 1.00 - (temp-t_ice_all)/(t_ice_max-t_ice_all)
2372 IF (icefrct .GT. 1.00)
THEN 2378 IF (icefrct .LT. 0.00)
THEN 2384 IF (icefrct .GT. 0.0 .OR. (icefrct .LT. 0.0 .AND. icefrpwr .EQ. int(&
2386 icefrctd = icefrpwr*icefrct**(icefrpwr-1)*icefrctd
2387 ELSE IF (icefrct .EQ. 0.0 .AND. icefrpwr .EQ. 1.0)
THEN 2392 icefrct = icefrct**icefrpwr
2398 SUBROUTINE cons_sundq3_d(temp, tempd, rate2, rate3, te1, f2, f2d, f3)
2401 REAL*8,
INTENT(IN) :: rate2, rate3, te1, temp
2402 REAL*8,
INTENT(IN) :: tempd
2404 REAL*8,
INTENT(OUT) :: f2, f3
2405 REAL*8,
INTENT(OUT) :: f2d
2407 REAL*8,
PARAMETER :: te0=273.
2408 REAL*8,
PARAMETER :: te2=200.
2413 jump1 = (rate2-1.0)/(te0-te1)**0.333
2415 IF (temp .GE. te0)
THEN 2419 IF (temp .GE. te1 .AND. temp .LT. te0)
THEN 2420 IF (te0 - temp .GE. 0.)
THEN 2425 IF (abs0 .GT. 0.0)
THEN 2427 f2d = -(jump1*0.3333*(te0-temp)**(-0.6667)*tempd)
2428 f2 = 1.0 + jump1*(te0-temp)**0.3333
2437 IF (temp .LT. te1)
THEN 2438 f2d = (-((rate3-rate2)*tempd))/(te1-te2)
2439 f2 = rate2 + (rate3-rate2)*(te1-temp)/(te1-te2)
2442 IF (f2 .GT. 27.0)
THEN 2454 & , bbd, cons_h2omw, cons_airmw, cons_rvap, alhx3, alhx3d)
2457 REAL*8,
INTENT(IN) :: temp, q_sat, pr, alhx3
2458 REAL*8,
INTENT(IN) :: tempd, q_satd, alhx3d
2459 REAL*8,
INTENT(IN) :: cons_h2omw, cons_airmw, cons_rvap
2461 REAL*8,
INTENT(OUT) :: aa, bb
2462 REAL*8,
INTENT(OUT) :: aad, bbd
2464 REAL*8,
PARAMETER :: k_cond=2.4e-2
2465 REAL*8,
PARAMETER :: diffu=2.2e-5
2466 REAL*8 :: e_sat, epsi
2468 epsi = cons_h2omw/cons_airmw
2470 e_satd = (100.*pr*q_satd*(epsi+(1.0-epsi)*q_sat)-100.*pr*q_sat*(1.0-&
2471 & epsi)*q_satd)/(epsi+(1.0-epsi)*q_sat)**2
2472 e_sat = 100.*pr*q_sat/(epsi+(1.0-epsi)*q_sat)
2473 aad = (2*alhx3*alhx3d*k_cond*cons_rvap*temp**2-alhx3**2*k_cond*&
2474 & cons_rvap*2*temp*tempd)/(k_cond*cons_rvap*temp**2)**2
2475 aa = alhx3**2/(k_cond*cons_rvap*temp**2)
2476 bbd = (cons_rvap*tempd*diffu*1000.*e_sat/pr-cons_rvap*temp*diffu*1000.&
2477 & *e_satd/pr)/(diffu*(1000./pr)*e_sat)**2
2478 bb = cons_rvap*temp/(diffu*(1000./pr)*e_sat)
2484 SUBROUTINE cons_alhx_d(t, td, alhx3, alhx3d, t_ice_max, t_ice_all, &
2485 & cons_alhs, cons_alhl)
2488 REAL*8,
INTENT(IN) :: t, t_ice_max, t_ice_all
2489 REAL*8,
INTENT(IN) :: td
2490 REAL*8,
INTENT(IN) :: cons_alhs, cons_alhl
2492 REAL*8,
INTENT(OUT) :: alhx3
2493 REAL*8,
INTENT(OUT) :: alhx3d
2494 IF (t .LT. t_ice_all)
THEN 2498 IF (t .GT. t_ice_max)
THEN 2502 IF (t .LE. t_ice_max .AND. t .GE. t_ice_all)
THEN 2503 alhx3d = (cons_alhl-cons_alhs)*td/(t_ice_max-t_ice_all)
2504 alhx3 = cons_alhs + (cons_alhl-cons_alhs)*(t-t_ice_all)/(t_ice_max-&
2513 & cons_rgas, khu, khl, k, dt, dz, dzd, qp, qpd, anv_icefall_c)
2516 REAL*8,
INTENT(IN) :: wxr, pl, te, dz, dt, anv_icefall_c
2517 REAL*8,
INTENT(IN) :: ted, dzd
2518 REAL*8,
INTENT(IN) :: cons_rgas
2519 INTEGER,
INTENT(IN) :: khu, khl, k
2520 REAL*8,
INTENT(INOUT) :: qi, f, qp
2521 REAL*8,
INTENT(INOUT) :: qid, fd, qpd
2523 REAL*8 :: rho, xim, lxim, qixp, vf
2524 REAL*8 :: rhod, ximd, lximd, qixpd, vfd
2532 rhod = -(1000.*100.*pl*cons_rgas*ted/(cons_rgas*te)**2)
2533 rho = 1000.*100.*pl/(cons_rgas*te)
2534 IF (f .GT. 0. .AND. qi .GT. 0.)
THEN 2535 ximd = (qid*f-qi*fd)*rho/f**2 + qi*rhod/f
2541 IF (xim .GT. 0.)
THEN 2542 lximd = ximd/(xim*log(10.0))
2548 vfd = 53.2*lximd + 5.5*2*lxim*lximd
2549 vf = 128.6 + 53.2*lxim + 5.5*lxim**2
2552 IF (wxr .GT. 0.)
THEN 2553 IF (pl .LT. 10.)
THEN 2565 IF (khu .GT. 0 .AND. khl .GT. 0)
THEN 2566 IF (k - 1 .GE. khu .AND. k - 1 .LE. khl)
THEN 2571 vfd = anv_icefall_c*vfd
2572 vf = anv_icefall_c*vf
2574 qixpd = qid*vf*dt/dz + qi*(dt*vfd*dz-vf*dt*dzd)/dz**2
2575 qixp = qi*(vf*dt/dz)
2576 IF (qixp .GT. qi)
THEN 2582 IF (qixp .LT. 0.0)
THEN 2598 & cons_rgas, khu, khl, k, dt, dz, dzd, qp, qpd, ls_icefall_c)
2601 REAL*8,
INTENT(IN) :: wxr, pl, te, dz, dt, ls_icefall_c
2602 REAL*8,
INTENT(IN) :: ted, dzd
2603 REAL*8,
INTENT(IN) :: cons_rgas
2604 INTEGER,
INTENT(IN) :: khu, khl, k
2605 REAL*8,
INTENT(INOUT) :: qi, f, qp
2606 REAL*8,
INTENT(INOUT) :: qid, fd, qpd
2608 REAL*8 :: rho, xim, lxim, qixp, vf
2609 REAL*8 :: rhod, ximd, qixpd, vfd
2619 rhod = -(1000.*100.*pl*cons_rgas*ted/(cons_rgas*te)**2)
2620 rho = 1000.*100.*pl/(cons_rgas*te)
2621 IF (f .GT. 0. .AND. qi .GT. 0.)
THEN 2622 ximd = (qid*f-qi*fd)*rho/f**2 + qi*rhod/f
2628 IF (xim .GT. 0.)
THEN 2633 IF (xim .GE. 0.)
THEN 2638 IF (abs0 .GT. 0.0)
THEN 2640 vfd = 109.0*0.16*xim**(-0.84)*ximd
2641 vf = 109.0*xim**0.16
2648 IF (wxr .GT. 0.)
THEN 2649 IF (pl .LT. 10.)
THEN 2661 IF (khu .GT. 0 .AND. khl .GT. 0)
THEN 2662 IF (k - 1 .GE. khu .AND. k - 1 .LE. khl)
THEN 2667 vfd = ls_icefall_c*vfd
2668 vf = ls_icefall_c*vf
2670 qixpd = qid*vf*dt/dz + qi*(dt*vfd*dz-vf*dt*dzd)/dz**2
2671 qixp = qi*(vf*dt/dz)
2672 IF (qixp .GT. qi)
THEN 2678 IF (qixp .LT. 0.0)
THEN 2688 IF (qi + qixp .GT. 0.)
THEN 2689 fd = ((qid*f+qi*fd)*(qi+qixp)-qi*f*(qid+qixpd))/(qi+qixp)**2
2700 SUBROUTINE precipandevap_d(k, ktop, lm, dt, frland, rhcr3, qpl, qpld, &
2701 & qpi, qpid, qcl, qcld, qci, te, ted, qv, qvd, mass, imass, pl, dze, &
2702 & dzed, qddf3, qddf3d, aa, aad, bb, bbd, area, aread, pfl_above_in, &
2703 & pfl_above_ind, pfl_above_out, pfl_above_outd, pfi_above_in, &
2704 & pfi_above_ind, pfi_above_out, pfi_above_outd, evap_dd_above_in, &
2705 & evap_dd_above_ind, evap_dd_above_out, evap_dd_above_outd, &
2706 & subl_dd_above_in, subl_dd_above_ind, subl_dd_above_out, &
2707 & subl_dd_above_outd, envfc, ddrfc, cons_alhf, cons_alhs, cons_alhl, &
2708 & cons_cp, cons_tice, cons_h2omw, cons_airmw, revap_off_p, c_acc, c_ev_r&
2709 & , c_ev_s, rho_w, estblx)
2712 INTEGER,
INTENT(IN) :: k, lm, ktop
2713 REAL*8,
INTENT(IN) :: dt, mass, imass, pl, aa, bb, rhcr3, dze, qddf3, &
2714 & area, frland, envfc, ddrfc
2715 REAL*8,
INTENT(IN) :: aad, bbd, dzed, qddf3d, aread
2716 REAL*8,
INTENT(IN) :: cons_alhf, cons_alhs, cons_alhl, cons_cp, &
2717 & cons_tice, cons_h2omw, cons_airmw
2718 REAL*8,
INTENT(IN) :: revap_off_p
2719 REAL*8,
INTENT(IN) :: c_acc, c_ev_r, c_ev_s, rho_w
2720 REAL*8,
INTENT(IN) :: estblx(:)
2722 REAL*8,
INTENT(INOUT) :: qv, qpl, qpi, qcl, qci, te
2723 REAL*8,
INTENT(INOUT) :: qvd, qpld, qpid, qcld, ted
2724 REAL*8,
INTENT(INOUT) :: pfl_above_in, pfl_above_out, pfi_above_in, &
2726 REAL*8,
INTENT(INOUT) :: pfl_above_ind, pfl_above_outd, pfi_above_ind&
2728 REAL*8,
INTENT(INOUT) :: evap_dd_above_in, evap_dd_above_out, &
2729 & subl_dd_above_in, subl_dd_above_out
2730 REAL*8,
INTENT(INOUT) :: evap_dd_above_ind, evap_dd_above_outd, &
2731 & subl_dd_above_ind, subl_dd_above_outd
2733 INTEGER :: ns, nsmx, itr, l
2734 REAL*8 :: pfi, pfl, qs, dqs, envfrac, tko, qko, qstko, dqstko, rh_box&
2735 & , t_ed, qplko, qpiko
2736 REAL*8 :: pfid, pfld, qsd, dqsd, tkod, qkod, qstkod, dqstkod, rh_boxd&
2738 REAL*8 :: ifactor, rainrat0, snowrat0, fallrn, fallsn, vesn, vern, &
2739 & nrain, nsnow, efactor
2740 REAL*8 :: ifactord, rainrat0d, snowrat0d, fallrnd, fallsnd, vesnd, &
2742 REAL*8 :: tinlayerrn, diamrn, droprad, tinlayersn, diamsn, flakrad
2743 REAL*8 :: tinlayerrnd, diamrnd, dropradd, tinlayersnd, diamsnd, &
2745 REAL*8 :: evap, subl, accr, mltfrz, evapx, sublx, evap_dd, subl_dd, &
2747 REAL*8 :: evapd, subld, accrd, mltfrzd, evap_ddd, subl_ddd
2748 REAL*8 :: tau_frz, tau_mlt
2750 REAL*8,
PARAMETER :: trmv_l=1.0
2751 LOGICAL,
PARAMETER :: taneff=.false.
2753 REAL*8,
PARAMETER :: b_sub=1.00
2760 IF (area .GT. 0.)
THEN 2761 ifactord = -(aread/area**2)
2767 IF (ifactor .LT. 1.)
THEN 2780 CALL dqsats_bac_d(dqs, dqsd, qs, qsd, te, ted, pl, estblx, cons_h2omw&
2783 IF (k .EQ. ktop)
THEN 2793 qpld = qpld + imass*pfl_above_ind
2794 qpl = qpl + pfl_above_in*imass
2796 qpid = qpid + imass*pfi_above_ind
2797 qpi = qpi + pfi_above_in*imass
2799 accrd = b_sub*c_acc*mass*(qpld*qcl+qpl*qcld)
2800 accr = b_sub*c_acc*(qpl*mass)*qcl
2801 IF (accr .GT. qcl)
THEN 2812 accrd = b_sub*c_acc*mass*(qpid*qcl+qpi*qcld)
2813 accr = b_sub*c_acc*(qpi*mass)*qcl
2814 IF (accr .GT. qcl)
THEN 2825 ted = ted + cons_alhf*accrd/cons_cp
2826 te = te + cons_alhf*accr/cons_cp
2827 rainrat0d = mass*(ifactord*qpl+ifactor*qpld)/dt
2828 rainrat0 = ifactor*qpl*mass/dt
2829 snowrat0d = mass*(ifactord*qpi+ifactor*qpid)/dt
2830 snowrat0 = ifactor*qpi*mass/dt
2831 CALL marshpalm_d(rainrat0, rainrat0d, pl, diamrn, diamrnd, nrain, &
2832 & fallrn, fallrnd, vern, vernd)
2833 CALL marshpalm_d(snowrat0, snowrat0d, pl, diamsn, diamsnd, nsnow, &
2834 & fallsn, fallsnd, vesn, vesnd)
2835 tinlayerrnd = (dzed*(fallrn+0.01)-dze*fallrnd)/(fallrn+0.01)**2
2836 tinlayerrn = dze/(fallrn+0.01)
2837 tinlayersnd = (dzed*(fallsn+0.01)-dze*fallsnd)/(fallsn+0.01)**2
2838 tinlayersn = dze/(fallsn+0.01)
2843 IF (te .GT. cons_tice .AND. te .LE. cons_tice + 5.)
THEN 2844 mltfrzd = ((tinlayersnd*qpi+tinlayersn*qpid)*(te-cons_tice)+&
2845 & tinlayersn*qpi*ted)/tau_frz
2846 mltfrz = tinlayersn*qpi*(te-cons_tice)/tau_frz
2847 IF (qpi .GT. mltfrz)
THEN 2853 ted = ted - cons_alhf*mltfrzd/cons_cp
2854 te = te - cons_alhf*mltfrz/cons_cp
2855 qpld = qpld + mltfrzd
2857 qpid = qpid - mltfrzd
2861 IF (te .GT. cons_tice + 5.)
THEN 2865 ted = ted - cons_alhf*mltfrzd/cons_cp
2866 te = te - cons_alhf*mltfrz/cons_cp
2867 qpld = qpld + mltfrzd
2869 qpid = qpid - mltfrzd
2873 IF (k .GE. lm - 1)
THEN 2874 IF (te .GT. cons_tice + 0.)
THEN 2878 ted = ted - cons_alhf*mltfrzd/cons_cp
2879 te = te - cons_alhf*mltfrz/cons_cp
2880 qpld = qpld + mltfrzd
2882 qpid = qpid - mltfrzd
2888 IF (te .LE. cons_tice)
THEN 2889 ted = ted + cons_alhf*qpld/cons_cp
2890 te = te + cons_alhf*qpl/cons_cp
2910 qstkod = qsd + dqstkod*(tko-te) + dqstko*(tkod-ted)
2911 qstko = qs + dqstko*(tko-te)
2912 IF (qstko .LT. 1.0e-7)
THEN 2918 rh_boxd = (qkod*qstko-qko*qstkod)/qstko**2
2922 IF (rh_box .LT. rhcr3)
THEN 2923 efactord = (rho_w*(aad+bbd)*(rhcr3-rh_box)+rho_w*(aa+bb)*rh_boxd)/&
2925 efactor = rho_w*(aa+bb)/(rhcr3-rh_box)
2930 IF (frland .LT. 0.1)
THEN 2939 IF (rh_box .LT. rhcr3 .AND. diamrn .GT. 0.00 .AND. pl .GT. 100. &
2940 & .AND. pl .LT. revap_off_p)
THEN 2941 dropradd = 0.5*diamrnd
2942 droprad = 0.5*diamrn
2943 t_edd = efactord*droprad**2 + efactor*2*droprad*dropradd
2944 t_ed = efactor*droprad**2
2945 t_edd = t_edd*(1.0+dqstko*cons_alhl/cons_cp) + t_ed*cons_alhl*&
2947 t_ed = t_ed*(1.0+dqstko*cons_alhl/cons_cp)
2948 arg1d = -((c_ev_r*landseaf*envfrac*(vernd*tinlayerrn+vern*&
2949 & tinlayerrnd)*t_ed-c_ev_r*vern*landseaf*envfrac*tinlayerrn*t_edd)&
2951 arg1 = -(c_ev_r*vern*landseaf*envfrac*tinlayerrn/t_ed)
2952 evapd = qpld*(1.0-exp(arg1)) - qpl*arg1d*exp(arg1)
2953 evap = qpl*(1.0-exp(arg1))
2959 IF (rh_box .LT. rhcr3 .AND. diamsn .GT. 0.00 .AND. pl .GT. 100. &
2960 & .AND. pl .LT. revap_off_p)
THEN 2961 flakradd = 0.5*diamsnd
2962 flakrad = 0.5*diamsn
2963 t_edd = efactord*flakrad**2 + efactor*2*flakrad*flakradd
2964 t_ed = efactor*flakrad**2
2965 t_edd = t_edd*(1.0+dqstko*cons_alhs/cons_cp) + t_ed*cons_alhs*&
2967 t_ed = t_ed*(1.0+dqstko*cons_alhs/cons_cp)
2968 arg1d = -((c_ev_s*landseaf*envfrac*(vesnd*tinlayersn+vesn*&
2969 & tinlayersnd)*t_ed-c_ev_s*vesn*landseaf*envfrac*tinlayersn*t_edd)&
2971 arg1 = -(c_ev_s*vesn*landseaf*envfrac*tinlayersn/t_ed)
2972 subld = qpid*(1.0-exp(arg1)) - qpi*arg1d*exp(arg1)
2973 subl = qpi*(1.0-exp(arg1))
2985 qko = qv + evap + subl
2986 tko = te - evap*cons_alhl/cons_cp - subl*cons_alhs/cons_cp
2993 evap_ddd = evap_dd_above_ind + ddfract*mass*evapd
2994 evap_dd = evap_dd_above_in + ddfract*evap*mass
2995 evapd = evapd - ddfract*evapd
2996 evap = evap - ddfract*evap
2997 subl_ddd = subl_dd_above_ind + ddfract*mass*subld
2998 subl_dd = subl_dd_above_in + ddfract*subl*mass
2999 subld = subld - ddfract*subld
3000 subl = subl - ddfract*subl
3001 qvd = qvd + evapd + subld
3002 qv = qv + evap + subl
3003 ted = ted - cons_alhl*evapd/cons_cp - cons_alhs*subld/cons_cp
3004 te = te - evap*cons_alhl/cons_cp - subl*cons_alhs/cons_cp
3010 evapd = (qddf3d*evap_dd+qddf3*evap_ddd)/mass
3011 evap = qddf3*evap_dd/mass
3012 subld = (qddf3d*subl_dd+qddf3*subl_ddd)/mass
3013 subl = qddf3*subl_dd/mass
3014 qvd = qvd + evapd + subld
3015 qv = qv + evap + subl
3016 ted = ted - cons_alhl*evapd/cons_cp - cons_alhs*subld/cons_cp
3017 te = te - evap*cons_alhl/cons_cp - subl*cons_alhs/cons_cp
3020 pfl_above_outd = pfld
3022 pfi_above_outd = pfid
3024 evap_dd_above_outd = evap_ddd
3025 evap_dd_above_out = evap_dd
3026 subl_dd_above_outd = subl_ddd
3027 subl_dd_above_out = subl_dd
3033 SUBROUTINE marshpalm_d(rain, raind, pr, diam3, diam3d, ntotal, w, wd, ve&
3038 REAL*8,
INTENT(IN) :: rain, pr
3039 REAL*8,
INTENT(IN) :: raind
3041 REAL*8,
INTENT(OUT) :: diam3, ntotal, w, ve
3042 REAL*8,
INTENT(OUT) :: diam3d, wd, ved
3046 REAL*8,
PARAMETER :: n0=0.08
3047 REAL*8 :: rain_day, slopr, diam1
3049 REAL*8 :: rx(8), d3x(8)
3050 REAL*8 :: rxd(8), d3xd(8)
3092 rain_dayd = 3600.*24.*raind
3093 rain_day = rain*3600.*24.
3094 IF (rain_day .LE. 0.00)
THEN 3104 IF (rain_day .LE. rx(iqd+1) .AND. rain_day .GT. rx(iqd))
THEN 3105 slopr = (d3x(iqd+1)-d3x(iqd))/(rx(iqd+1)-rx(iqd))
3106 diam3d = slopr*rain_dayd
3107 diam3 = d3x(iqd) + (rain_day-rx(iqd))*slopr
3110 IF (rain_day .GE. rx(8))
THEN 3114 ntotal = 0.019*diam3
3115 diam3d = 0.664*diam3d
3117 result1 = sqrt(1000./pr)
3118 wd = result1*2483.8*diam3d
3119 w = (2483.8*diam3+80.)*result1
3120 IF (0.99*w/100. .LT. 1.000)
THEN 3129 diam3d = diam3d/100.
3133 ntotal = ntotal*1.0e6
3139 SUBROUTINE dqsat_bac_d(dqsi, dqsid, qssi, qssid, temp, tempd, plo, im, &
3140 & jm, lm, estblx, cons_h2omw, cons_airmw)
3143 INTEGER :: im, jm, lm
3144 REAL*8,
DIMENSION(im, jm, lm) :: temp, plo
3145 REAL*8,
DIMENSION(im, jm, lm) :: tempd
3147 REAL*8 :: cons_h2omw, cons_airmw
3149 REAL*8,
DIMENSION(im, jm, lm) :: dqsi, qssi
3150 REAL*8,
DIMENSION(im, jm, lm) :: dqsid, qssid
3152 REAL*8,
PARAMETER :: max_mixing_ratio=1.0
3155 REAL*8 :: tl, tt, ti, dqsat, qsat, dqq, qq, pl, pp, dd
3156 REAL*8 :: tld, ttd, tid, dqsatd, qsatd, qqd, ddd
3158 INTEGER,
PARAMETER :: degsubs=100
3159 REAL*8,
PARAMETER :: tmintbl=150.0, tmaxtbl=333.0
3160 INTEGER,
PARAMETER :: tablesize=nint(tmaxtbl-tmintbl)*degsubs+1
3163 esfac = cons_h2omw/cons_airmw
3167 tld = tempd(i, j, k)
3171 IF (tl .LE. tmintbl)
THEN 3174 ELSE IF (tl .GE. tmaxtbl - .001)
THEN 3182 tt = (ti-tmintbl)*degsubs + 1
3184 dqq = estblx(it+1) - estblx(it)
3186 qq = (tt-it)*dqq + estblx(it)
3187 IF (pp .LE. qq)
THEN 3188 qsat = max_mixing_ratio
3193 ddd = -((-((1.0-esfac)*qqd))/(pp-(1.0-esfac)*qq)**2)
3194 dd = 1.0/(pp-(1.0-esfac)*qq)
3195 qsatd = esfac*(qqd*dd+qq*ddd)
3197 dqsatd = esfac*degsubs*dqq*pp*(ddd*dd+dd*ddd)
3198 dqsat = esfac*degsubs*dqq*pp*(dd*dd)
3200 dqsid(i, j, k) = dqsatd
3201 dqsi(i, j, k) = dqsat
3202 qssid(i, j, k) = qsatd
3203 qssi(i, j, k) = qsat
3212 SUBROUTINE dqsats_bac_d(dqsi, dqsid, qssi, qssid, temp, tempd, plo, &
3213 & estblx, cons_h2omw, cons_airmw)
3219 REAL*8 :: cons_h2omw, cons_airmw
3221 REAL*8 :: dqsi, qssi
3222 REAL*8 :: dqsid, qssid
3224 REAL*8,
PARAMETER :: max_mixing_ratio=1.0
3226 REAL*8 :: tl, tt, ti, dqsat, qsat, dqq, qq, pl, pp, dd
3227 REAL*8 :: tld, ttd, tid, dqsatd, qsatd, qqd, ddd
3229 INTEGER,
PARAMETER :: degsubs=100
3230 REAL*8,
PARAMETER :: tmintbl=150.0, tmaxtbl=333.0
3231 INTEGER,
PARAMETER :: tablesize=nint(tmaxtbl-tmintbl)*degsubs+1
3234 esfac = cons_h2omw/cons_airmw
3239 IF (tl .LE. tmintbl)
THEN 3242 ELSE IF (tl .GE. tmaxtbl - .001)
THEN 3250 tt = (ti-tmintbl)*degsubs + 1
3252 dqq = estblx(it+1) - estblx(it)
3254 qq = (tt-it)*dqq + estblx(it)
3255 IF (pp .LE. qq)
THEN 3256 qsat = max_mixing_ratio
3261 ddd = -((-((1.0-esfac)*qqd))/(pp-(1.0-esfac)*qq)**2)
3262 dd = 1.0/(pp-(1.0-esfac)*qq)
3263 qsatd = esfac*(qqd*dd+qq*ddd)
3265 dqsatd = esfac*degsubs*dqq*pp*(ddd*dd+dd*ddd)
3266 dqsat = esfac*degsubs*dqq*pp*(dd*dd)
subroutine precipandevap_d(k, ktop, lm, dt, frland, rhcr3, qpl, qpld, qpi, qpid, qcl, qcld, qci, te, ted, qv, qvd, mass, imass, pl, dze, dzed, qddf3, qddf3d, aa, aad, bb, bbd, area, aread, pfl_above_in, pfl_above_ind, pfl_above_out, pfl_above_outd, pfi_above_in, pfi_above_ind, pfi_above_out, pfi_above_outd, evap_dd_above_in, evap_dd_above_ind, evap_dd_above_out, evap_dd_above_outd, subl_dd_above_in, subl_dd_above_ind, subl_dd_above_out, subl_dd_above_outd, envfc, ddrfc, cons_alhf, cons_alhs, cons_alhl, cons_cp, cons_tice, cons_h2omw, cons_airmw, revap_off_p, c_acc, c_ev_r, c_ev_s, rho_w, estblx)
subroutine cons_microphys_d(temp, tempd, pr, q_sat, q_satd, aa, aad, bb, bbd, cons_h2omw, cons_airmw, cons_rvap, alhx3, alhx3d)
subroutine cons_sundq3_d(temp, tempd, rate2, rate3, te1, f2, f2d, f3)
subroutine meltfreeze_d(dt, te, ted, ql, qld, qi, qid, t_ice_all, t_ice_max, icefrpwr, cons_alhl, cons_alhs, cons_cp)
subroutine dqsat_bac_d(dqsi, dqsid, qssi, qssid, temp, tempd, plo, im, jm, lm, estblx, cons_h2omw, cons_airmw)
subroutine dqsats_bac_d(dqsi, dqsid, qssi, qssid, temp, tempd, plo, estblx, cons_h2omw, cons_airmw)
subroutine, public ls_cloud_d(dt, alpha, pdfshape, pl, te, ted, qv, qvd, qcl, qcld, qal, qald, qci, qcid, qai, qaid, cf, cfd, af, afd, cons_alhl, cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw, t_ice_all, t_ice_max, icefrpwr, estblx, cloud_pertmod, dmp)
subroutine ice_settlefall_ls_d(wxr, qi, qid, pl, te, ted, f, fd, cons_rgas, khu, khl, k, dt, dz, dzd, qp, qpd, ls_icefall_c)
subroutine, public cloud_driver_d(dt, im, jm, lm, th, thd, q, qd, ple, cnv_dqldt, cnv_dqldtd, cnv_mfd, cnv_mfdd, cnv_prc3, cnv_prc3d, cnv_updf, cnv_updfd, qi_ls, qi_lsd, ql_ls, ql_lsd, qi_con, qi_cond, ql_con, ql_cond, cf_ls, cf_lsd, cf_con, cf_cond, frland, physparams, estblx, khu, khl, cons_runiv, cons_kappa, cons_airmw, cons_h2omw, cons_grav, cons_alhl, cons_alhf, cons_pi, cons_rgas, cons_cp, cons_vireps, cons_alhs, cons_tice, cons_rvap, cons_p00, do_moist_physics)
subroutine cons_alhx_d(t, td, alhx3, alhx3d, t_ice_max, t_ice_all, cons_alhs, cons_alhl)
subroutine, public pdf_width(PP, FRLAND, maxrhcrit, maxrhcritland, turnrhcrit, minrhcrit, pi_0, ALPHA)
subroutine marshpalm_d(rain, raind, pr, diam3, diam3d, ntotal, w, wd, ve, ved)
subroutine evap_cnv_d(dt, rhcr, pl, te, ted, qv, qvd, ql, qld, qi, qid, f, fd, xf, qs, qsd, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp)
subroutine convec_src_d(dt, mass, imass, te, ted, qv, qvd, dcf, dcfd, dmf, dmfd, qla, qlad, qia, qiad, af, afd, qs, qsd, cons_alhs, cons_alhl, cons_cp, t_ice_all, t_ice_max, icefrpwr)
subroutine ldradius_d(pl, te, ted, qcl, qcld, nn, rho_w, radius, radiusd, cons_rgas, cons_pi)
subroutine cloud_tidy_d(qv, qvd, te, ted, qlc, qlcd, qic, qicd, cf, cfd, qla, qlad, qia, qiad, af, afd, cons_alhl, cons_alhs, cons_cp)
subroutine pdfcondensate_d(flag, qtmean4, qtmean4d, sigmaqt14, sigmaqt14d, sigmaqt24, sigmaqt24d, qstar4, qstar4d, condensate4, condensate4d)
subroutine autoconversion_cnv_d(dt, qc, qcd, qp, qpd, te, ted, pl, f, fd, sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
subroutine ice_settlefall_cnv_d(wxr, qi, qid, pl, te, ted, f, fd, cons_rgas, khu, khl, k, dt, dz, dzd, qp, qpd, anv_icefall_c)
subroutine autoconversion_ls_d(dt, qc, qcd, qp, qpd, te, ted, pl, f, fd, sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
subroutine get_ice_fraction_d(temp, tempd, t_ice_all, t_ice_max, icefrpwr, icefrct, icefrctd)
subroutine pdffrac_d(flag, qtmean, qtmeand, sigmaqt1, sigmaqt1d, sigmaqt2, sigmaqt2d, qstar, qstard, clfrac, clfracd)
subroutine subl_cnv_d(dt, rhcr, pl, te, ted, qv, qvd, ql, qld, qi, qid, f, fd, xf, qs, qsd, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp, cons_alhs)