24 SUBROUTINE cloud_driver_b(dt, im, jm, lm, th, thb, q, qb, ple, cnv_dqldt&
25 & , cnv_dqldtb, cnv_mfd, cnv_mfdb, cnv_prc3, cnv_prc3b, cnv_updf, &
26 & cnv_updfb, qi_ls, qi_lsb, ql_ls, ql_lsb, qi_con, qi_conb, ql_con, &
27 & ql_conb, cf_ls, cf_lsb, cf_con, cf_conb, frland, physparams, estblx, &
28 & khu, khl, cons_runiv, cons_kappa, cons_airmw, cons_h2omw, cons_grav, &
29 & cons_alhl, cons_alhf, cons_pi, cons_rgas, cons_cp, cons_vireps, &
30 & cons_alhs, cons_tice, cons_rvap, cons_p00, do_moist_physics)
33 INTEGER,
INTENT(IN) :: im, jm, lm, do_moist_physics
34 REAL*8,
INTENT(IN) :: dt, frland(im, jm), physparams(:)
35 REAL*8,
DIMENSION(im, jm, lm),
INTENT(IN) :: cnv_dqldt, cnv_mfd, &
37 REAL*8,
DIMENSION(im, jm, lm) :: cnv_dqldtb, cnv_mfdb, cnv_updfb, &
39 REAL*8,
INTENT(IN) :: estblx(:)
40 REAL*8,
DIMENSION(im, jm, 0:lm),
INTENT(IN) :: ple
41 INTEGER,
DIMENSION(im, jm),
INTENT(IN) :: khu, khl
43 REAL*8,
INTENT(IN) :: cons_runiv, cons_kappa, cons_airmw
44 REAL*8,
INTENT(IN) :: cons_h2omw, cons_grav, cons_alhl
45 REAL*8,
INTENT(IN) :: cons_alhf, cons_pi, cons_rgas
46 REAL*8,
INTENT(IN) :: cons_cp, cons_vireps, cons_alhs
47 REAL*8,
INTENT(IN) :: cons_tice, cons_rvap, cons_p00
49 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: th, q
50 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: thb
51 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: qi_ls, ql_ls, qi_con, &
52 & ql_con, cf_con, cf_ls
53 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: qi_lsb
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) :: tb, dzetb, qddf3b
60 REAL*8,
DIMENSION(im, jm, lm + 1) :: zet
61 REAL*8,
DIMENSION(im, jm, lm+1) :: zetb
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) :: qsb, dqsdtb, dqsb
65 REAL*8,
DIMENSION(im, jm) :: vmip
66 REAL*8,
DIMENSION(im, jm) :: vmipb
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_cub, qrn_anb, qsn_anb, qrn_lsb, qsn_lsb, qrn_cu_1db
96 REAL*8 :: qt_tmpi_1, qt_tmpi_2, qlt_tmp, qit_tmp
97 REAL*8 :: qt_tmpi_1b, qt_tmpi_2b, qlt_tmpb, qit_tmpb
98 REAL*8 :: prn_above_cu_new, prn_above_an_new, prn_above_ls_new
99 REAL*8 :: prn_above_cu_newb, prn_above_an_newb, prn_above_ls_newb
100 REAL*8 :: prn_above_cu_old, prn_above_an_old, prn_above_ls_old
101 REAL*8 :: prn_above_cu_oldb, prn_above_an_oldb, prn_above_ls_oldb
102 REAL*8 :: psn_above_cu_new, psn_above_an_new, psn_above_ls_new
103 REAL*8 :: psn_above_cu_newb, psn_above_an_newb, psn_above_ls_newb
104 REAL*8 :: psn_above_cu_old, psn_above_an_old, psn_above_ls_old
105 REAL*8 :: psn_above_cu_oldb, psn_above_an_oldb, psn_above_ls_oldb
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_newb, evap_dd_an_above_newb, &
109 & evap_dd_ls_above_newb
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_oldb, evap_dd_an_above_oldb, &
113 & evap_dd_ls_above_oldb
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_newb, subl_dd_an_above_newb, &
117 & subl_dd_ls_above_newb
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_oldb, subl_dd_an_above_oldb, &
121 & subl_dd_ls_above_oldb
122 REAL*8 :: area_ls_prc1, area_upd_prc1, area_anv_prc1
123 REAL*8 :: area_ls_prc1b, area_upd_prc1b, area_anv_prc1b
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_updb, tot_prec_anvb, tot_prec_lsb, area_upd_prcb, &
127 & area_anv_prcb, area_ls_prcb
129 REAL*8 :: rhexcess, tpw, negtpw
130 REAL*8 :: tpwb, negtpwb
131 INTEGER :: cloud_pertmod
137 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: qb
138 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: ql_lsb
139 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: ql_conb
140 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: qi_conb
141 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: cf_conb
142 REAL*8,
DIMENSION(im, jm, lm),
INTENT(INOUT) :: cf_lsb
144 REAL*8 :: temp1(im, jm, lm)
145 LOGICAL :: mask0(im, jm, lm)
159 REAL*8 :: tempb14(im, jm, lm)
165 LOGICAL :: mask(im, jm, lm)
171 real(8) :: ttraj, qtraj, qi_lstraj, qi_contraj, ql_lstraj, ql_contraj, cf_lstraj, cf_contraj, phtraj
172 real(8) :: tpert, qpert, qi_lspert, qi_conpert, ql_lspert, ql_conpert, cf_lspert, cf_conpert
173 real(8) :: jacobian(8,8), a(8,8)
176 integer,
parameter :: n1 = 8
177 integer,
parameter :: lda = 8
178 REAL(8) :: wr(n1), wi(n1)
179 INTEGER,
PARAMETER :: ldvl = n1
180 REAL(8) :: vl(ldvl,n1)
181 INTEGER,
PARAMETER :: ldvr = n1
182 REAL(8) :: vr(ldvr,n1)
183 INTEGER :: info, lwork
184 INTEGER,
PARAMETER :: lwmax = 10000
185 REAL(8) :: work(lwmax)
190 real(8) :: totfilt_t, totfilt_ql, totfilt_qi
191 real(8) :: t_p_preall, ql_ls_p_preall, ql_con_p_preall, qi_ls_p_preall, qi_con_p_preall
194 real(8) :: sinkfilt_ql, sinkfilt_qi, sinkfilt_cf
195 real(8) :: t_p_presink, q_p_presink
196 real(8) :: ql_ls_p_presink, ql_con_p_presink
197 real(8) :: qi_ls_p_presink, qi_con_p_presink
198 real(8) :: cf_con_p_presink
205 cnv_beta = physparams(1)
207 anv_beta = physparams(2)
209 ls_beta = physparams(3)
213 lwcrit = physparams(6)
214 c_acc = physparams(7)
215 c_ev_r = physparams(8)
216 c_ev_s = physparams(56)
217 cld_evp_eff = physparams(13)
218 ls_sdqv2 = physparams(15)
219 ls_sdqv3 = physparams(16)
220 ls_sdqvt1 = physparams(17)
221 anv_sdqv2 = physparams(18)
222 anv_sdqv3 = physparams(19)
223 anv_sdqvt1 = physparams(20)
224 anv_icefall_c = physparams(28)
225 ls_icefall_c = physparams(29)
226 revap_off_p = physparams(30)
227 cnvenvfc = physparams(31)
228 wrhodep = physparams(32)
229 t_ice_all = physparams(33) + cons_tice
230 icefrpwr = int(physparams(35) + .001)
231 cnvddrfc = physparams(36)
232 anvddrfc = physparams(37)
233 lsddrfc = physparams(38)
234 minrhcrit = physparams(42)
235 maxrhcrit = physparams(43)
236 turnrhcrit = physparams(45)
237 maxrhcritland = physparams(46)
238 pdfflag = int(physparams(57))
239 t_ice_max = cons_tice
241 prn_above_cu_new = 0.
242 prn_above_an_new = 0.
243 prn_above_ls_new = 0.
244 psn_above_cu_new = 0.
245 psn_above_an_new = 0.
246 psn_above_ls_new = 0.
247 evap_dd_cu_above_new = 0.
248 evap_dd_an_above_new = 0.
249 evap_dd_ls_above_new = 0.
250 subl_dd_cu_above_new = 0.
251 subl_dd_an_above_new = 0.
252 subl_dd_ls_above_new = 0.
255 ph = 0.5*(p(:, :, 0:lm-1)+p(:, :, 1:lm))
257 pi = (p/1000.)**(cons_rgas/cons_cp)
258 pih = (ph/1000.)**(cons_rgas/cons_cp)
262 CALL dqsat_bac(dqsdt, qs, t, ph, im, jm, lm, estblx, cons_h2omw, &
266 mass = (p(:, :, 1:lm)-p(:, :, 0:lm-1))*100./cons_grav
269 dzet(:, :, 1:lm) = th(:, :, 1:lm)*(pi(:, :, 1:lm)-pi(:, :, 0:lm-1))*&
272 zet(:, :, lm+1) = 0.0
274 zet(:, :, k) = zet(:, :, k+1) + dzet(:, :, k)
276 mask(:, :, 1:lm) = zet(:, :, 1:lm) .LT. 3000.
277 WHERE (mask(:, :, 1:lm))
278 qddf3 = -((zet(:, :, 1:lm)-3000.)*zet(:, :, 1:lm)*mass)
284 vmip(i, j) = sum(qddf3(i, j, :))
289 qddf3(:, :, k) = qddf3(:, :, k)/vmip
292 dp = ple(:, :, 1:lm) - ple(:, :, 0:lm-1)
293 dm = dp*(1./cons_grav)
298 IF (k .EQ. ktop)
THEN 322 qrn_cu_1d = cnv_prc3(i, j, k)
331 CALL cloud_tidy(q(i, j, k), t(i, j, k), ql_ls(i, j, k), qi_ls(i&
332 & , j, k), cf_ls(i, j, k), ql_con(i, j, k), qi_con(i, j&
333 & , k), cf_con(i, j, k), cons_alhl, cons_alhs, cons_cp)
338 CALL meltfreeze(dt, t(i, j, k), ql_ls(i, j, k), qi_ls(i, j, k), &
339 & t_ice_all, t_ice_max, icefrpwr, cons_alhl, cons_alhs, &
345 CALL meltfreeze(dt, t(i, j, k), ql_con(i, j, k), qi_con(i, j, k)&
346 & , t_ice_all, t_ice_max, icefrpwr, cons_alhl, cons_alhs&
354 CALL convec_src(dt, mass(i, j, k), imass(i, j, k), t(i, j, k), q&
355 & (i, j, k), cnv_dqldt(i, j, k), cnv_mfd(i, j, k), &
356 & ql_con(i, j, k), qi_con(i, j, k), cf_con(i, j, k), qs(&
357 & i, j, k), cons_alhs, cons_alhl, cons_cp, t_ice_all, &
358 & t_ice_max, icefrpwr)
361 CALL pdf_width(ph(i, j, k), frland(i, j), maxrhcrit, &
362 & maxrhcritland, turnrhcrit, minrhcrit, pi_0, alpha)
363 IF (alpha .LT. 1.0 - rh00)
THEN 381 CALL ls_cloud(dt, alpha, pdfflag, ph(i, j, k), t(i, j, k), q(i, &
382 & j, k), ql_ls(i, j, k), ql_con(i, j, k), qi_ls(i, j, k), &
383 & qi_con(i, j, k), cf_ls(i, j, k), cf_con(i, j, k), &
384 & cons_alhl, cons_alhf, cons_alhs, cons_cp, cons_h2omw, &
385 & cons_airmw, t_ice_all, t_ice_max, icefrpwr, estblx, &
386 & cloud_pertmod, do_moist_physics)
389 cf_tot = cf_ls(i, j, k) + cf_con(i, j, k)
390 IF (cf_tot .GT. 1.00)
THEN 392 cf_ls(i, j, k) = cf_ls(i, j, k)*(1.00/cf_tot)
394 cf_con(i, j, k) = cf_con(i, j, k)*(1.00/cf_tot)
405 CALL evap_cnv(dt, rhcrit, ph(i, j, k), t(i, j, k), q(i, j, k), &
406 & ql_con(i, j, k), qi_con(i, j, k), cf_con(i, j, k), cf_ls&
407 & (i, j, k), qs(i, j, k), rho_w, cld_evp_eff, cons_h2omw, &
408 & cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, &
414 CALL subl_cnv(dt, rhcrit, ph(i, j, k), t(i, j, k), q(i, j, k), &
415 & ql_con(i, j, k), qi_con(i, j, k), cf_con(i, j, k), cf_ls&
416 & (i, j, k), qs(i, j, k), rho_w, cld_evp_eff, cons_h2omw, &
417 & cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, &
418 & cons_cp, cons_alhs)
423 & ph(i, j, k), cf_ls(i, j, k), ls_sdqv2, ls_sdqv3&
424 & , ls_sdqvt1, c_00, lwcrit, dzet(i, j, k))
427 & , ph(i, j, k), cf_con(i, j, k), anv_sdqv2, &
428 & anv_sdqv3, anv_sdqvt1, c_00, lwcrit, dzet(i, j&
433 & (i, j, k), cf_con(i, j, k), cons_rgas, khu(i, &
434 & j), khl(i, j), k, dt, dzet(i, j, k), qsn_an, &
439 & , j, k), cf_ls(i, j, k), cons_rgas, khu(i, j), &
440 & khl(i, j), k, dt, dzet(i, j, k), qsn_ls, &
444 IF (t(i, j, k) .LT. cons_tice)
THEN 448 t(i, j, k) = t(i, j, k) + qsn_cu*(cons_alhs-cons_alhl)/cons_cp
461 tot_prec_upd = tot_prec_upd + (qrn_cu_1d+qsn_cu)*mass(i, j, k)
463 area_upd_prc = area_upd_prc + cnv_updf(i, j, k)*(qrn_cu_1d+&
464 & qsn_cu)*mass(i, j, k)
466 tot_prec_anv = tot_prec_anv + (qrn_an+qsn_an)*mass(i, j, k)
468 area_anv_prc = area_anv_prc + cf_con(i, j, k)*(qrn_an+qsn_an)*&
471 tot_prec_ls = tot_prec_ls + (qrn_ls+qsn_ls)*mass(i, j, k)
473 area_ls_prc = area_ls_prc + cf_ls(i, j, k)*(qrn_ls+qsn_ls)*mass(&
475 IF (tot_prec_anv .GT. 0.0)
THEN 476 IF (area_anv_prc/tot_prec_anv .LT. 1.e-6)
THEN 478 area_anv_prc1 = 1.e-6
480 area_anv_prc1 = area_anv_prc/tot_prec_anv
486 IF (tot_prec_upd .GT. 0.0)
THEN 487 IF (area_upd_prc/tot_prec_upd .LT. 1.e-6)
THEN 489 area_upd_prc1 = 1.e-6
491 area_upd_prc1 = area_upd_prc/tot_prec_upd
497 IF (tot_prec_ls .GT. 0.0)
THEN 498 IF (area_ls_prc/tot_prec_ls .LT. 1.e-6)
THEN 502 area_ls_prc1 = area_ls_prc/tot_prec_ls
508 area_ls_prc1 = ls_beta*area_ls_prc1
509 area_upd_prc1 = cnv_beta*area_upd_prc1
510 area_anv_prc1 = anv_beta*area_anv_prc1
513 IF (tot_prec_anv .GT. 0.0)
THEN 514 IF (area_anv_prc/tot_prec_anv .LT. 1.e-6)
THEN 520 area_anv_prc = area_anv_prc/tot_prec_anv
526 IF (tot_prec_upd .GT. 0.0)
THEN 527 IF (area_upd_prc/tot_prec_upd .LT. 1.e-6)
THEN 533 area_upd_prc = area_upd_prc/tot_prec_upd
539 IF (tot_prec_ls .GT. 0.0)
THEN 540 IF (area_ls_prc/tot_prec_ls .LT. 1.e-6)
THEN 546 area_ls_prc = area_ls_prc/tot_prec_ls
553 area_ls_prc = ls_beta*area_ls_prc
555 area_upd_prc = cnv_beta*area_upd_prc
557 area_anv_prc = anv_beta*area_anv_prc
564 CALL cons_alhx(t(i, j, k), alhx3, t_ice_max, t_ice_all, &
565 & cons_alhs, cons_alhl)
568 CALL cons_microphys(t(i, j, k), ph(i, j, k), qs(i, j, k), aa, bb&
569 & , cons_h2omw, cons_airmw, cons_rvap, alhx3)
572 qlt_tmp = ql_ls(i, j, k) + ql_con(i, j, k)
574 qit_tmp = qi_ls(i, j, k) + qi_con(i, j, k)
576 prn_above_cu_old = prn_above_cu_new
578 psn_above_cu_old = psn_above_cu_new
580 evap_dd_cu_above_old = evap_dd_cu_above_new
582 subl_dd_cu_above_old = subl_dd_cu_above_new
590 & qrn_cu_1d, qsn_cu, qlt_tmp, qit_tmp, t(i, j, k), q(&
591 & i, j, k), mass(i, j, k), imass(i, j, k), ph(i, j, k&
592 & ), dzet(i, j, k), qddf3(i, j, k), aa, bb, &
593 & area_upd_prc1, prn_above_cu_old, prn_above_cu_new, &
594 & psn_above_cu_old, psn_above_cu_new, &
595 & evap_dd_cu_above_old, evap_dd_cu_above_new, &
596 & subl_dd_cu_above_old, subl_dd_cu_above_new, &
597 & cnvenvfc, cnvddrfc, cons_alhf, cons_alhs, cons_alhl&
598 & , cons_cp, cons_tice, cons_h2omw, cons_airmw, &
599 & revap_off_p, c_acc, c_ev_r, c_ev_s, rho_w, estblx)
601 prn_above_an_old = prn_above_an_new
603 psn_above_an_old = psn_above_an_new
605 evap_dd_an_above_old = evap_dd_an_above_new
607 subl_dd_an_above_old = subl_dd_an_above_new
615 CALL precipandevap(k, ktop, lm, dt, frland(i, j), rhcrit, qrn_an&
616 & , qsn_an, qlt_tmp, qit_tmp, t(i, j, k), q(i, j, k)&
617 & , mass(i, j, k), imass(i, j, k), ph(i, j, k), dzet(&
618 & i, j, k), qddf3(i, j, k), aa, bb, area_anv_prc1, &
619 & prn_above_an_old, prn_above_an_new, &
620 & psn_above_an_old, psn_above_an_new, &
621 & evap_dd_an_above_old, evap_dd_an_above_new, &
622 & subl_dd_an_above_old, subl_dd_an_above_new, &
623 & anvenvfc, anvddrfc, cons_alhf, cons_alhs, cons_alhl&
624 & , cons_cp, cons_tice, cons_h2omw, cons_airmw, &
625 & revap_off_p, c_acc, c_ev_r, c_ev_s, rho_w, estblx)
627 prn_above_ls_old = prn_above_ls_new
629 psn_above_ls_old = psn_above_ls_new
631 evap_dd_ls_above_old = evap_dd_ls_above_new
633 subl_dd_ls_above_old = subl_dd_ls_above_new
641 CALL precipandevap(k, ktop, lm, dt, frland(i, j), rhcrit, qrn_ls&
642 & , qsn_ls, qlt_tmp, qit_tmp, t(i, j, k), q(i, j, k)&
643 & , mass(i, j, k), imass(i, j, k), ph(i, j, k), dzet(&
644 & i, j, k), qddf3(i, j, k), aa, bb, area_ls_prc1, &
645 & prn_above_ls_old, prn_above_ls_new, &
646 & psn_above_ls_old, psn_above_ls_new, &
647 & evap_dd_ls_above_old, evap_dd_ls_above_new, &
648 & subl_dd_ls_above_old, subl_dd_ls_above_new, lsenvfc&
649 & , lsddrfc, cons_alhf, cons_alhs, cons_alhl, cons_cp&
650 & , cons_tice, cons_h2omw, cons_airmw, revap_off_p, &
651 & c_acc, c_ev_r, c_ev_s, rho_w, estblx)
652 IF (ql_ls(i, j, k) + ql_con(i, j, k) .GT. 0.00)
THEN 654 qt_tmpi_1 = 1./(ql_ls(i, j, k)+ql_con(i, j, k))
662 ql_ls(i, j, k) = ql_ls(i, j, k)*qlt_tmp*qt_tmpi_1
664 ql_con(i, j, k) = ql_con(i, j, k)*qlt_tmp*qt_tmpi_1
665 IF (qi_ls(i, j, k) + qi_con(i, j, k) .GT. 0.00)
THEN 667 qt_tmpi_2 = 1./(qi_ls(i, j, k)+qi_con(i, j, k))
675 qi_ls(i, j, k) = qi_ls(i, j, k)*qit_tmp*qt_tmpi_2
677 qi_con(i, j, k) = qi_con(i, j, k)*qit_tmp*qt_tmpi_2
684 CALL dqsat_bac(dqsdt, qs, t, ph, im, jm, lm, estblx, cons_h2omw, &
686 mask0 = q .GT. rhexcess*qs
688 dqs = (q-rhexcess*qs)/(1.0+rhexcess*dqsdt*cons_alhl/cons_cp)
699 tpw = sum(q(i, j, :)*dm(i, j, :))
703 IF (q(i, j, l) .LT. 0.0)
THEN 704 negtpw = negtpw + q(i, j, l)*dm(i, j, l)
712 IF (q(i, j, l) .GE. 0.0)
THEN 728 IF (branch .NE. 0)
THEN 729 temp2 = negtpw/(tpw-negtpw)
730 tempb15 = q(i, j, l)*qb(i, j, l)/(tpw-negtpw)
731 tempb16 = -(temp2*tempb15)
732 negtpwb = negtpwb + tempb15 - tempb16
733 tpwb = tpwb + tempb16
734 qb(i, j, l) = (temp2+1.0)*qb(i, j, l)
739 IF (branch .NE. 0) qb(i, j, l) = dm(i, j, l)*negtpwb
743 qb(i, j, :) = qb(i, j, :) + dm(i, j, :)*tpwb
747 dqsb = cons_alhl*tb/cons_cp - qb
751 temp1 = rhexcess*cons_alhl*dqsdt/cons_cp + 1.0
757 qsb = -(rhexcess*tempb14)
758 dqsdtb = -(rhexcess*cons_alhl*(q-rhexcess*qs)*tempb14/(cons_cp*temp1&
762 CALL dqsat_bac_b(dqsdt, dqsdtb, qs, qsb, t, tb, ph, im, jm, lm, estblx&
763 & , cons_h2omw, cons_airmw)
768 prn_above_cu_newb = 0.0_8
769 psn_above_cu_newb = 0.0_8
770 evap_dd_an_above_newb = 0.0_8
771 area_upd_prcb = 0.0_8
772 prn_above_ls_newb = 0.0_8
773 evap_dd_ls_above_newb = 0.0_8
774 evap_dd_cu_above_newb = 0.0_8
775 psn_above_ls_newb = 0.0_8
778 tot_prec_updb = 0.0_8
779 prn_above_an_newb = 0.0_8
780 area_anv_prcb = 0.0_8
781 psn_above_an_newb = 0.0_8
783 subl_dd_an_above_newb = 0.0_8
785 tot_prec_anvb = 0.0_8
787 subl_dd_ls_above_newb = 0.0_8
788 subl_dd_cu_above_newb = 0.0_8
796 t_p_preall = (1.0-totfilt_t)*tb(i,j,k)
797 tb(i,j,k) = totfilt_t *tb(i,j,k)
799 if (do_moist_physics == 1)
then 802 elseif (do_moist_physics == 2)
then 807 ql_ls_p_preall = (1.0-totfilt_ql)*ql_lsb(i,j,k)
808 ql_lsb(i,j,k) = totfilt_ql * ql_lsb(i,j,k)
809 ql_con_p_preall = (1.0-totfilt_ql)*ql_conb(i,j,k)
810 ql_conb(i,j,k) = totfilt_ql * ql_conb(i,j,k)
812 qi_ls_p_preall = (1.0-totfilt_qi) * qi_lsb(i,j,k)
813 qi_lsb(i,j,k) = totfilt_qi * qi_lsb(i,j,k)
814 qi_con_p_preall = (1.0-totfilt_qi) * qi_conb(i,j,k)
815 qi_conb(i,j,k) = totfilt_qi * qi_conb(i,j,k)
818 if (do_moist_physics == 1)
then 822 elseif (do_moist_physics == 2)
then 828 qi_ls_p_presink = 0.0
829 qi_con_p_presink = 0.0
831 ql_ls_p_presink = 0.0
832 ql_con_p_presink = 0.0
835 qi_ls_p_presink = (1.0-sinkfilt_qi) * qi_lsb(i,j,k)
836 qi_lsb(i,j,k) = sinkfilt_qi * qi_lsb(i,j,k)
837 qi_con_p_presink = (1.0-sinkfilt_qi) * qi_conb(i,j,k)
838 qi_conb(i,j,k) = sinkfilt_qi * qi_conb(i,j,k)
839 q_p_presink = (1.0-sinkfilt_qi) * qb(i,j,k)
840 qb(i,j,k) = sinkfilt_qi * qb(i,j,k)
843 if ( abs(k-62) .le. 2)
then 844 ql_ls_p_presink = (1.0-sinkfilt_ql) * ql_lsb(i,j,k)
845 ql_lsb(i,j,k) = sinkfilt_ql * ql_lsb(i,j,k)
846 ql_con_p_presink = (1.0-sinkfilt_ql) * ql_conb(i,j,k)
847 ql_conb(i,j,k) = sinkfilt_ql * ql_conb(i,j,k)
853 cf_con_p_presink = 0.0
857 tempb12 = qi_con(i, j, k)*qi_conb(i, j, k)
858 qi_conb(i, j, k) = qit_tmp*qt_tmpi_2*qi_conb(i, j, k)
860 tempb13 = qi_ls(i, j, k)*qi_lsb(i, j, k)
861 qit_tmpb = qt_tmpi_2*tempb13 + qt_tmpi_2*tempb12
862 qt_tmpi_2b = qit_tmp*tempb13 + qit_tmp*tempb12
863 qi_lsb(i, j, k) = qit_tmp*qt_tmpi_2*qi_lsb(i, j, k)
865 IF (branch .EQ. 0)
THEN 867 temp0 = qi_ls(i, j, k) + qi_con(i, j, k)
868 tempb11 = -(qt_tmpi_2b/temp0**2)
869 qi_lsb(i, j, k) = qi_lsb(i, j, k) + tempb11
870 qi_conb(i, j, k) = qi_conb(i, j, k) + tempb11
875 tempb9 = ql_con(i, j, k)*ql_conb(i, j, k)
876 ql_conb(i, j, k) = qlt_tmp*qt_tmpi_1*ql_conb(i, j, k)
878 tempb10 = ql_ls(i, j, k)*ql_lsb(i, j, k)
879 qlt_tmpb = qt_tmpi_1*tempb10 + qt_tmpi_1*tempb9
880 qt_tmpi_1b = qlt_tmp*tempb10 + qlt_tmp*tempb9
881 ql_lsb(i, j, k) = qlt_tmp*qt_tmpi_1*ql_lsb(i, j, k)
883 IF (branch .EQ. 0)
THEN 885 temp = ql_ls(i, j, k) + ql_con(i, j, k)
886 tempb8 = -(qt_tmpi_1b/temp**2)
887 ql_lsb(i, j, k) = ql_lsb(i, j, k) + tempb8
888 ql_conb(i, j, k) = ql_conb(i, j, k) + tempb8
901 & qrn_ls, qrn_lsb, qsn_ls, qsn_lsb, qlt_tmp, &
902 & qlt_tmpb, qit_tmp, t(i, j, k), tb(i, j, k), q(i, &
903 & j, k), qb(i, j, k), mass(i, j, k), imass(i, j, k)&
904 & , ph(i, j, k), dzet(i, j, k), dzetb(i, j, k), &
905 & qddf3(i, j, k), qddf3b(i, j, k), aa, aab, bb, bbb&
906 & , area_ls_prc1, area_ls_prc1b, prn_above_ls_old, &
907 & prn_above_ls_oldb, prn_above_ls_new, &
908 & prn_above_ls_newb, psn_above_ls_old, &
909 & psn_above_ls_oldb, psn_above_ls_new, &
910 & psn_above_ls_newb, evap_dd_ls_above_old, &
911 & evap_dd_ls_above_oldb, evap_dd_ls_above_new, &
912 & evap_dd_ls_above_newb, subl_dd_ls_above_old, &
913 & subl_dd_ls_above_oldb, subl_dd_ls_above_new, &
914 & subl_dd_ls_above_newb, lsenvfc, lsddrfc, &
915 & cons_alhf, cons_alhs, cons_alhl, cons_cp, &
916 & cons_tice, cons_h2omw, cons_airmw, revap_off_p, &
917 & c_acc, c_ev_r, c_ev_s, rho_w, estblx)
919 subl_dd_ls_above_newb = subl_dd_ls_above_oldb
921 evap_dd_ls_above_newb = evap_dd_ls_above_oldb
923 psn_above_ls_newb = psn_above_ls_oldb
925 prn_above_ls_newb = prn_above_ls_oldb
933 & qrn_an, qrn_anb, qsn_an, qsn_anb, qlt_tmp, &
934 & qlt_tmpb, qit_tmp, t(i, j, k), tb(i, j, k), q(i, &
935 & j, k), qb(i, j, k), mass(i, j, k), imass(i, j, k)&
936 & , ph(i, j, k), dzet(i, j, k), dzetb(i, j, k), &
937 & qddf3(i, j, k), qddf3b(i, j, k), aa, aab, bb, bbb&
938 & , area_anv_prc1, area_anv_prc1b, prn_above_an_old&
939 & , prn_above_an_oldb, prn_above_an_new, &
940 & prn_above_an_newb, psn_above_an_old, &
941 & psn_above_an_oldb, psn_above_an_new, &
942 & psn_above_an_newb, evap_dd_an_above_old, &
943 & evap_dd_an_above_oldb, evap_dd_an_above_new, &
944 & evap_dd_an_above_newb, subl_dd_an_above_old, &
945 & subl_dd_an_above_oldb, subl_dd_an_above_new, &
946 & subl_dd_an_above_newb, anvenvfc, anvddrfc, &
947 & cons_alhf, cons_alhs, cons_alhl, cons_cp, &
948 & cons_tice, cons_h2omw, cons_airmw, revap_off_p, &
949 & c_acc, c_ev_r, c_ev_s, rho_w, estblx)
951 subl_dd_an_above_newb = subl_dd_an_above_oldb
953 evap_dd_an_above_newb = evap_dd_an_above_oldb
955 psn_above_an_newb = psn_above_an_oldb
957 prn_above_an_newb = prn_above_an_oldb
964 & qrn_cu_1d, qrn_cu_1db, qsn_cu, qsn_cub, qlt_tmp, &
965 & qlt_tmpb, qit_tmp, t(i, j, k), tb(i, j, k), q(i, &
966 & j, k), qb(i, j, k), mass(i, j, k), imass(i, j, k)&
967 & , ph(i, j, k), dzet(i, j, k), dzetb(i, j, k), &
968 & qddf3(i, j, k), qddf3b(i, j, k), aa, aab, bb, bbb&
969 & , area_upd_prc1, area_upd_prc1b, prn_above_cu_old&
970 & , prn_above_cu_oldb, prn_above_cu_new, &
971 & prn_above_cu_newb, psn_above_cu_old, &
972 & psn_above_cu_oldb, psn_above_cu_new, &
973 & psn_above_cu_newb, evap_dd_cu_above_old, &
974 & evap_dd_cu_above_oldb, evap_dd_cu_above_new, &
975 & evap_dd_cu_above_newb, subl_dd_cu_above_old, &
976 & subl_dd_cu_above_oldb, subl_dd_cu_above_new, &
977 & subl_dd_cu_above_newb, cnvenvfc, cnvddrfc, &
978 & cons_alhf, cons_alhs, cons_alhl, cons_cp, &
979 & cons_tice, cons_h2omw, cons_airmw, revap_off_p, &
980 & c_acc, c_ev_r, c_ev_s, rho_w, estblx)
982 subl_dd_cu_above_newb = subl_dd_cu_above_oldb
984 evap_dd_cu_above_newb = evap_dd_cu_above_oldb
986 psn_above_cu_newb = psn_above_cu_oldb
988 prn_above_cu_newb = prn_above_cu_oldb
990 qi_lsb(i, j, k) = qi_lsb(i, j, k) + qit_tmpb
991 qi_conb(i, j, k) = qi_conb(i, j, k) + qit_tmpb
993 ql_lsb(i, j, k) = ql_lsb(i, j, k) + qlt_tmpb
994 ql_conb(i, j, k) = ql_conb(i, j, k) + qlt_tmpb
998 & , j, k), qsb(i, j, k), aa, aab, bb, bbb, &
999 & cons_h2omw, cons_airmw, cons_rvap, alhx3, alhx3b&
1002 CALL cons_alhx_b(t(i, j, k), tb(i, j, k), alhx3, alhx3b, &
1003 & t_ice_max, t_ice_all, cons_alhs, cons_alhl)
1005 IF (branch .EQ. 0)
THEN 1007 area_anv_prcb = anv_beta*area_anv_prcb
1009 area_upd_prcb = cnv_beta*area_upd_prcb
1011 area_ls_prcb = ls_beta*area_ls_prcb
1013 IF (branch .NE. 0)
THEN 1014 IF (branch .EQ. 1)
THEN 1016 tot_prec_lsb = tot_prec_lsb - area_ls_prc*area_ls_prcb/&
1018 area_ls_prcb = area_ls_prcb/tot_prec_ls
1021 area_ls_prcb = 0.0_8
1025 IF (branch .NE. 0)
THEN 1026 IF (branch .EQ. 1)
THEN 1028 tot_prec_updb = tot_prec_updb - area_upd_prc*area_upd_prcb&
1030 area_upd_prcb = area_upd_prcb/tot_prec_upd
1033 area_upd_prcb = 0.0_8
1037 IF (branch .NE. 0)
THEN 1038 IF (branch .EQ. 1)
THEN 1040 tot_prec_anvb = tot_prec_anvb - area_anv_prc*area_anv_prcb&
1042 area_anv_prcb = area_anv_prcb/tot_prec_anv
1045 area_anv_prcb = 0.0_8
1049 area_anv_prc1b = anv_beta*area_anv_prc1b
1050 area_upd_prc1b = cnv_beta*area_upd_prc1b
1051 area_ls_prc1b = ls_beta*area_ls_prc1b
1053 IF (branch .NE. 0)
THEN 1054 IF (branch .EQ. 1)
THEN 1055 area_ls_prcb = area_ls_prcb + area_ls_prc1b/tot_prec_ls
1056 tot_prec_lsb = tot_prec_lsb - area_ls_prc*area_ls_prc1b/&
1061 IF (branch .NE. 0)
THEN 1062 IF (branch .EQ. 1)
THEN 1063 area_upd_prcb = area_upd_prcb + area_upd_prc1b/tot_prec_upd
1064 tot_prec_updb = tot_prec_updb - area_upd_prc*area_upd_prc1b/&
1069 IF (branch .NE. 0)
THEN 1070 IF (branch .EQ. 1)
THEN 1071 area_anv_prcb = area_anv_prcb + area_anv_prc1b/tot_prec_anv
1072 tot_prec_anvb = tot_prec_anvb - area_anv_prc*area_anv_prc1b/&
1076 tempb7 = mass(i, j, k)*tot_prec_updb
1077 tempb4 = mass(i, j, k)*tot_prec_anvb
1078 tempb1 = mass(i, j, k)*tot_prec_lsb
1080 tempb = mass(i, j, k)*area_ls_prcb
1081 tempb0 = cf_ls(i, j, k)*tempb
1082 cf_lsb(i, j, k) = cf_lsb(i, j, k) + (qrn_ls+qsn_ls)*tempb
1083 qrn_lsb = qrn_lsb + tempb1 + tempb0
1084 qsn_lsb = qsn_lsb + tempb1 + tempb0
1087 tempb2 = mass(i, j, k)*area_anv_prcb
1088 tempb3 = cf_con(i, j, k)*tempb2
1089 cf_conb(i, j, k) = cf_conb(i, j, k) + (qrn_an+qsn_an)*tempb2
1090 qrn_anb = qrn_anb + tempb4 + tempb3
1091 qsn_anb = qsn_anb + tempb4 + tempb3
1094 tempb5 = mass(i, j, k)*area_upd_prcb
1095 tempb6 = cnv_updf(i, j, k)*tempb5
1096 cnv_updfb(i, j, k) = cnv_updfb(i, j, k) + (qrn_cu_1d+qsn_cu)*&
1098 qrn_cu_1db = qrn_cu_1db + tempb7 + tempb6
1099 qsn_cub = qsn_cub + tempb7 + tempb6
1105 IF (branch .EQ. 0)
THEN 1107 qsn_cub = qsn_cub + (cons_alhs-cons_alhl)*tb(i, j, k)/cons_cp
1108 qrn_cu_1db = qsn_cub
1113 & ), ph(i, j, k), t(i, j, k), tb(i, j, k), &
1114 & cf_ls(i, j, k), cf_lsb(i, j, k), cons_rgas, &
1115 & khu(i, j), khl(i, j), k, dt, dzet(i, j, k), &
1116 & dzetb(i, j, k), qsn_ls, qsn_lsb, ls_icefall_c&
1120 & , k), ph(i, j, k), t(i, j, k), tb(i, j, k), &
1121 & cf_con(i, j, k), cf_conb(i, j, k), cons_rgas&
1122 & , khu(i, j), khl(i, j), k, dt, dzet(i, j, k)&
1123 & , dzetb(i, j, k), qsn_an, qsn_anb, &
1127 & , qrn_an, qrn_anb, t(i, j, k), tb(i, j, k), &
1128 & ph(i, j, k), cf_con(i, j, k), cf_conb(i, j, &
1129 & k), anv_sdqv2, anv_sdqv3, anv_sdqvt1, c_00, &
1130 & lwcrit, dzet(i, j, k))
1134 & qrn_ls, qrn_lsb, t(i, j, k), tb(i, j, k), ph(&
1135 & i, j, k), cf_ls(i, j, k), cf_lsb(i, j, k), &
1136 & ls_sdqv2, ls_sdqv3, ls_sdqvt1, c_00, lwcrit, &
1142 CALL subl_cnv_b(dt, rhcrit, ph(i, j, k), t(i, j, k), tb(i, j, k)&
1143 & , q(i, j, k), qb(i, j, k), ql_con(i, j, k), ql_conb(i&
1144 & , j, k), qi_con(i, j, k), qi_conb(i, j, k), cf_con(i, &
1145 & j, k), cf_conb(i, j, k), cf_ls(i, j, k), qs(i, j, k), &
1146 & qsb(i, j, k), rho_w, cld_evp_eff, cons_h2omw, &
1147 & cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, &
1148 & cons_cp, cons_alhs)
1153 CALL evap_cnv_b(dt, rhcrit, ph(i, j, k), t(i, j, k), tb(i, j, k)&
1154 & , q(i, j, k), qb(i, j, k), ql_con(i, j, k), ql_conb(i&
1155 & , j, k), qi_con(i, j, k), qi_conb(i, j, k), cf_con(i, &
1156 & j, k), cf_conb(i, j, k), cf_ls(i, j, k), qs(i, j, k), &
1157 & qsb(i, j, k), rho_w, cld_evp_eff, cons_h2omw, &
1158 & cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, &
1161 IF (branch .EQ. 0)
THEN 1164 cf_totb = -(cf_ls(i, j, k)*cf_lsb(i, j, k)/cf_tot**2) - cf_con&
1165 & (i, j, k)*cf_conb(i, j, k)/cf_tot**2
1166 cf_conb(i, j, k) = cf_conb(i, j, k)/cf_tot
1167 cf_lsb(i, j, k) = cf_lsb(i, j, k)/cf_tot
1172 cf_lsb(i, j, k) = cf_lsb(i, j, k) + cf_totb
1173 cf_conb(i, j, k) = cf_conb(i, j, k) + cf_totb
1176 qb(i,j,k) = qb(i,j,k) + q_p_presink
1177 qi_lsb(i,j,k) = qi_lsb(i,j,k) + qi_ls_p_presink
1178 qi_conb(i,j,k) = qi_conb(i,j,k) + qi_con_p_presink
1179 ql_lsb(i,j,k) = ql_lsb(i,j,k) + ql_ls_p_presink
1180 ql_conb(i,j,k) = ql_conb(i,j,k) + ql_con_p_presink
1181 cf_conb(i,j,k) = cf_conb(i,j,k) + cf_con_p_presink
1192 if (do_moist_physics == 1)
then 1197 elseif (do_moist_physics == 2)
then 1211 qi_lstraj = qi_ls(i,j,k)
1212 qi_contraj = qi_con(i,j,k)
1213 ql_lstraj = ql_ls(i,j,k)
1214 ql_contraj = ql_con(i,j,k)
1215 cf_lstraj = cf_ls(i,j,k)
1216 cf_contraj = cf_con(i,j,k)
1228 CALL ls_cloud_d(dt, alpha, pdfflag, phtraj, ttraj, tpert, qtraj, qpert, &
1229 ql_lstraj, ql_lspert, ql_contraj, ql_conpert, &
1230 qi_lstraj, qi_lspert, qi_contraj, qi_conpert, &
1231 cf_lstraj, cf_lspert, cf_contraj, cf_conpert, &
1232 cons_alhl, cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw, &
1233 t_ice_all, t_ice_max, icefrpwr, estblx, 0, do_moist_physics)
1235 jacobian(1,ii) = tpert
1236 jacobian(2,ii) = qpert
1237 jacobian(3,ii) = qi_lspert
1238 jacobian(4,ii) = qi_conpert
1239 jacobian(5,ii) = ql_lspert
1240 jacobian(6,ii) = ql_conpert
1241 jacobian(7,ii) = cf_lspert
1242 jacobian(8,ii) = cf_conpert
1253 CALL dgeev(
'Vectors',
'Vectors', n1, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, info )
1255 lwork =
min( lwmax, int( work( 1 ) ) )
1256 CALL dgeev(
'Vectors',
'Vectors', n1, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, info )
1258 maxeval = maxval(abs(wr))
1261 if (maxeval > 1.001)
then 1266 if ( ( jacobian(1,1) < 0.6 ) .or. &
1267 ( jacobian(2,1) > 0.75e-4 ) .or. &
1268 ( jacobian(5,1) < -0.75e-4 ) .or. &
1269 ( jacobian(7,1) < -1.10 ) )
then 1275 CALL ls_cloud_b(dt, alpha, pdfflag, ph(i, j, k), t(i, j, k), tb(&
1276 & i, j, k), q(i, j, k), qb(i, j, k), ql_ls(i, j, k), &
1277 & ql_lsb(i, j, k), ql_con(i, j, k), ql_conb(i, j, k), &
1278 & qi_ls(i, j, k), qi_lsb(i, j, k), qi_con(i, j, k), &
1279 & qi_conb(i, j, k), cf_ls(i, j, k), cf_lsb(i, j, k), &
1280 & cf_con(i, j, k), cf_conb(i, j, k), cons_alhl, &
1281 & cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw&
1282 & , t_ice_all, t_ice_max, icefrpwr, estblx, &
1283 & cloud_pertmod, do_moist_physics)
1292 CALL convec_src_b(dt, mass(i, j, k), imass(i, j, k), t(i, j, k)&
1293 & , tb(i, j, k), q(i, j, k), qb(i, j, k), cnv_dqldt(i&
1294 & , j, k), cnv_dqldtb(i, j, k), cnv_mfd(i, j, k), &
1295 & cnv_mfdb(i, j, k), ql_con(i, j, k), ql_conb(i, j, k)&
1296 & , qi_con(i, j, k), qi_conb(i, j, k), cf_con(i, j, k)&
1297 & , cf_conb(i, j, k), qs(i, j, k), qsb(i, j, k), &
1298 & cons_alhs, cons_alhl, cons_cp, t_ice_all, t_ice_max&
1303 CALL meltfreeze_b(dt, t(i, j, k), tb(i, j, k), ql_con(i, j, k), &
1304 & ql_conb(i, j, k), qi_con(i, j, k), qi_conb(i, j, k)&
1305 & , t_ice_all, t_ice_max, icefrpwr, cons_alhl, &
1306 & cons_alhs, cons_cp)
1310 CALL meltfreeze_b(dt, t(i, j, k), tb(i, j, k), ql_ls(i, j, k), &
1311 & ql_lsb(i, j, k), qi_ls(i, j, k), qi_lsb(i, j, k), &
1312 & t_ice_all, t_ice_max, icefrpwr, cons_alhl, cons_alhs&
1321 CALL cloud_tidy_b(q(i, j, k), qb(i, j, k), t(i, j, k), tb(i, j, &
1322 & k), ql_ls(i, j, k), ql_lsb(i, j, k), qi_ls(i, j, k)&
1323 & , qi_lsb(i, j, k), cf_ls(i, j, k), cf_lsb(i, j, k), &
1324 & ql_con(i, j, k), ql_conb(i, j, k), qi_con(i, j, k), &
1325 & qi_conb(i, j, k), cf_con(i, j, k), cf_conb(i, j, k)&
1326 & , cons_alhl, cons_alhs, cons_cp)
1327 cnv_prc3b(i, j, k) = cnv_prc3b(i, j, k) + qrn_cu_1db
1329 IF (branch .NE. 0)
THEN 1336 area_upd_prcb = 0.0_8
1337 tot_prec_lsb = 0.0_8
1338 area_ls_prcb = 0.0_8
1339 tot_prec_updb = 0.0_8
1340 area_anv_prcb = 0.0_8
1341 tot_prec_anvb = 0.0_8
1345 tb(i, j, k) = tb(i, j, k) + t_p_preall
1346 ql_lsb(i, j, k) = ql_lsb(i, j, k) + ql_ls_p_preall
1347 ql_conb(i, j, k) = ql_conb(i, j, k) + ql_con_p_preall
1348 qi_lsb(i, j, k) = qi_lsb(i, j, k) + qi_ls_p_preall
1349 qi_conb(i, j, k) = qi_conb(i, j, k) + qi_con_p_preall
1357 vmipb = vmipb - qddf3(:, :, k)*qddf3b(:, :, k)/vmip**2
1358 qddf3b(:, :, k) = qddf3b(:, :, k)/vmip
1362 qddf3b(i, j, :) = qddf3b(i, j, :) + vmipb(i, j)
1366 WHERE (.NOT.mask(:, :, 1:lm)) qddf3b = 0.0_8
1368 WHERE (mask(:, :, 1:lm)) zetb(:, :, 1:lm) = zetb(:, :, 1:lm) - (zet(:&
1369 & , :, 1:lm)-3000.)*mass*qddf3b - zet(:, :, 1:lm)*mass*qddf3b
1371 zetb(:, :, k+1) = zetb(:, :, k+1) + zetb(:, :, k)
1372 dzetb(:, :, k) = dzetb(:, :, k) + zetb(:, :, k)
1373 zetb(:, :, k) = 0.0_8
1375 CALL dqsat_bac_b(dqsdt, dqsdtb, qs, qsb, t, tb, ph, im, jm, lm, estblx&
1376 & , cons_h2omw, cons_airmw)
1378 thb(:, :, 1:lm) = pih*tb + (pi(:, :, 1:lm)-pi(:, :, 0:lm-1))*cons_cp*&
1379 & dzetb(:, :, 1:lm)/cons_grav
1386 SUBROUTINE cloud_tidy_b(qv, qvb, te, teb, qlc, qlcb, qic, qicb, cf, cfb&
1387 & , qla, qlab, qia, qiab, af, afb, cons_alhl, cons_alhs, cons_cp)
1389 REAL*8,
INTENT(INOUT) :: te, qv, qlc, cf, qla, af, qic, qia
1390 REAL*8 :: teb, qvb, qlcb, cfb, qlab, afb, qicb, qiab
1391 REAL*8,
INTENT(IN) :: cons_alhl, cons_alhs, cons_cp
1394 IF (af .LT. 1.e-5)
THEN 1412 IF (qlc .LT. 1.e-8)
THEN 1420 IF (qic .LT. 1.e-8)
THEN 1428 IF (qla .LT. 1.e-8)
THEN 1436 IF (qia .LT. 1.e-8)
THEN 1444 IF (qla + qia .LT. 1.e-8)
THEN 1450 IF (qlc + qic .LT. 1.e-8)
THEN 1451 qlcb = qvb - cons_alhl*teb/cons_cp
1452 qicb = qvb - cons_alhs*teb/cons_cp
1456 IF (branch .EQ. 0)
THEN 1457 qlab = qvb - cons_alhl*teb/cons_cp
1458 qiab = qvb - cons_alhs*teb/cons_cp
1462 IF (branch .EQ. 0)
THEN 1464 qiab = qvb - cons_alhs*teb/cons_cp
1467 IF (branch .EQ. 0)
THEN 1469 qlab = qvb - cons_alhl*teb/cons_cp
1472 IF (branch .EQ. 0)
THEN 1474 qicb = qvb - cons_alhs*teb/cons_cp
1477 IF (branch .EQ. 0)
THEN 1479 qlcb = qvb - cons_alhl*teb/cons_cp
1482 IF (branch .EQ. 0)
THEN 1485 qlab = qvb - cons_alhl*teb/cons_cp
1486 qiab = qvb - cons_alhs*teb/cons_cp
1494 SUBROUTINE meltfreeze_b(dt, te, teb, ql, qlb, qi, qib, t_ice_all, &
1495 & t_ice_max, icefrpwr, cons_alhl, cons_alhs, cons_cp)
1498 REAL*8,
INTENT(IN) :: dt, t_ice_all, t_ice_max
1499 INTEGER,
INTENT(IN) :: icefrpwr
1500 REAL*8,
INTENT(IN) :: cons_alhl, cons_alhs, cons_cp
1502 REAL*8,
INTENT(INOUT) :: te, ql, qi
1503 REAL*8 :: teb, qlb, qib
1506 REAL*8 :: fqib, dqilb
1507 REAL*8,
PARAMETER :: taufrz=1000.
1516 IF (te .LE. t_ice_max)
THEN 1517 dqil = ql*(1.0-exp(-(dt*fqi/taufrz)))
1522 IF (0. .LT. dqil)
THEN 1532 te = te + (cons_alhs-cons_alhl)*dqil/cons_cp
1535 IF (te .GT. t_ice_max)
THEN 1541 IF (0. .GT. dqil)
THEN 1546 dqilb = qib - qlb + (cons_alhs-cons_alhl)*teb/cons_cp
1548 IF (branch .NE. 0) dqilb = 0.0_8
1550 IF (branch .NE. 0) qib = qib - dqilb
1552 dqilb = qib - qlb + (cons_alhs-cons_alhl)*teb/cons_cp
1555 IF (branch .NE. 0) dqilb = 0.0_8
1557 IF (branch .EQ. 0)
THEN 1560 temp = -(dt*fqi/taufrz)
1561 qlb = qlb + (1.0-exp(temp))*dqilb
1562 fqib = dt*exp(temp)*ql*dqilb/taufrz
1571 SUBROUTINE convec_src_b(dt, mass, imass, te, teb, qv, qvb, dcf, dcfb, &
1572 & dmf, dmfb, qla, qlab, qia, qiab, af, afb, qs, qsb, cons_alhs, &
1573 & cons_alhl, cons_cp, t_ice_all, t_ice_max, icefrpwr)
1576 REAL*8,
INTENT(IN) :: dt, t_ice_all, t_ice_max
1577 INTEGER,
INTENT(IN) :: icefrpwr
1578 REAL*8,
INTENT(IN) :: mass, imass, qs
1580 REAL*8,
INTENT(IN) :: dmf, dcf
1581 REAL*8 :: dmfb, dcfb
1582 REAL*8,
INTENT(IN) :: cons_alhs, cons_alhl, cons_cp
1584 REAL*8,
INTENT(INOUT) :: te, qv
1586 REAL*8,
INTENT(INOUT) :: qla, qia, af
1587 REAL*8 :: qlab, qiab, afb
1590 REAL*8,
PARAMETER :: minrhx=0.001
1591 REAL*8 :: tend, qvx, fqi
1592 REAL*8 :: tendb, fqib
1617 IF (af .GT. 0.99)
THEN 1626 IF (af .LT. 1.0)
THEN 1627 qvx = (qv-qs*af)/(1.-af)
1632 IF (qvx - minrhx*qs .LT. 0.0 .AND. af .GT. 0.)
THEN 1633 af = (qv-minrhx*qs)/(qs*(1.0-minrhx))
1638 IF (af .LT. 0.)
THEN 1639 qlab = qvb - cons_alhl*teb/cons_cp
1640 qiab = qvb - cons_alhs*teb/cons_cp
1644 IF (branch .EQ. 0)
THEN 1645 tempb0 = afb/((1.0-minrhx)*qs)
1647 qsb = qsb + (-((qv-minrhx*qs)/qs)-minrhx)*tempb0
1651 IF (branch .EQ. 0) afb = 0.0_8
1654 dmfb = dmfb + imass*tendb
1656 tempb = (cons_alhs-cons_alhl)*dt*teb/cons_cp
1657 fqib = dt*tend*qiab - tend*dt*qlab + tend*tempb
1658 tendb = dt*fqi*qiab + dt*(1.0-fqi)*qlab + fqi*tempb
1661 dcfb = dcfb + imass*tendb
1667 SUBROUTINE ls_cloud_b(dt, alpha, pdfshape, pl, te, teb, qv, qvb, qcl, &
1668 & qclb, qal, qalb, qci, qcib, qai, qaib, cf, cfb, af, afb, cons_alhl, &
1669 & cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw, t_ice_all, &
1670 & t_ice_max, icefrpwr, estblx, cloud_pertmod, dmp)
1673 REAL*8,
INTENT(IN) :: dt, alpha, pl, t_ice_all, t_ice_max
1674 INTEGER,
INTENT(IN) :: pdfshape, cloud_pertmod, dmp
1675 INTEGER,
INTENT(IN) :: icefrpwr
1676 REAL*8,
INTENT(IN) :: cons_alhl, cons_alhf, cons_alhs, cons_cp, &
1677 & cons_h2omw, cons_airmw
1678 REAL*8,
INTENT(IN) :: estblx(:)
1680 REAL*8,
INTENT(INOUT) :: te, qv, qcl, qci, qal, qai, cf, af
1681 REAL*8 :: teb, qvb, qclb, qcib, qalb, qaib, cfb, afb
1684 REAL*8 :: qco, cfo, qao, qt, qmx, qmn, dq
1685 REAL*8 :: qcob, cfob, qaob, qtb
1686 REAL*8 :: teo, qsx, dqsx, qs, dqs, tmparr
1687 REAL*8 :: teob, qsxb, dqsxb, dqsb, tmparrb
1688 REAL*8 :: qcx, qvx, cfx, qax, qc, qa, fqi, fqi_a, dqai, dqal, dqci, &
1690 REAL*8 :: qcxb, qvxb, cfxb, qaxb, qcb, qab, fqib, dqaib, dqalb, dqcib&
1692 REAL*8 :: ten, qsp, cfp, qvp, qcp
1693 REAL*8 :: tenb, qcpb
1694 REAL*8 :: tep, qsn, cfn, qvn, qcn
1695 REAL*8 :: tepb, qsnb, cfnb, qcnb
1696 REAL*8 :: alhx, sigmaqt1, sigmaqt2
1697 REAL*8 :: alhxb, sigmaqt1b, sigmaqt2b
1698 REAL*8,
DIMENSION(1) :: dqsx1, qsx1, teo1, pl1
1726 CALL dqsats_bac(dqsx, qsx, teo, pl, estblx, cons_h2omw, cons_airmw)
1727 IF (af .LT. 1.0)
THEN 1728 IF (dmp .EQ. 1)
THEN 1729 IF (1. - af .GT. 0.02)
THEN 1736 ELSE IF (dmp .EQ. 2)
THEN 1748 qvx = (qv-qsx*af)*tmparr
1749 IF (af .GE. 1.0)
THEN 1755 IF (af .GT. 0.)
THEN 1776 sigmaqt1 = alpha*qsn
1777 sigmaqt2 = alpha*qsn
1778 IF (pdfshape .EQ. 2)
THEN 1781 sigmaqt1 = alpha*qsn
1782 sigmaqt2 = alpha*qsn
1788 IF (cloud_pertmod .EQ. 0)
THEN 1789 CALL pdffrac(1, qt, sigmaqt1, sigmaqt2, qsn, cfn)
1791 ELSE IF (cloud_pertmod .EQ. 1)
THEN 1792 CALL pdffrac(4, qt, sigmaqt1, sigmaqt2, qsn, cfn)
1798 CALL pdfcondensate(pdfshape, qt, sigmaqt1, sigmaqt2, qsn, qcn)
1801 IF (af .GT. 0.)
THEN 1809 alhx = (1.0-fqi)*cons_alhl + fqi*cons_alhs
1810 IF (pdfshape .EQ. 1)
THEN 1812 qcn = qcp + (qcn-qcp)/(1.-(cfn*(alpha-1.)-qcn/qsn)*dqs*alhx/cons_cp)
1814 ELSE IF (pdfshape .EQ. 2)
THEN 1818 qcn = qcp + (qcn-qcp)*0.5
1830 IF (af .LT. 1.0)
THEN 1850 IF (qt - qsx .LT. 0.)
THEN 1861 dqcl = (1.0-fqi)*qcx
1864 IF (qcl + dqcl .LT. 0.)
THEN 1865 dqci = dqci + (qcl+dqcl)
1871 IF (qci + dqci .LT. 0.)
THEN 1882 IF (qal + dqal .LT. 0.)
THEN 1883 dqai = dqai + (qal+dqal)
1888 IF (qai + dqai .LT. 0.)
THEN 1894 IF (af .LT. 1.e-5)
THEN 1899 IF (cf .LT. 1.e-5)
THEN 1908 IF (qao .LE. 0.)
THEN 1909 qaib = qvb - cons_alhs*teb/cons_cp
1910 qalb = qvb - cons_alhl*teb/cons_cp
1913 tempb4 = teb/cons_cp
1914 tempb5 = cons_alhl*tempb4
1915 dqaib = qaib - qvb + cons_alhf*tempb4 + tempb5
1916 dqcib = qcib - qvb + cons_alhf*tempb4 + tempb5
1917 dqalb = qalb - qvb + tempb5
1918 dqclb = qclb - qvb + tempb5
1920 IF (branch .EQ. 0)
THEN 1927 IF (branch .EQ. 0)
THEN 1934 IF (branch .EQ. 0)
THEN 1935 qaib = qaib + dqalb - dqaib
1939 IF (branch .EQ. 0)
THEN 1940 qalb = qalb + dqaib - dqalb
1947 IF (branch .EQ. 0)
THEN 1948 qcib = qcib + dqclb - dqcib
1952 IF (branch .EQ. 0)
THEN 1953 qclb = qclb + dqcib - dqclb
1956 fqib = qcx*dqcib - qcx*dqclb
1957 qcxb = (1.0-fqi)*dqclb + fqi*dqcib
1961 IF (branch .EQ. 0)
THEN 1964 afb = afb + qao*qaob - cfo*cfb - qco*qcob
1971 IF (branch .EQ. 1)
THEN 1990 IF (branch .LT. 2)
THEN 1991 IF (branch .EQ. 0)
THEN 1993 temp0 = dqs*alhx/cons_cp
1994 temp1 = (alpha-1.)*cfn - qcn/qsn
1995 temp = -(temp1*temp0) + 1.
1997 tempb1 = -((qcn-qcp)*tempb0/temp)
1998 tempb2 = temp0*tempb1/qsn
1999 tempb3 = -(temp1*tempb1/cons_cp)
2000 qcpb = qcnb - tempb0
2001 cfnb = cfnb - temp0*(alpha-1.)*tempb1
2002 qsnb = -(qcn*tempb2/qsn)
2005 qcnb = tempb2 + tempb0
2011 ELSE IF (branch .EQ. 2)
THEN 2019 100 fqib = fqib + (cons_alhs-cons_alhl)*alhxb
2021 IF (branch .EQ. 0)
THEN 2028 CALL pdfcondensate_b(pdfshape, qt, qtb, sigmaqt1, sigmaqt1b, sigmaqt2&
2029 & , sigmaqt2b, qsn, qsnb, qcn, qcnb)
2031 IF (branch .EQ. 0)
THEN 2032 CALL pdffrac_b(1, qt, qtb, sigmaqt1, sigmaqt1b, sigmaqt2, sigmaqt2b&
2033 & , qsn, qsnb, cfn, cfnb)
2034 ELSE IF (branch .EQ. 1)
THEN 2035 CALL pdffrac_b(4, qt, qtb, sigmaqt1, sigmaqt1b, sigmaqt2, sigmaqt2b&
2036 & , qsn, qsnb, cfn, cfnb)
2039 IF (branch .EQ. 0)
THEN 2040 qsnb = qsnb + alpha*sigmaqt1b + alpha*sigmaqt2b
2044 qsnb = qsnb + alpha*sigmaqt1b + alpha*sigmaqt2b
2057 IF (branch .EQ. 0)
THEN 2059 afb = afb - qa*qaxb/af**2
2062 IF (branch .EQ. 0)
THEN 2063 qsxb = qsxb + 1.e-4*qvxb
2068 qsxb = qsxb - af*tempb
2069 afb = afb - qsx*tempb
2070 tmparrb = qc*qcxb + cf*cfxb + (qv-qsx*af)*qvxb
2071 qcb = qcb + tmparr*qcxb
2074 IF (branch .LT. 2)
THEN 2075 IF (branch .EQ. 0)
THEN 2076 afb = afb + tmparrb/(1.-af)**2
2078 afb = afb + tmparrb/(0.02)**2
2080 ELSE IF (branch .EQ. 2)
THEN 2081 afb = afb + tmparrb/(1.-af)**2
2083 CALL dqsats_bac_b(dqsx, dqsxb, qsx, qsxb, teo, teob, pl, estblx, &
2084 & cons_h2omw, cons_airmw)
2097 SUBROUTINE pdffrac_b(flag, qtmean, qtmeanb, sigmaqt1, sigmaqt1b, &
2098 & sigmaqt2, sigmaqt2b, qstar, qstarb, clfrac, clfracb)
2103 INTEGER,
INTENT(IN) :: flag
2104 REAL*8,
INTENT(IN) :: qtmean, sigmaqt1, sigmaqt2, qstar
2105 REAL*8 :: qtmeanb, sigmaqt1b, sigmaqt2b, qstarb
2107 REAL*8,
INTENT(INOUT) :: clfrac
2110 REAL*8 :: qtmode, qtmin, qtmax
2111 REAL*8 :: qtmodeb, qtminb, qtmaxb
2112 REAL*8 :: rh, rhd, q1, q2
2128 IF (flag .EQ. 1)
THEN 2130 IF (qtmean + sigmaqt1 .GE. qstar)
THEN 2131 IF (sigmaqt1 .GT. 0.)
THEN 2132 IF (qtmean + sigmaqt1 - qstar .GT. 2.*sigmaqt1)
THEN 2136 min1 = qtmean + sigmaqt1 - qstar
2139 tempb = clfracb/(2.*sigmaqt1)
2141 sigmaqt1b = sigmaqt1b - min1*tempb/sigmaqt1
2143 IF (branch .EQ. 0)
THEN 2144 sigmaqt1b = sigmaqt1b + 2.*min1b
2146 qtmeanb = qtmeanb + min1b
2147 sigmaqt1b = sigmaqt1b + min1b
2148 qstarb = qstarb - min1b
2153 ELSE IF (flag .EQ. 2)
THEN 2155 qtmode = qtmean + (sigmaqt1-sigmaqt2)/3.
2156 IF (qtmode - sigmaqt1 .GT. 0.)
THEN 2160 qtmin = qtmode - sigmaqt1
2163 qtmax = qtmode + sigmaqt2
2164 IF (qtmax .LT. qstar)
THEN 2169 ELSE IF (qtmode .LE. qstar .AND. qstar .LT. qtmax)
THEN 2170 temp = (qtmax-qtmin)*(qtmax-qtmode)
2171 tempb0 = clfracb/temp
2172 tempb1 = 2*(qtmax-qstar)*tempb0
2173 tempb2 = -((qtmax-qstar)**2*tempb0/temp)
2174 qtmaxb = (2*qtmax-qtmin-qtmode)*tempb2 + tempb1
2175 qstarb = qstarb - tempb1
2176 qtminb = -((qtmax-qtmode)*tempb2)
2177 qtmodeb = -((qtmax-qtmin)*tempb2)
2179 ELSE IF (qtmin .LE. qstar .AND. qstar .LT. qtmode)
THEN 2180 temp0 = (qtmax-qtmin)*(qtmode-qtmin)
2181 tempb3 = -(clfracb/temp0)
2182 tempb4 = 2*(qstar-qtmin)*tempb3
2183 tempb5 = -((qstar-qtmin)**2*tempb3/temp0)
2184 qstarb = qstarb + tempb4
2185 qtminb = (2*qtmin-qtmax-qtmode)*tempb5 - tempb4
2186 qtmaxb = (qtmode-qtmin)*tempb5
2187 qtmodeb = (qtmax-qtmin)*tempb5
2190 IF (qstar .LE. qtmin) clfracb = 0.0_8
2195 qtmodeb = qtmodeb + qtmaxb
2196 sigmaqt2b = sigmaqt2b + qtmaxb
2198 IF (branch .NE. 0)
THEN 2199 qtmodeb = qtmodeb + qtminb
2200 sigmaqt1b = sigmaqt1b - qtminb
2202 qtmeanb = qtmeanb + qtmodeb
2203 sigmaqt1b = sigmaqt1b + qtmodeb/3.
2204 sigmaqt2b = sigmaqt2b - qtmodeb/3.
2205 ELSE IF (flag .EQ. 3)
THEN 2208 clfracb = (0.66*( cosh(10*(rh-1.0))**-2)) * clfracb
2212 rhb = (1.0-tanh(q1*(rh-1.0))**2)*0.5*q1*clfracb
2213 qtmeanb = qtmeanb + rhb/qstar
2214 qstarb = qstarb - qtmean*rhb/qstar**2
2217 ELSE IF (flag .EQ. 4)
THEN 2222 clfracb = clfracb * 0.2
2227 IF (rh .LT. q1)
THEN 2229 ELSE IF (rh .GE. q1 .AND. rh .LT. q2)
THEN 2230 rhb = clfracb/((q2/q1-1)*q1)
2234 qtmeanb = qtmeanb + rhb/qstar
2235 qstarb = qstarb - qtmean*rhb/qstar**2
2245 & sigmaqt14b, sigmaqt24, sigmaqt24b, qstar4, qstar4b, condensate4, &
2249 INTEGER,
INTENT(IN) :: flag
2250 REAL*8,
INTENT(IN) :: qtmean4, sigmaqt14, sigmaqt24, qstar4
2251 REAL*8 :: qtmean4b, sigmaqt14b, sigmaqt24b, qstar4b
2253 REAL*8,
INTENT(INOUT) :: condensate4
2254 REAL*8 :: condensate4b
2256 REAL*8 :: qtmode, qtmin, qtmax, consta, constb, cloudf
2257 REAL*8 :: qtmodeb, qtminb, qtmaxb, constab, constbb, cloudfb
2258 REAL*8 :: term1, term2, term3
2259 REAL*8 :: term1b, term2b, term3b
2260 REAL*8 :: qtmean, sigmaqt1, sigmaqt2, qstar, condensate
2261 REAL*8 :: qtmeanb, sigmaqt1b, sigmaqt2b, qstarb, condensateb
2282 sigmaqt1 = sigmaqt14
2283 sigmaqt2 = sigmaqt24
2285 IF (flag .EQ. 1)
THEN 2286 IF (qtmean + sigmaqt1 .LT. qstar)
THEN 2288 ELSE IF (qstar .GT. qtmean - sigmaqt1)
THEN 2289 IF (sigmaqt1 .GT. 0.d0)
THEN 2290 IF (qtmean + sigmaqt1 - qstar .GT. 2.d0*sigmaqt1)
THEN 2291 min1 = 2.d0*sigmaqt1
2294 min1 = qtmean + sigmaqt1 - qstar
2304 ELSE IF (flag .EQ. 2)
THEN 2305 qtmode = qtmean + (sigmaqt1-sigmaqt2)/3.d0
2306 IF (qtmode - sigmaqt1 .GT. 0.d0)
THEN 2310 qtmin = qtmode - sigmaqt1
2313 qtmax = qtmode + sigmaqt2
2314 IF (qtmax .LT. qstar)
THEN 2316 ELSE IF (qtmode .LE. qstar .AND. qstar .LT. qtmax)
THEN 2317 constb = 2.d0/((qtmax-qtmin)*(qtmax-qtmode))
2318 cloudf = (qtmax-qstar)*(qtmax-qstar)/((qtmax-qtmin)*(qtmax-qtmode)&
2320 term1 = qstar*qstar*qstar/3.d0
2321 term2 = qtmax*qstar*qstar/2.d0
2322 term3 = qtmax*qtmax*qtmax/6.d0
2324 ELSE IF (qtmin .LE. qstar .AND. qstar .LT. qtmode)
THEN 2325 consta = 2.d0/((qtmax-qtmin)*(qtmode-qtmin))
2326 cloudf = 1.d0 - (qstar-qtmin)*(qstar-qtmin)/((qtmax-qtmin)*(qtmode&
2328 term1 = qstar*qstar*qstar/3.d0
2329 term2 = qtmin*qstar*qstar/2.d0
2330 term3 = qtmin*qtmin*qtmin/6.d0
2332 ELSE IF (qstar .LE. qtmin)
THEN 2337 ELSE IF (flag .EQ. 3)
THEN 2356 IF (qtmean - qstar .GT. -0.5e-3)
THEN 2364 condensateb = condensate4b
2366 IF (branch .LT. 6)
THEN 2367 IF (branch .LT. 3)
THEN 2368 IF (branch .EQ. 0)
THEN 2372 ELSE IF (branch .EQ. 1)
THEN 2373 tempb = condensateb/(4.d0*sigmaqt1)
2374 min1b = 2*min1*tempb
2375 sigmaqt1b = -(min1**2*tempb/sigmaqt1)
2377 IF (branch .EQ. 0)
THEN 2378 sigmaqt1b = sigmaqt1b + 2.d0*min1b
2383 sigmaqt1b = sigmaqt1b + min1b
2387 qtmeanb = condensateb
2388 qstarb = -condensateb
2391 ELSE IF (branch .EQ. 3)
THEN 2392 qtmeanb = condensateb
2393 qstarb = -condensateb
2396 IF (branch .EQ. 4)
THEN 2403 cloudfb = -(qstar*condensateb)
2404 temp0 = (qtmax-qtmin)*(qtmax-qtmode)
2405 tempb4 = cloudfb/temp0
2406 tempb1 = 2*(qtmax-qstar)*tempb4
2407 tempb0 = constb*condensateb
2408 constbb = (term1-term2+term3)*condensateb
2412 qstarb = qtmax*2*qstar*term2b/2.d0 - tempb1 + 3*qstar**2*term1b/&
2413 & 3.d0 - cloudf*condensateb
2414 tempb3 = -((qtmax-qstar)**2*tempb4/temp0)
2415 temp = (qtmax-qtmin)*(qtmax-qtmode)
2416 tempb2 = -(2.d0*constbb/temp**2)
2417 qtmaxb = qstar**2*term2b/2.d0 + (2*qtmax-qtmin-qtmode)*tempb2 + &
2418 & (2*qtmax-qtmin-qtmode)*tempb3 + tempb1 + 3*qtmax**2*term3b/&
2420 qtminb = -((qtmax-qtmode)*tempb2) - (qtmax-qtmode)*tempb3
2421 qtmodeb = -((qtmax-qtmin)*tempb2) - (qtmax-qtmin)*tempb3
2428 ELSE IF (branch .LT. 9)
THEN 2429 IF (branch .EQ. 6)
THEN 2430 cloudfb = -(qstar*condensateb)
2431 temp2 = (qtmax-qtmin)*(qtmode-qtmin)
2432 tempb9 = -(cloudfb/temp2)
2433 tempb6 = 2*(qstar-qtmin)*tempb9
2434 tempb5 = -(consta*condensateb)
2435 qtmeanb = condensateb
2436 constab = -((term1-term2+term3)*condensateb)
2440 qstarb = qtmin*2*qstar*term2b/2.d0 + tempb6 + 3*qstar**2*term1b/&
2441 & 3.d0 - cloudf*condensateb
2442 tempb8 = -((qstar-qtmin)**2*tempb9/temp2)
2443 temp1 = (qtmax-qtmin)*(qtmode-qtmin)
2444 tempb7 = -(2.d0*constab/temp1**2)
2445 qtminb = qstar**2*term2b/2.d0 + (2*qtmin-qtmax-qtmode)*tempb7 + (2&
2446 & *qtmin-qtmax-qtmode)*tempb8 - tempb6 + 3*qtmin**2*term3b/6.d0
2447 qtmaxb = (qtmode-qtmin)*tempb7 + (qtmode-qtmin)*tempb8
2448 qtmodeb = (qtmax-qtmin)*tempb7 + (qtmax-qtmin)*tempb8
2450 IF (branch .EQ. 7)
THEN 2451 qtmeanb = condensateb
2452 qstarb = -condensateb
2462 IF (branch .EQ. 9)
THEN 2463 qtmeanb = condensateb
2464 qstarb = -condensateb
2465 ELSE IF (branch .EQ. 10)
THEN 2476 100 qtmodeb = qtmodeb + qtmaxb
2479 IF (branch .EQ. 0)
THEN 2482 qtmodeb = qtmodeb + qtminb
2485 qtmeanb = qtmeanb + qtmodeb
2486 sigmaqt1b = sigmaqt1b + qtmodeb/3.d0
2487 sigmaqt2b = sigmaqt2b - qtmodeb/3.d0
2488 110 qstar4b = qstar4b + qstarb
2489 sigmaqt24b = sigmaqt2b
2490 sigmaqt14b = sigmaqt1b
2497 SUBROUTINE evap_cnv_b(dt, rhcr, pl, te, teb, qv, qvb, ql, qlb, qi, qib, &
2498 & f, fb, xf, qs, qsb, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, &
2499 & cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp)
2502 REAL*8,
INTENT(IN) :: dt, rhcr, pl, xf, qs, rho_w, cld_evp_eff
2504 REAL*8,
INTENT(IN) :: cons_h2omw, cons_airmw, cons_alhl, cons_rvap, &
2505 & cons_rgas, cons_pi, cons_cp
2507 REAL*8,
INTENT(INOUT) :: te, qv, ql, qi, f
2508 REAL*8 :: teb, qvb, qlb, qib, fb
2510 REAL*8 :: es, radius, k1, k2, teff, qcm, evap, rhx, qc, a_eff, epsilon
2511 REAL*8 :: esb, radiusb, k1b, k2b, teffb, qcmb, evapb, rhxb, qcb
2512 REAL*8,
PARAMETER :: k_cond=2.4e-2
2513 REAL*8,
PARAMETER :: diffu=2.2e-5
2514 REAL*8,
PARAMETER :: nn=50.*1.0e6
2528 epsilon = cons_h2omw/cons_airmw
2532 es = 100.*pl*qs/(epsilon+(1.0-epsilon)*qs)
2533 IF (qv/qs .GT. 1.00)
THEN 2540 k1 = cons_alhl**2*rho_w/(k_cond*cons_rvap*te**2)
2541 k2 = cons_rvap*te*rho_w/(diffu*(1000./pl)*es)
2543 IF (f .GT. 0. .AND. ql .GT. 0.)
THEN 2550 CALL ldradius(pl, te, qcm, nn, rho_w, radius, cons_rgas, cons_pi)
2551 IF (rhx .LT. rhcr .AND. radius .GT. 0.0)
THEN 2553 teff = (rhcr-rhx)/((k1+k2)*radius**2)
2560 evap = a_eff*ql*dt*teff
2561 IF (evap .GT. ql)
THEN 2569 IF (qc .GT. 0.)
THEN 2574 evapb = qvb - qlb - cons_alhl*teb/cons_cp
2576 IF (branch .EQ. 0)
THEN 2578 tempb4 = (qc-evap)*fb/qc
2579 qcb = temp3*fb - temp3*tempb4
2580 evapb = evapb - temp3*fb
2588 IF (branch .EQ. 0)
THEN 2592 tempb3 = a_eff*dt*evapb
2593 qlb = qlb + teff*tempb3
2596 IF (branch .EQ. 0)
THEN 2602 temp2 = (k1+k2)*radius**2
2603 tempb1 = -((rhcr-rhx)*teffb/temp2**2)
2604 tempb2 = radius**2*tempb1
2605 rhxb = -(teffb/temp2)
2608 radiusb = (k1+k2)*2*radius*tempb1
2610 CALL ldradius_b(pl, te, teb, qcm, qcmb, nn, rho_w, radius, radiusb, &
2611 & cons_rgas, cons_pi)
2614 IF (branch .EQ. 0)
THEN 2616 fb = fb - ql*qcmb/f**2
2618 temp0 = k_cond*cons_rvap*te**2
2619 temp1 = 1000.*diffu*es
2620 tempb0 = cons_rvap*rho_w*pl*k2b/temp1
2621 teb = teb + tempb0 - k_cond*cons_rvap*cons_alhl**2*rho_w*2*te*k1b/&
2623 esb = -(te*diffu*1000.*tempb0/temp1)
2625 IF (branch .NE. 0)
THEN 2627 qsb = qsb - qv*rhxb/qs**2
2629 temp = epsilon + (-epsilon+1.0)*qs
2630 tempb = pl*100.*esb/temp
2631 qsb = qsb + (1.0_8-qs*(1.0-epsilon)/temp)*tempb
2637 SUBROUTINE subl_cnv_b(dt, rhcr, pl, te, teb, qv, qvb, ql, qlb, qi, qib, &
2638 & f, fb, xf, qs, qsb, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, &
2639 & cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp, cons_alhs)
2642 REAL*8,
INTENT(IN) :: dt, rhcr, pl, xf, qs, rho_w, cld_evp_eff
2644 REAL*8,
INTENT(IN) :: cons_h2omw, cons_airmw, cons_alhl, cons_rvap, &
2645 & cons_rgas, cons_pi, cons_cp, cons_alhs
2647 REAL*8,
INTENT(INOUT) :: te, qv, ql, qi, f
2648 REAL*8 :: teb, qvb, qlb, qib, fb
2650 REAL*8 :: es, radius, k1, k2, teff, qcm, subl, rhx, qc, a_eff, nn, &
2652 REAL*8 :: esb, radiusb, k1b, k2b, teffb, qcmb, sublb, rhxb, qcb
2653 REAL*8,
PARAMETER :: k_cond=2.4e-2
2654 REAL*8,
PARAMETER :: diffu=2.2e-5
2668 epsilon = cons_h2omw/cons_airmw
2672 es = 100.*pl*qs/(epsilon+(1.0-epsilon)*qs)
2673 IF (qv/qs .GT. 1.00)
THEN 2680 k1 = cons_alhl**2*rho_w/(k_cond*cons_rvap*te**2)
2681 k2 = cons_rvap*te*rho_w/(diffu*(1000./pl)*es)
2683 IF (f .GT. 0. .AND. qi .GT. 0.)
THEN 2690 CALL ldradius(pl, te, qcm, nn, rho_w, radius, cons_rgas, cons_pi)
2691 IF (rhx .LT. rhcr .AND. radius .GT. 0.0)
THEN 2693 teff = (rhcr-rhx)/((k1+k2)*radius**2)
2700 subl = a_eff*qi*dt*teff
2701 IF (subl .GT. qi)
THEN 2709 IF (qc .GT. 0.)
THEN 2714 sublb = qvb - qib - cons_alhs*teb/cons_cp
2716 IF (branch .EQ. 0)
THEN 2718 tempb4 = (qc-subl)*fb/qc
2719 qcb = temp3*fb - temp3*tempb4
2720 sublb = sublb - temp3*fb
2728 IF (branch .EQ. 0)
THEN 2732 tempb3 = a_eff*dt*sublb
2733 qib = qib + teff*tempb3
2736 IF (branch .EQ. 0)
THEN 2742 temp2 = (k1+k2)*radius**2
2743 tempb1 = -((rhcr-rhx)*teffb/temp2**2)
2744 tempb2 = radius**2*tempb1
2745 rhxb = -(teffb/temp2)
2748 radiusb = (k1+k2)*2*radius*tempb1
2750 CALL ldradius_b(pl, te, teb, qcm, qcmb, nn, rho_w, radius, radiusb, &
2751 & cons_rgas, cons_pi)
2754 IF (branch .EQ. 0)
THEN 2756 fb = fb - qi*qcmb/f**2
2758 temp0 = k_cond*cons_rvap*te**2
2759 temp1 = 1000.*diffu*es
2760 tempb0 = cons_rvap*rho_w*pl*k2b/temp1
2761 teb = teb + tempb0 - k_cond*cons_rvap*cons_alhl**2*rho_w*2*te*k1b/&
2763 esb = -(te*diffu*1000.*tempb0/temp1)
2765 IF (branch .NE. 0)
THEN 2767 qsb = qsb - qv*rhxb/qs**2
2769 temp = epsilon + (-epsilon+1.0)*qs
2770 tempb = pl*100.*esb/temp
2771 qsb = qsb + (1.0_8-qs*(1.0-epsilon)/temp)*tempb
2777 SUBROUTINE ldradius_b(pl, te, teb, qcl, qclb, nn, rho_w, radius, radiusb&
2778 & , cons_rgas, cons_pi)
2781 REAL*8,
INTENT(IN) :: te, pl, nn, qcl, rho_w
2783 REAL*8,
INTENT(IN) :: cons_rgas, cons_pi
2793 temp2 = 4.*cons_rgas*cons_pi*nn*rho_w
2797 IF (temp0*temp .LE. 0.0 .AND. (1.0/3. .EQ. 0.0 .OR. 1.0/3. .NE. int(&
2801 tempb = temp0*(temp0*temp)**(1.0/3.-1)*radiusb/(3.*temp1)
2804 teb = teb - temp*temp2*tempb
2811 & , sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
2814 REAL*8,
INTENT(IN) :: dt, te, pl, dzet, sundqv2, sundqv3, sundqt1, &
2818 REAL*8,
INTENT(INOUT) :: qc, qp, f
2819 REAL*8 :: qcb, qpb, fb
2821 REAL*8 :: acf0, acf, c00x, iqccrx, f2, f3, rate, dqp, qcm, dqfac
2822 REAL*8 :: c00xb, iqccrxb, f2b, f3b, rateb, dqpb, qcmb, dqfacb
2842 CALL cons_sundq3(te, sundqv2, sundqv3, sundqt1, f2, f3)
2844 iqccrx = f2*f3/lwcrit
2845 IF (f .GT. 0. .AND. qc .GT. 0.)
THEN 2852 rate = c00x*(1.0-exp(-((qcm*iqccrx)**2)))
2858 IF (pl .GE. 775. .AND. te .LE. 275.) f3 = 0.2
2860 IF (pl .GE. 825. .AND. te .LE. 282.) f3 = 0.2
2862 IF (pl .GE. 775. .AND. pl .LT. 825. .AND. te .LE. 282. .AND. te .GT. &
2865 IF (pl .GE. 825. .AND. te .LE. 275.) f3 = 0.2
2866 IF (pl .LE. 775. .OR. te .GT. 282.) f3 = 1.
2868 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 2869 IF (0.2*te - 56 .GT. 2.)
THEN 2879 IF (pl .GE. 925. .AND. te .GE. 290.)
THEN 2880 IF (0.04*pl - 36. .GT. 2.)
THEN 2890 IF (pl .GE. 925. .AND. pl .LT. 950. .AND. te .GT. 285. .AND. te .LT. &
2892 IF (0.04*pl + 0.2*te - 94. .GT. 2.)
THEN 2896 x1 = 0.04*pl + 0.2*te - 94.
2899 IF (x1 .LT. 1.)
THEN 2909 IF (pl .GE. 950. .AND. te .GE. 290.)
THEN 2915 IF (f3 .LT. 0.1)
THEN 2924 dqp = qc*(1.0-exp(-(rate*dt)))
2925 IF (dqp .LT. 0.0)
THEN 2934 IF (pl .GE. 975. .AND. te .GE. 280.)
THEN 2935 IF (0.2*te - 56. .GT. 1.)
THEN 2942 IF (x2 .LT. 0.)
THEN 2952 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 2953 IF (0.04*pl - 38. .GT. 1.)
THEN 2960 IF (x3 .LT. 0.)
THEN 2968 IF (pl .GE. 950. .AND. pl .LT. 975. .AND. te .GT. 280. .AND. te .LT. &
2970 IF (0.04*pl + 0.2*te - 95. .GT. 1.)
THEN 2974 x4 = 0.04*pl + 0.2*te - 95.
2977 IF (x4 .LT. 0.)
THEN 2987 IF (pl .GE. 975. .AND. te .GE. 285.)
THEN 2993 IF (dqp .LT. dqfac*qc)
THEN 3003 IF (qc + dqp .GT. 0.)
THEN 3004 tempb0 = fb/(qc+dqp)
3005 tempb1 = -(qc*f*tempb0/(qc+dqp))
3006 qcb = qcb + tempb1 + f*tempb0
3012 dqpb = dqpb + qpb - qcb
3015 IF (branch .EQ. 0)
THEN 3017 qcb = qcb + dqfac*dqpb
3023 IF (branch .NE. 0) dqfacb = 0.0_8
3025 IF (branch .NE. 0)
THEN 3026 IF (branch .EQ. 1)
THEN 3032 IF (branch .NE. 0) teb = teb + 0.2*x4b
3036 IF (branch .NE. 0) dqfacb = 0.0_8
3038 IF (branch .NE. 0)
THEN 3039 IF (branch .EQ. 1)
THEN 3045 IF (branch .NE. 0) teb = teb + 0.2*x2b
3048 IF (branch .EQ. 0) dqpb = 0.0_8
3049 qcb = qcb + (1.0-exp(-(dt*rate)))*dqpb
3050 rateb = exp(-(dt*rate))*qc*dt*dqpb
3055 IF (branch .EQ. 0) f3b = 0.0_8
3057 IF (branch .NE. 0) f3b = 0.0_8
3059 IF (branch .NE. 0)
THEN 3060 IF (branch .EQ. 1)
THEN 3066 IF (branch .NE. 0) teb = teb + 0.2*x1b
3070 IF (branch .NE. 0) f3b = 0.0_8
3072 IF (branch .NE. 0)
THEN 3073 IF (branch .EQ. 1) teb = teb + 0.2*f3b
3077 tempb = exp(-(temp**2))*c00x*2*temp*rateb
3078 c00xb = (1.0-exp(-(temp**2)))*rateb
3082 IF (branch .EQ. 0)
THEN 3084 fb = fb - qc*qcmb/f**2
3086 f2b = c_00*f3*c00xb + f3*iqccrxb/lwcrit
3089 CALL cons_sundq3_b(te, teb, sundqv2, sundqv3, sundqt1, f2, f2b, f3)
3096 & , sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
3099 REAL*8,
INTENT(IN) :: dt, te, pl, dzet, sundqv2, sundqv3, sundqt1, &
3103 REAL*8,
INTENT(INOUT) :: qc, qp, f
3104 REAL*8 :: qcb, qpb, fb
3106 REAL*8 :: acf0, acf, c00x, iqccrx, f2, f3, rate, dqp, qcm, dqfac
3107 REAL*8 :: c00xb, iqccrxb, f2b, f3b, rateb, dqpb, qcmb, dqfacb
3125 CALL cons_sundq3(te, sundqv2, sundqv3, sundqt1, f2, f3)
3127 iqccrx = f2*f3/lwcrit
3128 IF (f .GT. 0. .AND. qc .GT. 0.)
THEN 3135 rate = c00x*(1.0-exp(-((qcm*iqccrx)**2)))
3141 IF (pl .GE. 775. .AND. te .LE. 275.) f3 = 0.2
3143 IF (pl .GE. 825. .AND. te .LE. 282.) f3 = 0.2
3145 IF (pl .GE. 775. .AND. pl .LT. 825. .AND. te .LE. 282. .AND. te .GT. &
3148 IF (pl .GE. 825. .AND. te .LE. 275.) f3 = 0.2
3149 IF (pl .LE. 775. .OR. te .GT. 282.) f3 = 1.
3151 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 3152 IF (0.2*te - 56 .GT. 2.)
THEN 3162 IF (pl .GE. 925. .AND. te .GE. 290.)
THEN 3163 IF (0.04*pl - 36. .GT. 2.)
THEN 3173 IF (pl .GE. 925. .AND. pl .LT. 950. .AND. te .GT. 285. .AND. te .LT. &
3175 IF (0.04*pl + 0.2*te - 94. .GT. 2.)
THEN 3179 x1 = 0.04*pl + 0.2*te - 94.
3182 IF (x1 .LT. 1.)
THEN 3192 IF (pl .GE. 950. .AND. te .GE. 290.)
THEN 3198 IF (f3 .LT. 0.1)
THEN 3207 dqp = qc*(1.0-exp(-(rate*dt)))
3208 IF (dqp .LT. 0.0)
THEN 3217 IF (pl .GE. 975. .AND. te .GE. 280.)
THEN 3218 IF (0.2*te - 56. .GT. 1.)
THEN 3225 IF (x2 .LT. 0.)
THEN 3235 IF (pl .GE. 950. .AND. te .GE. 285.)
THEN 3236 IF (0.04*pl - 38. .GT. 1.)
THEN 3243 IF (x3 .LT. 0.)
THEN 3251 IF (pl .GE. 950. .AND. pl .LT. 975. .AND. te .GT. 280. .AND. te .LT. &
3253 IF (0.04*pl + 0.2*te - 95. .GT. 1.)
THEN 3257 x4 = 0.04*pl + 0.2*te - 95.
3260 IF (x4 .LT. 0.)
THEN 3270 IF (pl .GE. 975. .AND. te .GE. 285.)
THEN 3276 IF (dqp .LT. dqfac*qc)
THEN 3283 IF (branch .EQ. 0)
THEN 3285 qcb = qcb + dqfac*dqpb
3291 IF (branch .NE. 0) dqfacb = 0.0_8
3293 IF (branch .NE. 0)
THEN 3294 IF (branch .EQ. 1)
THEN 3300 IF (branch .NE. 0) teb = teb + 0.2*x4b
3304 IF (branch .NE. 0) dqfacb = 0.0_8
3306 IF (branch .NE. 0)
THEN 3307 IF (branch .EQ. 1)
THEN 3313 IF (branch .NE. 0) teb = teb + 0.2*x2b
3316 IF (branch .EQ. 0) dqpb = 0.0_8
3317 qcb = qcb + (1.0-exp(-(dt*rate)))*dqpb
3318 rateb = exp(-(dt*rate))*qc*dt*dqpb
3323 IF (branch .EQ. 0) f3b = 0.0_8
3325 IF (branch .NE. 0) f3b = 0.0_8
3327 IF (branch .NE. 0)
THEN 3328 IF (branch .EQ. 1)
THEN 3334 IF (branch .NE. 0) teb = teb + 0.2*x1b
3338 IF (branch .NE. 0) f3b = 0.0_8
3340 IF (branch .NE. 0)
THEN 3341 IF (branch .EQ. 1) teb = teb + 0.2*f3b
3345 tempb = exp(-(temp**2))*c00x*2*temp*rateb
3346 c00xb = (1.0-exp(-(temp**2)))*rateb
3350 IF (branch .EQ. 0)
THEN 3352 fb = fb - qc*qcmb/f**2
3354 f2b = c_00*f3*c00xb + f3*iqccrxb/lwcrit
3357 CALL cons_sundq3_b(te, teb, sundqv2, sundqv3, sundqt1, f2, f2b, f3)
3364 & icefrpwr, icefrct, icefrctb)
3367 REAL*8,
INTENT(IN) :: temp, t_ice_all, t_ice_max
3369 INTEGER,
INTENT(IN) :: icefrpwr
3377 IF (temp .LE. t_ice_all)
THEN 3380 ELSE IF (temp .GT. t_ice_all .AND. temp .LE. t_ice_max)
THEN 3381 icefrct = 1.00 - (temp-t_ice_all)/(t_ice_max-t_ice_all)
3386 IF (icefrct .GT. 1.00)
THEN 3393 IF (icefrct .LT. 0.00)
THEN 3400 IF (icefrct .LE. 0.0 .AND. (icefrpwr .EQ. 0.0 .OR. icefrpwr .NE. int(&
3404 icefrctb = icefrpwr*icefrct**(icefrpwr-1)*icefrctb
3407 IF (branch .EQ. 0) icefrctb = 0.0_8
3409 IF (branch .EQ. 0) icefrctb = 0.0_8
3411 IF (branch .NE. 0)
THEN 3412 IF (branch .EQ. 1) tempb = tempb - icefrctb/(t_ice_max-t_ice_all)
3419 SUBROUTINE cons_sundq3_b(temp, tempb, rate2, rate3, te1, f2, f2b, f3)
3422 REAL*8,
INTENT(IN) :: rate2, rate3, te1, temp
3428 REAL*8,
PARAMETER :: te0=273.
3429 REAL*8,
PARAMETER :: te2=200.
3435 jump1 = (rate2-1.0)/(te0-te1)**0.333
3437 IF (temp .GE. te0) f2 = 1.0
3438 IF (temp .GE. te1 .AND. temp .LT. te0)
THEN 3439 IF (te0 - temp .GE. 0.)
THEN 3444 IF (abs0 .GT. 0.0)
THEN 3446 f2 = 1.0 + jump1*(te0-temp)**0.3333
3455 IF (temp .LT. te1)
THEN 3456 f2 = rate2 + (rate3-rate2)*(te1-temp)/(te1-te2)
3461 IF (f2 .GT. 27.0) f2b = 0.0_8
3463 IF (branch .NE. 0)
THEN 3464 tempb = tempb - (rate3-rate2)*f2b/(te1-te2)
3468 IF (branch .EQ. 0) tempb = tempb - 0.3333*(te0-temp)**(-0.6667)*jump1*&
3476 & , bbb, cons_h2omw, cons_airmw, cons_rvap, alhx3, alhx3b)
3479 REAL*8,
INTENT(IN) :: temp, q_sat, pr, alhx3
3480 REAL*8 :: tempb1, q_satb, alhx3b
3481 REAL*8,
INTENT(IN) :: cons_h2omw, cons_airmw, cons_rvap
3486 REAL*8,
PARAMETER :: k_cond=2.4e-2
3487 REAL*8,
PARAMETER :: diffu=2.2e-5
3488 REAL*8 :: e_sat, epsi
3495 epsi = cons_h2omw/cons_airmw
3497 e_sat = 100.*pr*q_sat/(epsi+(1.0-epsi)*q_sat)
3498 temp1 = k_cond*cons_rvap*temp**2
3499 temp2 = 1000.*diffu*e_sat
3500 tempb = cons_rvap*pr*bbb/temp2
3501 tempb1 = tempb1 + tempb - k_cond*cons_rvap*alhx3**2*2*temp*aab/temp1**&
3503 e_satb = -(temp*diffu*1000.*tempb/temp2)
3504 alhx3b = alhx3b + 2*alhx3*aab/temp1
3505 temp0 = epsi + (-epsi+1.0)*q_sat
3506 tempb0 = pr*100.*e_satb/temp0
3507 q_satb = q_satb + (1.0_8-q_sat*(1.0-epsi)/temp0)*tempb0
3513 SUBROUTINE cons_alhx_b(t, tb, alhx3, alhx3b, t_ice_max, t_ice_all, &
3514 & cons_alhs, cons_alhl)
3517 REAL*8,
INTENT(IN) :: t, t_ice_max, t_ice_all
3519 REAL*8,
INTENT(IN) :: cons_alhs, cons_alhl
3524 IF (t .LT. t_ice_all)
THEN 3529 IF (t .GT. t_ice_max)
THEN 3534 IF (t .LE. t_ice_max .AND. t .GE. t_ice_all)
THEN 3535 tb = tb + (cons_alhl-cons_alhs)*alhx3b/(t_ice_max-t_ice_all)
3539 IF (branch .EQ. 0) alhx3b = 0.0_8
3541 IF (branch .EQ. 0) alhx3b = 0.0_8
3548 & cons_rgas, khu, khl, k, dt, dz, dzb, qp, qpb, anv_icefall_c)
3551 REAL*8,
INTENT(IN) :: wxr, pl, te, dz, dt, anv_icefall_c
3553 REAL*8,
INTENT(IN) :: cons_rgas
3554 INTEGER,
INTENT(IN) :: khu, khl, k
3555 REAL*8,
INTENT(INOUT) :: qi, f, qp
3556 REAL*8 :: qib, fb, qpb
3558 REAL*8 :: rho, xim, lxim, qixp, vf
3559 REAL*8 :: rhob, ximb, lximb, qixpb, vfb
3568 rho = 1000.*100.*pl/(cons_rgas*te)
3569 IF (f .GT. 0. .AND. qi .GT. 0.)
THEN 3576 IF (xim .GT. 0.)
THEN 3583 vf = 128.6 + 53.2*lxim + 5.5*lxim**2
3586 IF (wxr .GT. 0.)
THEN 3587 IF (pl .LT. 10.)
THEN 3592 vf = vf*(100./max1)**wxr
3598 IF (khu .GT. 0 .AND. khl .GT. 0)
THEN 3599 IF (k - 1 .GE. khu .AND. k - 1 .LE. khl)
THEN 3608 vf = anv_icefall_c*vf
3609 qixp = qi*(vf*dt/dz)
3610 IF (qixp .GT. qi)
THEN 3617 IF (qixp .LT. 0.0)
THEN 3624 IF (branch .EQ. 0) qixpb = 0.0_8
3626 IF (branch .EQ. 0)
THEN 3630 tempb0 = dt*qixpb/dz
3631 qib = qib + vf*tempb0
3633 dzb = dzb - qi*vf*tempb0/dz
3634 vfb = anv_icefall_c*vfb
3636 IF (branch .NE. 0)
THEN 3637 IF (branch .NE. 1) vfb = 0.01*vfb
3641 IF (branch .EQ. 0) vfb = (100./max1)**wxr*vfb
3642 lximb = (5.5*2*lxim+53.2)*vfb
3644 IF (branch .EQ. 0)
THEN 3645 ximb = lximb/(xim*log(10.0))
3650 IF (branch .EQ. 0)
THEN 3652 qib = qib + rho*tempb
3654 fb = fb - qi*rho*tempb/f
3658 teb = teb - pl*100.*1000.*rhob/(cons_rgas*te**2)
3665 & cons_rgas, khu, khl, k, dt, dz, dzb, qp, qpb, ls_icefall_c)
3668 REAL*8,
INTENT(IN) :: wxr, pl, te, dz, dt, ls_icefall_c
3670 REAL*8,
INTENT(IN) :: cons_rgas
3671 INTEGER,
INTENT(IN) :: khu, khl, k
3672 REAL*8,
INTENT(INOUT) :: qi, f, qp
3673 REAL*8 :: qib, fb, qpb
3675 REAL*8 :: rho, xim, lxim, qixp, vf
3676 REAL*8 :: rhob, ximb, qixpb, vfb
3689 rho = 1000.*100.*pl/(cons_rgas*te)
3690 IF (f .GT. 0. .AND. qi .GT. 0.)
THEN 3697 IF (xim .GE. 0.)
THEN 3702 IF (abs0 .GT. 0.0)
THEN 3704 vf = 109.0*xim**0.16
3712 IF (wxr .GT. 0.)
THEN 3713 IF (pl .LT. 10.)
THEN 3718 vf = vf*(100./max1)**wxr
3724 IF (khu .GT. 0 .AND. khl .GT. 0)
THEN 3725 IF (k - 1 .GE. khu .AND. k - 1 .LE. khl)
THEN 3734 vf = ls_icefall_c*vf
3735 qixp = qi*(vf*dt/dz)
3736 IF (qixp .GT. qi)
THEN 3743 IF (qixp .LT. 0.0)
THEN 3752 IF (qi + qixp .GT. 0.)
THEN 3753 tempb1 = fb/(qi+qixp)
3754 tempb2 = -(qi*f*tempb1/(qi+qixp))
3755 qib = qib + tempb2 + f*tempb1
3762 qixpb = qixpb + qpb - qib
3764 IF (branch .EQ. 0) qixpb = 0.0_8
3766 IF (branch .EQ. 0)
THEN 3770 tempb0 = dt*qixpb/dz
3771 qib = qib + vf*tempb0
3773 dzb = dzb - qi*vf*tempb0/dz
3774 vfb = ls_icefall_c*vfb
3776 IF (branch .NE. 0)
THEN 3777 IF (branch .NE. 1) vfb = 0.01*vfb
3781 IF (branch .EQ. 0) vfb = (100./max1)**wxr*vfb
3783 IF (branch .EQ. 0)
THEN 3784 ximb = 109.0*0.16*xim**(-0.84)*vfb
3789 IF (branch .EQ. 0)
THEN 3791 qib = qib + rho*tempb
3793 fb = fb - qi*rho*tempb/f
3797 teb = teb - pl*100.*1000.*rhob/(cons_rgas*te**2)
3807 SUBROUTINE precipandevap_b(k, ktop, lm, dt, frland, rhcr3, qpl, qplb, &
3808 & qpi, qpib, qcl, qclb, qci, te, teb, qv, qvb, mass, imass, pl, dze, &
3809 & dzeb, qddf3, qddf3b, aa, aab, bb, bbb, area, areab, pfl_above_in, &
3810 & pfl_above_inb, pfl_above_out, pfl_above_outb, pfi_above_in, &
3811 & pfi_above_inb, pfi_above_out, pfi_above_outb, evap_dd_above_in, &
3812 & evap_dd_above_inb, evap_dd_above_out, evap_dd_above_outb, &
3813 & subl_dd_above_in, subl_dd_above_inb, subl_dd_above_out, &
3814 & subl_dd_above_outb, envfc, ddrfc, cons_alhf, cons_alhs, cons_alhl, &
3815 & cons_cp, cons_tice, cons_h2omw, cons_airmw, revap_off_p, c_acc, c_ev_r&
3816 & , c_ev_s, rho_w, estblx)
3819 INTEGER,
INTENT(IN) :: k, lm, ktop
3820 REAL*8,
INTENT(IN) :: dt, mass, imass, pl, aa, bb, rhcr3, dze, qddf3, &
3821 & area, frland, envfc, ddrfc
3822 REAL*8 :: aab, bbb, dzeb, qddf3b, areab
3823 REAL*8,
INTENT(IN) :: cons_alhf, cons_alhs, cons_alhl, cons_cp, &
3824 & cons_tice, cons_h2omw, cons_airmw
3825 REAL*8,
INTENT(IN) :: revap_off_p
3826 REAL*8,
INTENT(IN) :: c_acc, c_ev_r, c_ev_s, rho_w
3827 REAL*8,
INTENT(IN) :: estblx(:)
3829 REAL*8,
INTENT(INOUT) :: qv, qpl, qpi, qcl, qci, te
3830 REAL*8 :: qvb, qplb, qpib, qclb, teb
3831 REAL*8,
INTENT(INOUT) :: pfl_above_in, pfl_above_out, pfi_above_in, &
3833 REAL*8 :: pfl_above_inb, pfl_above_outb, pfi_above_inb, pfi_above_outb
3834 REAL*8,
INTENT(INOUT) :: evap_dd_above_in, evap_dd_above_out, &
3835 & subl_dd_above_in, subl_dd_above_out
3836 REAL*8 :: evap_dd_above_inb, evap_dd_above_outb, subl_dd_above_inb, &
3837 & subl_dd_above_outb
3839 INTEGER :: ns, nsmx, itr, l
3840 REAL*8 :: pfi, pfl, qs, dqs, envfrac, tko, qko, qstko, dqstko, rh_box&
3841 & , t_ed, qplko, qpiko
3842 REAL*8 :: pfib, pflb, qsb, dqsb, tkob, qkob, qstkob, dqstkob, rh_boxb&
3844 REAL*8 :: ifactor, rainrat0, snowrat0, fallrn, fallsn, vesn, vern, &
3845 & nrain, nsnow, efactor
3846 REAL*8 :: ifactorb, rainrat0b, snowrat0b, fallrnb, fallsnb, vesnb, &
3848 REAL*8 :: tinlayerrn, diamrn, droprad, tinlayersn, diamsn, flakrad
3849 REAL*8 :: tinlayerrnb, diamrnb, dropradb, tinlayersnb, diamsnb, &
3851 REAL*8 :: evap, subl, accr, mltfrz, evapx, sublx, evap_dd, subl_dd, &
3853 REAL*8 :: evapb, sublb, accrb, mltfrzb, evap_ddb, subl_ddb
3854 REAL*8 :: tau_frz, tau_mlt
3856 REAL*8,
PARAMETER :: trmv_l=1.0
3857 LOGICAL,
PARAMETER :: taneff=.false.
3859 REAL*8,
PARAMETER :: b_sub=1.00
3881 IF (area .GT. 0.)
THEN 3888 IF (ifactor .LT. 1.)
THEN 3902 CALL dqsats_bac(dqs, qs, te, pl, estblx, cons_h2omw, cons_airmw)
3904 IF (k .EQ. ktop)
THEN 3910 qpl = qpl + pfl_above_in*imass
3912 qpi = qpi + pfi_above_in*imass
3913 accr = b_sub*c_acc*(qpl*mass)*qcl
3914 IF (accr .GT. qcl)
THEN 3926 accr = b_sub*c_acc*(qpi*mass)*qcl
3927 IF (accr .GT. qcl)
THEN 3938 te = te + cons_alhf*accr/cons_cp
3939 rainrat0 = ifactor*qpl*mass/dt
3940 snowrat0 = ifactor*qpi*mass/dt
3942 CALL marshpalm(rainrat0, pl, diamrn, nrain, fallrn, vern)
3944 CALL marshpalm(snowrat0, pl, diamsn, nsnow, fallsn, vesn)
3945 tinlayerrn = dze/(fallrn+0.01)
3946 tinlayersn = dze/(fallsn+0.01)
3950 IF (te .GT. cons_tice .AND. te .LE. cons_tice + 5.)
THEN 3951 mltfrz = tinlayersn*qpi*(te-cons_tice)/tau_frz
3952 IF (qpi .GT. mltfrz)
THEN 3960 te = te - cons_alhf*mltfrz/cons_cp
3969 IF (te .GT. cons_tice + 5.)
THEN 3972 te = te - cons_alhf*mltfrz/cons_cp
3981 IF (k .GE. lm - 1)
THEN 3982 IF (te .GT. cons_tice + 0.)
THEN 3985 te = te - cons_alhf*mltfrz/cons_cp
3998 IF (te .LE. cons_tice)
THEN 3999 te = te + cons_alhf*qpl/cons_cp
4015 qstko = qs + dqstko*(tko-te)
4016 IF (qstko .LT. 1.0e-7)
THEN 4024 IF (rh_box .LT. rhcr3)
THEN 4025 efactor = rho_w*(aa+bb)/(rhcr3-rh_box)
4033 IF (rh_box .LT. rhcr3 .AND. diamrn .GT. 0.00 .AND. pl .GT. 100. &
4034 & .AND. pl .LT. revap_off_p)
THEN 4035 droprad = 0.5*diamrn
4036 t_ed = efactor*droprad**2
4038 t_ed = t_ed*(1.0+dqstko*cons_alhl/cons_cp)
4039 evap = qpl*(1.0-exp(-(c_ev_r*vern*landseaf*envfrac*tinlayerrn/t_ed&
4047 IF (rh_box .LT. rhcr3 .AND. diamsn .GT. 0.00 .AND. pl .GT. 100. &
4048 & .AND. pl .LT. revap_off_p)
THEN 4049 flakrad = 0.5*diamsn
4051 t_ed = efactor*flakrad**2
4053 t_ed = t_ed*(1.0+dqstko*cons_alhs/cons_cp)
4054 subl = qpi*(1.0-exp(-(c_ev_s*vesn*landseaf*envfrac*tinlayersn/t_ed&
4070 evap_dd = evap_dd_above_in + ddfract*evap*mass
4071 subl_dd = subl_dd_above_in + ddfract*subl*mass
4074 sublb = qvb - cons_alhs*teb/cons_cp
4075 evapb = qvb - cons_alhl*teb/cons_cp
4076 subl_ddb = qddf3*sublb/mass + subl_dd_above_outb
4077 evap_ddb = qddf3*evapb/mass + evap_dd_above_outb
4078 pfib = pfi_above_outb
4079 pflb = pfl_above_outb
4080 qddf3b = qddf3b + evap_dd*evapb/mass + subl_dd*sublb/mass
4082 IF (branch .EQ. 0)
THEN 4085 pfl_above_inb = 0.0_8
4086 pfi_above_inb = 0.0_8
4087 evap_dd_above_inb = 0.0_8
4088 subl_dd_above_inb = 0.0_8
4095 evapb = qvb - cons_alhl*teb/cons_cp
4096 sublb = qvb - cons_alhs*teb/cons_cp
4097 sublb = ddfract*mass*subl_ddb - qpib + (1.0_8-ddfract)*sublb
4098 subl_dd_above_inb = subl_ddb
4099 evapb = ddfract*mass*evap_ddb - qplb + (1.0_8-ddfract)*evapb
4100 evap_dd_above_inb = evap_ddb
4102 IF (branch .EQ. 0)
THEN 4103 temp2 = vesn*tinlayersn/t_ed
4104 temp4 = c_ev_s*landseaf*envfrac
4105 temp3 = -(temp4*temp2)
4106 tempb8 = temp4*exp(temp3)*qpi*sublb/t_ed
4107 qpib = qpib + (1.0-exp(temp3))*sublb
4108 vesnb = tinlayersn*tempb8
4109 tinlayersnb = vesn*tempb8
4110 t_edb = -(temp2*tempb8)
4112 dqstkob = cons_alhs*t_ed*t_edb/cons_cp
4113 t_edb = (cons_alhs*(dqstko/cons_cp)+1.0)*t_edb
4115 efactorb = flakrad**2*t_edb
4116 flakradb = efactor*2*flakrad*t_edb
4117 diamsnb = 0.5*flakradb
4126 IF (branch .EQ. 0)
THEN 4127 temp = vern*tinlayerrn/t_ed
4128 temp1 = c_ev_r*landseaf*envfrac
4129 temp0 = -(temp1*temp)
4130 tempb7 = temp1*exp(temp0)*qpl*evapb/t_ed
4131 qplb = qplb + (1.0-exp(temp0))*evapb
4132 vernb = tinlayerrn*tempb7
4133 tinlayerrnb = vern*tempb7
4134 t_edb = -(temp*tempb7)
4136 dqstkob = dqstkob + cons_alhl*t_ed*t_edb/cons_cp
4137 t_edb = (cons_alhl*(dqstko/cons_cp)+1.0)*t_edb
4138 efactorb = efactorb + droprad**2*t_edb
4139 dropradb = efactor*2*droprad*t_edb
4140 diamrnb = 0.5*dropradb
4147 IF (branch .EQ. 0)
THEN 4148 tempb6 = rho_w*efactorb/(rhcr3-rh_box)
4151 rh_boxb = (aa+bb)*tempb6/(rhcr3-rh_box)
4155 qkob = rh_boxb/qstko
4156 qstkob = -(qko*rh_boxb/qstko**2)
4158 IF (branch .EQ. 0) qstkob = 0.0_8
4160 dqstkob = dqstkob + (tko-te)*qstkob
4161 tkob = dqstko*qstkob
4162 teb = teb + tkob - dqstko*qstkob
4166 IF (branch .NE. 0)
THEN 4169 qplb = cons_alhf*teb/cons_cp + qpib
4172 IF (branch .EQ. 0)
THEN 4174 mltfrzb = qplb - cons_alhf*teb/cons_cp - qpib
4176 qpib = qpib + mltfrzb
4179 IF (branch .EQ. 0)
THEN 4181 mltfrzb = qplb - cons_alhf*teb/cons_cp - qpib
4183 qpib = qpib + mltfrzb
4186 IF (branch .EQ. 0)
THEN 4188 mltfrzb = qplb - cons_alhf*teb/cons_cp - qpib
4192 IF (branch .NE. 0)
THEN 4193 qpib = qpib + mltfrzb
4196 tempb5 = (te-cons_tice)*mltfrzb/tau_frz
4197 tinlayersnb = tinlayersnb + qpi*tempb5
4198 qpib = qpib + tinlayersn*tempb5
4199 teb = teb + tinlayersn*qpi*mltfrzb/tau_frz
4201 tempb2 = tinlayerrnb/(fallrn+0.01)
4202 tempb1 = tinlayersnb/(fallsn+0.01)
4203 dzeb = dzeb + tempb2 + tempb1
4204 fallsnb = -(dze*tempb1/(fallsn+0.01))
4205 fallrnb = -(dze*tempb2/(fallrn+0.01))
4207 CALL marshpalm_b(snowrat0, snowrat0b, pl, diamsn, diamsnb, nsnow, &
4208 & fallsn, fallsnb, vesn, vesnb)
4210 CALL marshpalm_b(rainrat0, rainrat0b, pl, diamrn, diamrnb, nrain, &
4211 & fallrn, fallrnb, vern, vernb)
4212 tempb3 = mass*snowrat0b/dt
4213 qpib = qpib + ifactor*tempb3
4214 tempb4 = mass*rainrat0b/dt
4215 ifactorb = qpl*tempb4 + qpi*tempb3
4216 qplb = qplb + ifactor*tempb4
4218 accrb = qpib - qclb + cons_alhf*teb/cons_cp
4221 IF (branch .EQ. 0)
THEN 4225 tempb0 = b_sub*c_acc*mass*accrb
4226 qpib = qpib + qcl*tempb0
4227 qclb = qclb + qpi*tempb0
4232 IF (branch .EQ. 0)
THEN 4236 tempb = b_sub*c_acc*mass*accrb
4237 qplb = qplb + qcl*tempb
4238 qclb = qclb + qpl*tempb
4240 pfi_above_inb = imass*qpib
4242 pfl_above_inb = imass*qplb
4244 CALL dqsats_bac_b(dqs, dqsb, qs, qsb, te, teb, pl, estblx, cons_h2omw&
4247 IF (branch .EQ. 0) ifactorb = 0.0_8
4249 IF (branch .EQ. 0)
THEN 4252 areab = -(ifactorb/area**2)
4259 SUBROUTINE marshpalm_b(rain, rainb, pr, diam3, diam3b, ntotal, w, wb, ve&
4264 REAL*8,
INTENT(IN) :: rain, pr
4267 REAL*8 :: diam3, ntotal, w, ve
4268 REAL*8 :: diam3b, wb, veb
4272 REAL*8,
PARAMETER :: n0=0.08
4273 REAL*8 :: rain_day, slopr, diam1
4275 REAL*8 :: rx(8), d3x(8)
4298 rain_day = rain*3600.*24.
4299 IF (rain_day .LE. 0.00) diam3 = 0.00
4301 IF (rain_day .LE. rx(iqd+1) .AND. rain_day .GT. rx(iqd))
THEN 4303 slopr = (d3x(iqd+1)-d3x(iqd))/(rx(iqd+1)-rx(iqd))
4304 diam3 = d3x(iqd) + (rain_day-rx(iqd))*slopr
4310 IF (rain_day .GE. rx(8))
THEN 4317 w = (2483.8*diam3+80.)*sqrt(1000./pr)
4318 IF (0.99*w/100. .LT. 1.000)
THEN 4324 diam3b = diam3b/100.
4326 IF (branch .NE. 0) wb = wb + 0.99*veb/100.
4327 diam3b = diam3b + sqrt(1000./pr)*2483.8*wb
4328 diam3b = 0.664*diam3b
4330 IF (branch .NE. 0) diam3b = 0.0_8
4334 IF (branch .NE. 0)
THEN 4335 rain_dayb = rain_dayb + slopr*diam3b
4340 rainb = 24.*3600.*rain_dayb
4346 SUBROUTINE dqsat_bac_b(dqsi, dqsib, qssi, qssib, temp, tempb, plo, im, &
4347 & jm, lm, estblx, cons_h2omw, cons_airmw)
4350 INTEGER :: im, jm, lm
4351 REAL*8,
DIMENSION(im, jm, lm) :: temp, plo
4352 REAL*8,
DIMENSION(im, jm, lm) :: tempb
4354 REAL*8 :: cons_h2omw, cons_airmw
4356 REAL*8,
DIMENSION(im, jm, lm) :: dqsi, qssi
4357 REAL*8,
DIMENSION(im, jm, lm) :: dqsib, qssib
4359 REAL*8,
PARAMETER :: max_mixing_ratio=1.0
4362 REAL*8 :: tl, tt, ti, dqsat, qsat, dqq, qq, pl, pp, dd
4363 REAL*8 :: tlb, ttb, tib, dqsatb, qsatb, qqb, ddb
4365 INTEGER,
PARAMETER :: degsubs=100
4366 REAL*8,
PARAMETER :: tmintbl=150.0, tmaxtbl=333.0
4367 INTEGER,
PARAMETER :: tablesize=nint(tmaxtbl-tmintbl)*degsubs+1
4372 esfac = cons_h2omw/cons_airmw
4379 IF (tl .LE. tmintbl)
THEN 4382 ELSE IF (tl .GE. tmaxtbl - .001)
THEN 4389 tt = (ti-tmintbl)*degsubs + 1
4392 dqq = estblx(it+1) - estblx(it)
4394 qq = (tt-it)*dqq + estblx(it)
4395 IF (pp .LE. qq)
THEN 4406 qsatb = qssib(i, j, k)
4407 qssib(i, j, k) = 0.0_8
4408 dqsatb = dqsib(i, j, k)
4409 dqsib(i, j, k) = 0.0_8
4411 IF (branch .EQ. 0)
THEN 4416 dd = 1.0/(pp-(1.0-esfac)*qq)
4417 ddb = esfac*qq*qsatb + esfac*degsubs*dqq*pp*2*dd*dqsatb
4418 temp0 = pp - (-esfac+1.0)*qq
4419 qqb = (1.0-esfac)*ddb/temp0**2 + esfac*dd*qsatb
4426 IF (branch .EQ. 0)
THEN 4428 ELSE IF (branch .EQ. 1)
THEN 4433 tempb(i, j, k) = tempb(i, j, k) + tlb
4442 SUBROUTINE dqsats_bac_b(dqsi, dqsib, qssi, qssib, temp, tempb, plo, &
4443 & estblx, cons_h2omw, cons_airmw)
4449 REAL*8 :: cons_h2omw, cons_airmw
4451 REAL*8 :: dqsi, qssi
4452 REAL*8 :: dqsib, qssib
4454 REAL*8,
PARAMETER :: max_mixing_ratio=1.0
4456 REAL*8 :: tl, tt, ti, dqsat, qsat, dqq, qq, pl, pp, dd
4457 REAL*8 :: tlb, ttb, tib, dqsatb, qsatb, qqb, ddb
4459 INTEGER,
PARAMETER :: degsubs=100
4460 REAL*8,
PARAMETER :: tmintbl=150.0, tmaxtbl=333.0
4461 INTEGER,
PARAMETER :: tablesize=nint(tmaxtbl-tmintbl)*degsubs+1
4466 esfac = cons_h2omw/cons_airmw
4470 IF (tl .LE. tmintbl)
THEN 4473 ELSE IF (tl .GE. tmaxtbl - .001)
THEN 4480 tt = (ti-tmintbl)*degsubs + 1
4482 dqq = estblx(it+1) - estblx(it)
4483 qq = (tt-it)*dqq + estblx(it)
4484 IF (pp .LE. qq)
THEN 4487 dd = 1.0/(pp-(1.0-esfac)*qq)
4493 IF (branch .EQ. 0)
THEN 4496 temp0 = pp - (-esfac+1.0)*qq
4497 ddb = esfac*qq*qsatb + esfac*degsubs*dqq*pp*2*dd*dqsatb
4498 qqb = (1.0-esfac)*ddb/temp0**2 + esfac*dd*qsatb
4503 IF (branch .EQ. 0)
THEN 4505 ELSE IF (branch .EQ. 1)
THEN subroutine convec_src_b(dt, mass, imass, te, teb, qv, qvb, dcf, dcfb, dmf, dmfb, qla, qlab, qia, qiab, af, afb, qs, qsb, cons_alhs, cons_alhl, cons_cp, t_ice_all, t_ice_max, icefrpwr)
subroutine autoconversion_ls_b(dt, qc, qcb, qp, qpb, te, teb, pl, f, fb, sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
subroutine popcontrol2b(cc)
subroutine cloud_tidy_b(qv, qvb, te, teb, qlc, qlcb, qic, qicb, cf, cfb, qla, qlab, qia, qiab, af, afb, cons_alhl, cons_alhs, cons_cp)
subroutine ldradius_b(pl, te, teb, qcl, qclb, nn, rho_w, radius, radiusb, cons_rgas, cons_pi)
subroutine ice_settlefall_cnv_b(wxr, qi, qib, pl, te, teb, f, fb, cons_rgas, khu, khl, k, dt, dz, dzb, qp, qpb, anv_icefall_c)
subroutine, public autoconversion_cnv(DT, QC, QP, TE, PL, F, SUNDQV2, SUNDQV3, SUNDQT1, C_00, LWCRIT, DZET)
void popreal8array(double *x, int n)
subroutine, public cloud_driver_b(dt, im, jm, lm, th, thb, q, qb, ple, cnv_dqldt, cnv_dqldtb, cnv_mfd, cnv_mfdb, cnv_prc3, cnv_prc3b, cnv_updf, cnv_updfb, qi_ls, qi_lsb, ql_ls, ql_lsb, qi_con, qi_conb, ql_con, ql_conb, cf_ls, cf_lsb, cf_con, cf_conb, 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, public ldradius(PL, TE, QCL, NN, RHO_W, RADIUS, CONS_RGAS, CONS_PI)
subroutine, public pdfcondensate(flag, qtmean4, sigmaqt14, sigmaqt24, qstar4, condensate4)
subroutine, public dqsat_bac(DQSi, QSSi, TEMP, PLO, im, jm, lm, ESTBLX, CONS_H2OMW, CONS_AIRMW)
subroutine, public precipandevap(K, KTOP, LM, DT, FRLAND, RHCR3, QPl, QPi, QCl, QCi, TE, QV, mass, imass, PL, dZE, QDDF3, AA, BB, AREA, PFl_above_in, PFl_above_out, PFi_above_in, PFi_above_out, EVAP_DD_above_in, EVAP_DD_above_out, SUBL_DD_above_in, SUBL_DD_above_out, 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, public evap_cnv(DT, RHCR, PL, TE, QV, QL, QI, F, XF, QS, RHO_W, CLD_EVP_EFF, CONS_H2OMW, CONS_AIRMW, CONS_ALHL, CONS_RVAP, CONS_RGAS, CONS_PI, CONS_CP)
subroutine pdfcondensate_b(flag, qtmean4, qtmean4b, sigmaqt14, sigmaqt14b, sigmaqt24, sigmaqt24b, qstar4, qstar4b, condensate4, condensate4b)
subroutine, public ice_settlefall_ls(WXR, QI, PL, TE, F, CONS_RGAS, KHu, KHl, k, DT, DZ, QP, LS_ICEFALL_C)
subroutine, public ice_settlefall_cnv(WXR, QI, PL, TE, F, CONS_RGAS, KHu, KHl, k, DT, DZ, QP, ANV_ICEFALL_C)
subroutine cons_sundq3_b(temp, tempb, rate2, rate3, te1, f2, f2b, f3)
subroutine pushcontrol1b(cc)
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_b(wxr, qi, qib, pl, te, teb, f, fb, cons_rgas, khu, khl, k, dt, dz, dzb, qp, qpb, ls_icefall_c)
subroutine, public pdffrac(flag, qtmean, sigmaqt1, sigmaqt2, qstar, clfrac)
subroutine, public cons_alhx(T, ALHX3, T_ICE_MAX, T_ICE_ALL, CONS_ALHS, CONS_ALHL)
subroutine pushcontrol2b(cc)
subroutine dqsat_bac_b(dqsi, dqsib, qssi, qssib, temp, tempb, plo, im, jm, lm, estblx, cons_h2omw, cons_airmw)
void pushreal8array(double *x, int n)
subroutine evap_cnv_b(dt, rhcr, pl, te, teb, qv, qvb, ql, qlb, qi, qib, f, fb, xf, qs, qsb, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp)
subroutine, public pdf_width(PP, FRLAND, maxrhcrit, maxrhcritland, turnrhcrit, minrhcrit, pi_0, ALPHA)
subroutine meltfreeze_b(dt, te, teb, ql, qlb, qi, qib, t_ice_all, t_ice_max, icefrpwr, cons_alhl, cons_alhs, cons_cp)
subroutine, public cons_microphys(TEMP, PR, Q_SAT, AA, BB, CONS_H2OMW, CONS_AIRMW, CONS_RVAP, ALHX3)
subroutine get_ice_fraction_b(temp, tempb, t_ice_all, t_ice_max, icefrpwr, icefrct, icefrctb)
subroutine, public meltfreeze(DT, TE, QL, QI, T_ICE_ALL, T_ICE_MAX, ICEFRPWR, CONS_ALHL, CONS_ALHS, CONS_CP)
subroutine dqsats_bac_b(dqsi, dqsib, qssi, qssib, temp, tempb, plo, estblx, cons_h2omw, cons_airmw)
subroutine, public convec_src(DT, MASS, iMASS, TE, QV, DCF, DMF, QLA, QIA, AF, QS, CONS_ALHS, CONS_ALHL, CONS_CP, T_ICE_ALL, T_ICE_MAX, ICEFRPWR)
subroutine, public cloud_tidy(QV, TE, QLC, QIC, CF, QLA, QIA, AF, CONS_ALHL, CONS_ALHS, CONS_CP)
subroutine, public cons_sundq3(TEMP, RATE2, RATE3, TE1, F2, F3)
subroutine, public subl_cnv(DT, RHCR, PL, TE, QV, QL, QI, F, XF, QS, RHO_W, CLD_EVP_EFF, CONS_H2OMW, CONS_AIRMW, CONS_ALHL, CONS_RVAP, CONS_RGAS, CONS_PI, CONS_CP, CONS_ALHS)
subroutine popcontrol3b(cc)
subroutine, public dqsats_bac(DQSi, QSSi, TEMP, PLO, ESTBLX, CONS_H2OMW, CONS_AIRMW)
subroutine popcontrol1b(cc)
subroutine subl_cnv_b(dt, rhcr, pl, te, teb, qv, qvb, ql, qlb, qi, qib, f, fb, xf, qs, qsb, rho_w, cld_evp_eff, cons_h2omw, cons_airmw, cons_alhl, cons_rvap, cons_rgas, cons_pi, cons_cp, cons_alhs)
subroutine, public autoconversion_ls(DT, QC, QP, TE, PL, F, SUNDQV2, SUNDQV3, SUNDQT1, C_00, LWCRIT, DZET)
subroutine pdffrac_b(flag, qtmean, qtmeanb, sigmaqt1, sigmaqt1b, sigmaqt2, sigmaqt2b, qstar, qstarb, clfrac, clfracb)
subroutine popcontrol4b(cc)
subroutine marshpalm_b(rain, rainb, pr, diam3, diam3b, ntotal, w, wb, ve, veb)
subroutine, public marshpalm(RAIN, PR, DIAM3, NTOTAL, W, VE)
subroutine pushcontrol4b(cc)
subroutine, public get_ice_fraction(TEMP, T_ICE_ALL, T_ICE_MAX, ICEFRPWR, ICEFRCT)
subroutine pushcontrol3b(cc)
subroutine autoconversion_cnv_b(dt, qc, qcb, qp, qpb, te, teb, pl, f, fb, sundqv2, sundqv3, sundqt1, c_00, lwcrit, dzet)
subroutine ls_cloud_b(dt, alpha, pdfshape, pl, te, teb, qv, qvb, qcl, qclb, qal, qalb, qci, qcib, qai, qaib, cf, cfb, af, afb, cons_alhl, cons_alhf, cons_alhs, cons_cp, cons_h2omw, cons_airmw, t_ice_all, t_ice_max, icefrpwr, estblx, cloud_pertmod, dmp)
subroutine, public ls_cloud(DT, ALPHA, PDFSHAPE, PL, TE, QV, QCl, QAl, QCi, QAi, CF, AF, CONS_ALHL, CONS_ALHF, CONS_ALHS, CONS_CP, CONS_H2OMW, CONS_AIRMW, T_ICE_ALL, T_ICE_MAX, ICEFRPWR, ESTBLX, cloud_pertmod, dmp)
subroutine precipandevap_b(k, ktop, lm, dt, frland, rhcr3, qpl, qplb, qpi, qpib, qcl, qclb, qci, te, teb, qv, qvb, mass, imass, pl, dze, dzeb, qddf3, qddf3b, aa, aab, bb, bbb, area, areab, pfl_above_in, pfl_above_inb, pfl_above_out, pfl_above_outb, pfi_above_in, pfi_above_inb, pfi_above_out, pfi_above_outb, evap_dd_above_in, evap_dd_above_inb, evap_dd_above_out, evap_dd_above_outb, subl_dd_above_in, subl_dd_above_inb, subl_dd_above_out, subl_dd_above_outb, 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_b(temp, tempb1, pr, q_sat, q_satb, aa, aab, bb, bbb, cons_h2omw, cons_airmw, cons_rvap, alhx3, alhx3b)
subroutine cons_alhx_b(t, tb, alhx3, alhx3b, t_ice_max, t_ice_all, cons_alhs, cons_alhl)