55 real :: missing_value = - 1.e10
57 logical :: module_is_initialized = .false.
58 logical :: qsmith_tables_initialized = .false.
60 character (len = 17) :: mod_name =
'gfdl_cloud_microphys'
62 real,
parameter :: n0r = 8.0e6, n0s = 3.0e6, n0g = 4.0e6
63 real,
parameter :: rhos = 0.1e3, rhog = 0.4e3
64 real,
parameter :: grav = 9.80665
65 real,
parameter :: rdgas = 287.05
66 real,
parameter :: rvgas = 461.50
67 real,
parameter :: cp_air = 1004.6
68 real,
parameter :: hlv = 2.5e6
69 real,
parameter :: hlf = 3.3358e5
70 real,
parameter :: pi = 3.1415926535897931
75 real,
parameter :: cp_vap = 4.0 * rvgas
77 real,
parameter :: cv_air = cp_air - rdgas
79 real,
parameter :: cv_vap = 3.0 * rvgas
85 real,
parameter :: c_ice = 1972.0
86 real,
parameter :: c_liq = 4185.5
89 real,
parameter :: eps = rdgas / rvgas
90 real,
parameter :: zvir = rvgas / rdgas - 1.
92 real,
parameter :: t_ice = 273.16
93 real,
parameter :: table_ice = 273.16
96 real,
parameter :: e00 = 611.21
98 real,
parameter :: dc_vap = cp_vap - c_liq
99 real,
parameter :: dc_ice = c_liq - c_ice
101 real,
parameter :: hlv0 = hlv
103 real,
parameter :: hlf0 = hlf
106 real,
parameter :: lv0 = hlv0 - dc_vap * t_ice
107 real,
parameter :: li00 = hlf0 - dc_ice * t_ice
109 real,
parameter :: d2ice = dc_vap + dc_ice
110 real,
parameter :: li2 = lv0 + li00
112 real,
parameter :: qrmin = 1.e-8
113 real,
parameter :: qvmin = 1.e-20
114 real,
parameter :: qcmin = 1.e-12
116 real,
parameter :: vr_min = 1.e-3
117 real,
parameter :: vf_min = 1.e-5
119 real,
parameter :: dz_min = 1.e-2
121 real,
parameter :: sfcrho = 1.2
122 real,
parameter :: rhor = 1.e3
125 real,
parameter :: rnzr = 8.0e6
126 real,
parameter :: rnzs = 3.0e6
127 real,
parameter :: rnzg = 4.0e6
128 real,
parameter :: rnzh = 4.0e4
132 real,
parameter :: rhoh = 0.917e3
134 public rhor, rhos, rhog, rhoh, rnzr, rnzs, rnzg, rnzh
135 real :: cracs, csacr, cgacr, cgacs, csacw, craci, csaci, cgacw, cgaci, cracw
137 real :: cssub (5), cgsub (5), crevp (5), cgfr (2), csmlt (5), cgmlt (5)
140 real :: pie, rgrav, fac_rc
143 real :: lati, latv, lats, lat2, lcp, icp, tcp
150 integer :: icloud_f = 0
151 integer :: irain_f = 0
153 logical :: de_ice = .false.
154 logical :: sedi_transport = .true.
155 logical :: do_sedi_w = .false.
156 logical :: do_sedi_heat = .true.
157 logical :: prog_ccn = .false.
158 logical :: do_qa = .true.
159 logical :: rad_snow = .true.
160 logical :: rad_graupel = .true.
161 logical :: rad_rain = .true.
162 logical :: fix_negative = .false.
163 logical :: do_setup = .true.
164 logical :: p_nonhydro = .false.
166 real,
allocatable :: table (:), table2 (:), table3 (:), tablew (:)
167 real,
allocatable :: des (:), des2 (:), des3 (:), desw (:)
169 logical :: tables_are_initialized = .false.
174 real,
parameter :: dt_fr = 8.
191 real :: cld_min = 0.05
192 real :: tice = 273.16
196 real :: mp_time = 150.
200 real :: rh_inc = 0.25
201 real :: rh_inr = 0.25
202 real :: rh_ins = 0.25
206 real :: tau_r2g = 900.
207 real :: tau_smlt = 900.
208 real :: tau_g2r = 600.
209 real :: tau_imlt = 600.
210 real :: tau_i2s = 1000.
211 real :: tau_l2r = 900.
212 real :: tau_v2l = 150.
213 real :: tau_l2v = 300.
214 real :: tau_g2v = 900.
215 real :: tau_v2g = 21600.
219 real :: dw_land = 0.20
220 real :: dw_ocean = 0.10
227 real :: rthresh = 10.0e-6
237 real :: sat_adj0 = 0.90
239 real :: qc_crt = 5.0e-8
243 real :: ql_mlt = 2.0e-3
244 real :: qs_mlt = 1.0e-6
246 real :: ql_gen = 1.0e-3
247 real :: qi_gen = 1.82e-6
251 real :: ql0_max = 2.0e-3
252 real :: qi0_max = 1.0e-4
254 real :: qi0_crt = 1.0e-4
256 real :: qr0_crt = 1.0e-4
258 real :: qs0_crt = 1.0e-3
260 real :: c_paut = 0.55
261 real :: c_psaci = 0.02
262 real :: c_piacr = 5.0
263 real :: c_cracw = 0.9
264 real :: c_pgacs = 2.0e-3
273 logical :: const_vi = .false.
274 logical :: const_vs = .false.
275 logical :: const_vg = .false.
276 logical :: const_vr = .false.
294 logical :: fast_sat_adj = .false.
295 logical :: z_slope_liq = .true.
296 logical :: z_slope_ice = .false.
297 logical :: use_ccn = .false.
298 logical :: use_ppm = .false.
299 logical :: mono_prof = .true.
300 logical :: mp_print = .false.
301 logical :: do_hail = .false.
305 real :: log_10, tice0, t_wfr
307 integer :: reiflag = 1
311 logical :: tintqs = .false.
313 real :: rewmin = 5.0, rewmax = 10.0
314 real :: reimin = 10.0, reimax = 150.0
315 real :: rermin = 10.0, rermax = 10000.0
316 real :: resmin = 150.0, resmax = 10000.0
317 real :: regmin = 300.0, regmax = 10000.0
323 namelist / gfdl_cloud_microphysics_nml / &
324 mp_time, t_min, t_sub, tau_r2g, tau_smlt, tau_g2r, dw_land, dw_ocean, &
325 vi_fac, vr_fac, vs_fac, vg_fac, ql_mlt, do_qa, fix_negative, vi_max, &
326 vs_max, vg_max, vr_max, qs_mlt, qs0_crt, qi_gen, ql0_max, qi0_max, &
327 qi0_crt, qr0_crt, fast_sat_adj, rh_inc, rh_ins, rh_inr, const_vi, &
328 const_vs, const_vg, const_vr, use_ccn, rthresh, ccn_l, ccn_o, qc_crt, &
329 tau_g2v, tau_v2g, sat_adj0, c_piacr, tau_imlt, tau_v2l, tau_l2v, &
330 tau_i2s, tau_l2r, qi_lim, ql_gen, c_paut, c_psaci, c_pgacs, &
331 z_slope_liq, z_slope_ice, prog_ccn, c_cracw, alin, clin, tice, &
332 rad_snow, rad_graupel, rad_rain, cld_min, use_ppm, mono_prof, &
333 do_sedi_heat, sedi_transport, do_sedi_w, de_ice, icloud_f, irain_f, &
334 mp_print, reiflag, rewmin, rewmax, reimin, reimax, rermin, rermax, &
335 resmin, resmax, regmin, regmax, tintqs, do_hail
338 mp_time, t_min, t_sub, tau_r2g, tau_smlt, tau_g2r, dw_land, dw_ocean, &
339 vi_fac, vr_fac, vs_fac, vg_fac, ql_mlt, do_qa, fix_negative, vi_max, &
340 vs_max, vg_max, vr_max, qs_mlt, qs0_crt, qi_gen, ql0_max, qi0_max, &
341 qi0_crt, qr0_crt, fast_sat_adj, rh_inc, rh_ins, rh_inr, const_vi, &
342 const_vs, const_vg, const_vr, use_ccn, rthresh, ccn_l, ccn_o, qc_crt, &
343 tau_g2v, tau_v2g, sat_adj0, c_piacr, tau_imlt, tau_v2l, tau_l2v, &
344 tau_i2s, tau_l2r, qi_lim, ql_gen, c_paut, c_psaci, c_pgacs, &
345 z_slope_liq, z_slope_ice, prog_ccn, c_cracw, alin, clin, tice, &
346 rad_snow, rad_graupel, rad_rain, cld_min, use_ppm, mono_prof, &
347 do_sedi_heat, sedi_transport, do_sedi_w, de_ice, icloud_f, irain_f, &
348 mp_print, reiflag, rewmin, rewmax, reimin, reimax, rermin, rermax, &
349 resmin, resmax, regmin, regmax, tintqs, do_hail
360 iis, iie, jjs, jje, kks, kke, ktop, kbot, &
361 qv, ql, qr, qi, qs, qg, qa, qn, &
362 qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, pt_dt, pt, w, &
363 uin, vin, udt, vdt, dz, delp, area, dt_in, land, &
364 rain, snow, ice, graupel, hydrostatic, phys_hydrostatic, &
365 p, lradar, refl_10cm, reset, pfils, pflls)
370 integer,
intent (in) :: iis, iie, jjs, jje
371 integer,
intent (in) :: kks, kke
372 integer,
intent (in) :: ktop, kbot
374 real,
intent (in) :: dt_in
376 real,
intent (in),
dimension (iis:iie, jjs:jje) :: area
377 real,
intent (in),
dimension (iis:iie, jjs:jje) :: land
379 real,
intent (in),
dimension (iis:iie, jjs:jje, kks:kke) :: delp, dz, uin, vin
380 real,
intent (in),
dimension (iis:iie, jjs:jje, kks:kke) :: pt, qv, ql, qr, qg, qa, qn
382 real,
intent (inout),
dimension (iis:iie, jjs:jje, kks:kke) :: qi, qs
383 real,
intent (inout),
dimension (iis:iie, jjs:jje, kks:kke) :: pt_dt, qa_dt, udt, vdt, w
384 real,
intent (inout),
dimension (iis:iie, jjs:jje, kks:kke) :: qv_dt, ql_dt, qr_dt
385 real,
intent (inout),
dimension (iis:iie, jjs:jje, kks:kke) :: qi_dt, qs_dt, qg_dt
387 real,
intent (out),
dimension (iis:iie, jjs:jje) :: rain, snow, ice, graupel
389 logical,
intent (in) :: hydrostatic, phys_hydrostatic
392 real,
intent (in),
dimension (iis:iie, jjs:jje, kks:kke) :: p
393 logical,
intent (in) :: lradar
394 real,
intent (out),
dimension (iis:iie, jjs:jje, kks:kke) :: refl_10cm
395 logical,
intent (in) :: reset
396 real,
intent (out),
dimension (iis:iie, jjs:jje, kks:kke) :: pfils, pflls
399 logical :: melti = .false.
401 real :: mpdt, rdt, dts, convt, tot_prec
404 integer :: is, ie, js, je
406 integer :: days, ntimes, kflip
408 real,
dimension (iie-iis+1, jje-jjs+1) :: prec_mp, prec1, cond, w_var, rh0
410 real,
dimension (iie-iis+1, jje-jjs+1,kke-kks+1) :: vt_r, vt_s, vt_g, vt_i, qn2
412 real,
dimension (size(pt,1), size(pt,3)) :: m2_rain, m2_sol
417 real,
dimension(ktop:kbot):: qv1d, t1d, p1d, qr1d, qs1d, qg1d, dbz
432 if (phys_hydrostatic .or. hydrostatic)
then
441 d0_vap = c_vap - c_liq
442 lv00 = hlv0 - d0_vap * t_ice
444 if (hydrostatic) do_sedi_w = .false.
457 tcp = (latv + lati) / cp_air
465 mpdt = min(dt_in, mp_time)
467 ntimes = nint(dt_in / mpdt)
470 dts = dt_in / real(ntimes)
496 call mpdrv (hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, qg,&
497 qa, qn, dz, is, ie, js, je, ks, ke, ktop, kbot, j, dt_in, ntimes, &
498 rain(:, j), snow(:, j), graupel(:, j), ice(:, j), m2_rain, &
499 m2_sol, cond(:, j), area(:, j), land(:, j), udt, vdt, pt_dt, &
500 qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, w_var, vt_r, &
501 vt_s, vt_g, vt_i, qn2)
504 pfils(i, j, k) = m2_sol(i, k)
505 pflls(i, j, k) = m2_rain(i, k)
563 convt = 86400. * rdt * rgrav
566 rain(i, j) = rain(i, j) * convt
567 snow(i, j) = snow(i, j) * convt
568 ice(i, j) = ice(i, j) * convt
569 graupel(i, j) = graupel(i, j) * convt
570 prec_mp(i, j) = rain(i, j) + snow(i, j) + ice(i, j) + graupel(i, j)
651 kflip = kbot-ktop+1-k+1
652 t1d(k) = pt(i,j,kflip)
653 p1d(k) = p(i,j,kflip)
654 qv1d(k) = qv(i,j,kflip)/(1-qv(i,j,kflip))
655 qr1d(k) = qr(i,j,kflip)
656 qs1d(k) = qs(i,j,kflip)
657 qg1d(k) = qg(i,j,kflip)
660 t1d, p1d, dbz, ktop, kbot, i, j, melti)
662 kflip = kbot-ktop+1-k+1
663 refl_10cm(i,j,kflip) = max(-35., dbz(k))
678subroutine mpdrv (hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, &
679 qg, qa, qn, dz, is, ie, js, je, ks, ke, ktop, kbot, j, dt_in, ntimes, &
680 rain, snow, graupel, ice, m2_rain, m2_sol, cond, area1, land, &
681 u_dt, v_dt, pt_dt, qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, &
682 w_var, vt_r, vt_s, vt_g, vt_i, qn2)
686 logical,
intent (in) :: hydrostatic
688 integer,
intent (in) :: j, is, ie, js, je, ks, ke
689 integer,
intent (in) :: ntimes, ktop, kbot
691 real,
intent (in) :: dt_in
693 real,
intent (in),
dimension (is:) :: area1, land
695 real,
intent (in),
dimension (is:, js:, ks:) :: uin, vin, delp, pt, dz
696 real,
intent (in),
dimension (is:, js:, ks:) :: qv, ql, qr, qg, qa, qn
698 real,
intent (inout),
dimension (is:, js:, ks:) :: qi, qs
699 real,
intent (inout),
dimension (is:, js:, ks:) :: u_dt, v_dt, w, pt_dt, qa_dt
700 real,
intent (inout),
dimension (is:, js:, ks:) :: qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt
702 real,
intent (inout),
dimension (is:) :: rain, snow, ice, graupel, cond
704 real,
intent (out),
dimension (is:, js:) :: w_var
706 real,
intent (out),
dimension (is:, js:, ks:) :: vt_r, vt_s, vt_g, vt_i, qn2
708 real,
intent (out),
dimension (is:, ks:) :: m2_rain, m2_sol
710 real,
dimension (ktop:kbot) :: qvz, qlz, qrz, qiz, qsz, qgz, qaz
711 real,
dimension (ktop:kbot) :: vtiz, vtsz, vtgz, vtrz
712 real,
dimension (ktop:kbot) :: dp0, dp1, dz0, dz1
713 real,
dimension (ktop:kbot) :: qv0, ql0, qr0, qi0, qs0, qg0, qa0
714 real,
dimension (ktop:kbot) :: t0, den, den0, tz, p1, denfac
715 real,
dimension (ktop:kbot) :: ccn, c_praut, m1_rain, m1_sol, m1
716 real,
dimension (ktop:kbot) :: u0, v0, u1, v1, w1
718 real :: cpaut, rh_adj, rh_rain
719 real :: r1, s1, i1, g1, rdt, ccn0
721 real :: s_leng, t_land, t_ocean, h_var
722 real :: cvm, tmp, omq
723 real :: dqi, qio, qin
727 dts = dt_in / real(ntimes)
757 qio = qiz(k) - dt_in * qi_dt(i, j, k)
758 qin = max(qio, qi0_max)
759 if (qiz(k) > qin)
then
760 qsz(k) = qsz(k) + qiz(k) - qin
762 dqi = (qin - qio) * rdt
763 qs_dt(i, j, k) = qs_dt(i, j, k) + qi_dt(i, j, k) - dqi
775 dp1(k) = delp(i, j, k)
789 dp1(k) = dp1(k) * (1. - qvz(k))
790 omq = dp0(k) / dp1(k)
792 qvz(k) = qvz(k) * omq
793 qlz(k) = qlz(k) * omq
794 qrz(k) = qrz(k) * omq
795 qiz(k) = qiz(k) * omq
796 qsz(k) = qsz(k) * omq
797 qgz(k) = qgz(k) * omq
803 den0(k) = - dp1(k) / (grav * dz0(k))
804 p1(k) = den0(k) * rdgas * t0(k)
843 cpaut = c_paut * 0.104 * grav / 1.717e-5
848 ccn(k) = qn(i, j, k) * 1.e6
849 c_praut(k) = cpaut * (ccn(k) * rhor) ** (- 1. / 3.)
853 ccn0 = (ccn_l * land(i) + ccn_o * (1. - land(i))) * 1.e6
858 ccn0 = ccn0 * rdgas * tz(kbot) / p1(kbot)
860 tmp = cpaut * (ccn0 * rhor) ** (- 1. / 3.)
893 s_leng = sqrt(sqrt(area1(i) / 1.e10))
894 t_land = dw_land * s_leng
895 t_ocean = dw_ocean * s_leng
896 h_var = t_land * land(i) + t_ocean * (1. - land(i))
897 h_var = min(0.20, max(0.01, h_var))
904 rh_adj = 1. - h_var - rh_inc
905 rh_rain = max(0.35, rh_adj - rh_inr)
912 call neg_adj (ktop, kbot, tz, dp1, qvz, qlz, qrz, qiz, qsz, qgz)
928 denfac(k) = sqrt(sfcrho / den(k))
932 dz1(k) = dz0(k) * tz(k) / t0(k)
933 den(k) = den0(k) * dz0(k) / dz1(k)
934 denfac(k) = sqrt(sfcrho / den(k))
942 call warm_rain (dt_rain, ktop, kbot, dp1, dz1, tz, qvz, qlz, qrz, qiz, qsz, &
943 qgz, den, denfac, ccn, c_praut, rh_rain, vtrz, r1, m1_rain, w1, h_var)
945 rain(i) = rain(i) + r1
948 m2_rain(i, k) = m2_rain(i, k) + m1_rain(k)
949 m1(k) = m1(k) + m1_rain(k)
958 call fall_speed (ktop, kbot, den, qsz, qiz, qgz, qlz, tz, vtsz, vtiz, vtgz)
961 call terminal_fall (dts, ktop, kbot, tz, qvz, qlz, qrz, qgz, qsz, qiz, &
962 dz1, dp1, den, vtgz, vtsz, vtiz, r1, g1, s1, i1, m1_sol, w1)
964 rain(i) = rain(i) + r1
965 snow(i) = snow(i) + s1
966 graupel(i) = graupel(i) + g1
974 call sedi_heat (ktop, kbot, dp1, m1_sol, dz1, tz, qvz, qlz, qrz, qiz, &
981 call warm_rain (dt_rain, ktop, kbot, dp1, dz1, tz, qvz, qlz, qrz, qiz, qsz, &
982 qgz, den, denfac, ccn, c_praut, rh_rain, vtrz, r1, m1_rain, w1, h_var)
984 rain(i) = rain(i) + r1
987 m2_rain(i, k) = m2_rain(i, k) + m1_rain(k)
988 m2_sol(i, k) = m2_sol(i, k) + m1_sol(k)
989 m1(k) = m1(k) + m1_rain(k) + m1_sol(k)
996 call icloud (ktop, kbot, tz, p1, qvz, qlz, qrz, qiz, qsz, qgz, dp1, den, &
997 denfac, vtsz, vtgz, vtrz, qaz, rh_adj, rh_rain, dts, h_var)
1002 m2_rain(i, :) = m2_rain(i, :) * rdt * rgrav
1003 m2_sol(i, :) = m2_sol(i, :) * rdt * rgrav
1010 if (sedi_transport)
then
1011 do k = ktop + 1, kbot
1012 u1(k) = (dp0(k) * u1(k) + m1(k - 1) * u1(k - 1)) / (dp0(k) + m1(k - 1))
1013 v1(k) = (dp0(k) * v1(k) + m1(k - 1) * v1(k - 1)) / (dp0(k) + m1(k - 1))
1014 u_dt(i, j, k) = u_dt(i, j, k) + (u1(k) - u0(k)) * rdt
1015 v_dt(i, j, k) = v_dt(i, j, k) + (v1(k) - v0(k)) * rdt
1031 omq = dp1(k) / dp0(k)
1032 qv_dt(i, j, k) = qv_dt(i, j, k) + rdt * (qvz(k) - qv0(k)) * omq
1033 ql_dt(i, j, k) = ql_dt(i, j, k) + rdt * (qlz(k) - ql0(k)) * omq
1034 qr_dt(i, j, k) = qr_dt(i, j, k) + rdt * (qrz(k) - qr0(k)) * omq
1035 qi_dt(i, j, k) = qi_dt(i, j, k) + rdt * (qiz(k) - qi0(k)) * omq
1036 qs_dt(i, j, k) = qs_dt(i, j, k) + rdt * (qsz(k) - qs0(k)) * omq
1037 qg_dt(i, j, k) = qg_dt(i, j, k) + rdt * (qgz(k) - qg0(k)) * omq
1038 cvm = c_air + qvz(k) * c_vap + (qrz(k) + qlz(k)) * c_liq + (qiz(k) + qsz(k) + qgz(k)) * c_ice
1039 pt_dt(i, j, k) = pt_dt(i, j, k) + rdt * (tz(k) - t0(k)) * cvm / cp_air
1050 qa_dt(i, j, k) = qa_dt(i, j, k) + rdt * (qaz(k) / real(ntimes) - qa0(k))
1101subroutine sedi_heat (ktop, kbot, dm, m1, dz, tz, qv, ql, qr, qi, qs, qg, cw)
1107 integer,
intent (in) :: ktop, kbot
1109 real,
intent (in),
dimension (ktop:kbot) :: dm, m1, dz, qv, ql, qr, qi, qs, qg
1111 real,
intent (inout),
dimension (ktop:kbot) :: tz
1113 real,
intent (in) :: cw
1115 real,
dimension (ktop:kbot) :: dgz, cvn
1122 dgz(k) = - 0.5 * grav * dz(k)
1123 cvn(k) = dm(k) * (cv_air + qv(k) * cv_vap + (qr(k) + ql(k)) * &
1124 c_liq + (qi(k) + qs(k) + qg(k)) * c_ice)
1137 tmp = cvn(k) + m1(k) * cw
1138 tz(k) = (tmp * tz(k) + m1(k) * dgz(k)) / tmp
1145 do k = ktop + 1, kbot
1146 tz(k) = ((cvn(k) + cw * (m1(k) - m1(k - 1))) * tz(k) + m1(k - 1) * &
1147 cw * tz(k - 1) + dgz(k) * (m1(k - 1) + m1(k))) / (cvn(k) + cw * m1(k))
1156subroutine warm_rain (dt, ktop, kbot, dp, dz, tz, qv, ql, qr, qi, qs, qg, &
1157 den, denfac, ccn, c_praut, rh_rain, vtr, r1, m1_rain, w1, h_var)
1161 integer,
intent (in) :: ktop, kbot
1163 real,
intent (in) :: dt
1164 real,
intent (in) :: rh_rain, h_var
1166 real,
intent (in),
dimension (ktop:kbot) :: dp, dz, den
1167 real,
intent (in),
dimension (ktop:kbot) :: denfac, ccn, c_praut
1169 real,
intent (inout),
dimension (ktop:kbot) :: tz, vtr
1170 real,
intent (inout),
dimension (ktop:kbot) :: qv, ql, qr, qi, qs, qg
1171 real,
intent (inout),
dimension (ktop:kbot) :: m1_rain, w1
1173 real,
intent (out) :: r1
1175 real,
parameter :: so3 = 7. / 3.
1177 real,
dimension (ktop:kbot) :: dl, dm
1178 real,
dimension (ktop:kbot + 1) :: ze, zt
1180 real :: sink, dq, qc0, qc
1189 real,
parameter :: vconr = 2503.23638966667
1190 real,
parameter :: normr = 25132741228.7183
1191 real,
parameter :: thr = 1.e-8
1218 qden = qr(k) * den(k)
1219 if (qr(k) < thr)
then
1222 vtr(k) = vr_fac * vconr * sqrt(min(10., sfcrho / den(k))) * &
1223 exp(0.2 * log(qden / normr))
1224 vtr(k) = min(vr_max, max(vr_min, vtr(k)))
1230 do k = kbot, ktop, - 1
1231 ze(k) = ze(k + 1) - dz(k)
1240 call revap_racc (ktop, kbot, dt5, tz, qv, ql, qr, qi, qs, qg, den, denfac, rh_rain, h_var)
1244 dm(k) = dp(k) * (1. + qv(k) + ql(k) + qr(k) + qi(k) + qs(k) + qg(k))
1255 do k = ktop + 1, kbot
1256 zt(k) = ze(k) - dt5 * (vtr(k - 1) + vtr(k))
1258 zt(kbot + 1) = zs - dt * vtr(kbot)
1261 if (zt(k + 1) >= zt(k)) zt(k + 1) = zt(k) - dz_min
1265 call implicit_fall (dt, ktop, kbot, ze, vtr, dp, qr, r1, m1_rain)
1275 w1(ktop) = (dm(ktop) * w1(ktop) + m1_rain(ktop) * vtr(ktop)) / (dm(ktop) - m1_rain(ktop))
1276 do k = ktop + 1, kbot
1277 w1(k) = (dm(k) * w1(k) - m1_rain(k - 1) * vtr(k - 1) + m1_rain(k) * vtr(k)) &
1278 / (dm(k) + m1_rain(k - 1) - m1_rain(k))
1287 call sedi_heat (ktop, kbot, dp, m1_rain, dz, tz, qv, ql, qr, qi, qs, qg, c_liq)
1294 call revap_racc (ktop, kbot, dt5, tz, qv, ql, qr, qi, qs, qg, den, denfac, rh_rain, h_var)
1304 if (irain_f /= 0)
then
1311 qc0 = fac_rc * ccn(k)
1312 if (tz(k) > t_wfr)
then
1323 sink = min(dq, dt * c_praut(k) * den(k) * exp(so3 * log(ql(k))))
1324 ql(k) = ql(k) - sink
1325 qr(k) = qr(k) + sink
1336 call linear_prof (kbot - ktop + 1, ql(ktop), dl(ktop), z_slope_liq, h_var)
1339 qc0 = fac_rc * ccn(k)
1340 if (tz(k) > t_wfr + dt_fr)
then
1341 dl(k) = min(max(1.e-6, dl(k)), 0.5 * ql(k))
1353 dq = 0.5 * (ql(k) + dl(k) - qc)
1362 sink = min(1., dq / dl(k)) * dt * c_praut(k) * den(k) * exp(so3 * log(ql(k)))
1363 ql(k) = ql(k) - sink
1364 qr(k) = qr(k) + sink
1376subroutine revap_racc (ktop, kbot, dt, tz, qv, ql, qr, qi, qs, qg, den, denfac, rh_rain, h_var)
1380 integer,
intent (in) :: ktop, kbot
1382 real,
intent (in) :: dt
1383 real,
intent (in) :: rh_rain, h_var
1385 real,
intent (in),
dimension (ktop:kbot) :: den, denfac
1387 real,
intent (inout),
dimension (ktop:kbot) :: tz, qv, qr, ql, qi, qs, qg
1389 real,
dimension (ktop:kbot) :: lhl, cvm, q_liq, q_sol, lcpk
1391 real :: dqv, qsat, dqsdt, evap, t2, qden, q_plus, q_minus, sink
1392 real :: qpz, dq, dqh, tin
1398 if (tz(k) > t_wfr .and. qr(k) > qrmin)
then
1404 lhl(k) = lv00 + d0_vap * tz(k)
1405 q_liq(k) = ql(k) + qr(k)
1406 q_sol(k) = qi(k) + qs(k) + qg(k)
1407 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1408 lcpk(k) = lhl(k) / cvm(k)
1410 tin = tz(k) - lcpk(k) * ql(k)
1412 qsat = wqs2(tin, den(k), dqsdt)
1413 dqh = max(ql(k), h_var * max(qpz, qcmin))
1414 dqh = min(dqh, 0.2 * qpz)
1428 if (dqv > qvmin .and. qsat > q_minus)
then
1429 if (qsat > q_plus)
then
1436 dq = 0.25 * (q_minus - qsat) ** 2 / dqh
1438 qden = qr(k) * den(k)
1440 evap = crevp(1) * t2 * dq * (crevp(2) * sqrt(qden) + crevp(3) * &
1441 exp(0.725 * log(qden))) / (crevp(4) * t2 + crevp(5) * qsat * den(k))
1442 evap = min(qr(k), dt * evap, dqv / (1. + lcpk(k) * dqsdt))
1448 qr(k) = qr(k) - evap
1449 qv(k) = qv(k) + evap
1450 q_liq(k) = q_liq(k) - evap
1451 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1452 tz(k) = tz(k) - evap * lhl(k) / cvm(k)
1460 if (qr(k) > qrmin .and. ql(k) > 1.e-6 .and. qsat < q_minus)
then
1461 sink = dt * denfac(k) * cracw * exp(0.95 * log(qr(k) * den(k)))
1462 sink = sink / (1. + sink) * ql(k)
1463 ql(k) = ql(k) - sink
1464 qr(k) = qr(k) + sink
1483 integer,
intent (in) :: km
1485 real,
intent (in) :: q (km), h_var
1487 real,
intent (out) :: dm (km)
1489 logical,
intent (in) :: z_var
1497 dq(k) = 0.5 * (q(k) - q(k - 1))
1507 dm(k) = 0.5 * min(abs(dq(k) + dq(k + 1)), 0.5 * q(k))
1508 if (dq(k) * dq(k + 1) <= 0.)
then
1509 if (dq(k) > 0.)
then
1510 dm(k) = min(dm(k), dq(k), - dq(k + 1))
1524 dm(k) = max(dm(k), qvmin, h_var * q(k))
1528 dm(k) = max(qvmin, h_var * q(k))
1544subroutine icloud (ktop, kbot, tzk, p1, qvk, qlk, qrk, qik, qsk, qgk, dp1, &
1545 den, denfac, vts, vtg, vtr, qak, rh_adj, rh_rain, dts, h_var)
1549 integer,
intent (in) :: ktop, kbot
1551 real,
intent (in),
dimension (ktop:kbot) :: p1, dp1, den, denfac, vts, vtg, vtr
1553 real,
intent (inout),
dimension (ktop:kbot) :: tzk, qvk, qlk, qrk, qik, qsk, qgk, qak
1555 real,
intent (in) :: rh_adj, rh_rain, dts, h_var
1557 real,
dimension (ktop:kbot) :: lcpk, icpk, tcpk, di, lhl, lhi
1558 real,
dimension (ktop:kbot) :: cvm, q_liq, q_sol
1560 real :: rdts, fac_g2v, fac_v2g, fac_i2s, fac_imlt
1561 real :: tz, qv, ql, qr, qi, qs, qg, melt
1562 real :: pracs, psacw, pgacw, psacr, pgacr, pgaci, praci, psaci
1563 real :: pgmlt, psmlt, pgfr, pgaut, psaut, pgsub
1564 real :: tc, tsq, dqs0, qden, qim, qsm
1565 real :: dt5, factor, sink, qi_crt
1566 real :: tmp, qsw, qsi, dqsdt, dq
1567 real :: dtmp, qc, q_plus, q_minus
1579 fac_i2s = 1. - exp(- dts / tau_i2s)
1580 fac_g2v = 1. - exp(- dts / tau_g2v)
1581 fac_v2g = 1. - exp(- dts / tau_v2g)
1583 fac_imlt = 1. - exp(- dt5 / tau_imlt)
1590 lhi(k) = li00 + dc_ice * tzk(k)
1591 q_liq(k) = qlk(k) + qrk(k)
1592 q_sol(k) = qik(k) + qsk(k) + qgk(k)
1593 cvm(k) = c_air + qvk(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1594 icpk(k) = lhi(k) / cvm(k)
1605 if (tzk(k) > tice .and. qik(k) > qcmin)
then
1611 melt = min(qik(k), fac_imlt * (tzk(k) - tice) / icpk(k))
1612 tmp = min(melt, dim(ql_mlt, qlk(k)))
1613 qlk(k) = qlk(k) + tmp
1614 qrk(k) = qrk(k) + melt - tmp
1615 qik(k) = qik(k) - melt
1616 q_liq(k) = q_liq(k) + melt
1617 q_sol(k) = q_sol(k) - melt
1618 cvm(k) = c_air + qvk(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1619 tzk(k) = tzk(k) - melt * lhi(k) / cvm(k)
1621 elseif (tzk(k) < t_wfr .and. qlk(k) > qcmin)
then
1628 dtmp = t_wfr - tzk(k)
1629 factor = min(1., dtmp / dt_fr)
1630 sink = min(qlk(k) * factor, dtmp / icpk(k))
1631 qi_crt = qi_gen * min(qi_lim, 0.1 * (tice - tzk(k))) / den(k)
1632 tmp = min(sink, dim(qi_crt, qik(k)))
1633 qlk(k) = qlk(k) - sink
1634 qsk(k) = qsk(k) + sink - tmp
1635 qik(k) = qik(k) + tmp
1636 q_liq(k) = q_liq(k) - sink
1637 q_sol(k) = q_sol(k) + sink
1638 cvm(k) = c_air + qvk(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1639 tzk(k) = tzk(k) + sink * lhi(k) / cvm(k)
1648 call linear_prof (kbot - ktop + 1, qik(ktop), di(ktop), z_slope_ice, h_var)
1655 lhl(k) = lv00 + d0_vap * tzk(k)
1656 lhi(k) = li00 + dc_ice * tzk(k)
1657 lcpk(k) = lhl(k) / cvm(k)
1658 icpk(k) = lhi(k) / cvm(k)
1659 tcpk(k) = lcpk(k) + icpk(k)
1668 if (p1(k) < p_min) cycle
1682 if (tc .ge. 0.)
then
1688 dqs0 = ces0 / p1(k) - qv
1690 if (qs > qcmin)
then
1697 if (ql > qrmin)
then
1698 factor = denfac(k) * csacw * exp(0.8125 * log(qs * den(k)))
1699 psacw = factor / (1. + dts * factor) * ql
1709 if (qr > qrmin)
then
1710 psacr = min(
acr3d(vts(k), vtr(k), qr, qs, csacr, acco(1, 2), &
1712 pracs =
acr3d(vtr(k), vts(k), qs, qr, cracs, acco(1, 1), den(k))
1723 psmlt = max(0.,
smlt(tc, dqs0, qs * den(k), psacw, psacr, csmlt, &
1725 sink = min(qs, dts * (psmlt + pracs), tc / icpk(k))
1728 tmp = min(sink, dim(qs_mlt, ql))
1730 qr = qr + sink - tmp
1733 q_liq(k) = q_liq(k) + sink
1734 q_sol(k) = q_sol(k) - sink
1735 cvm(k) = c_air + qv * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1736 tz = tz - sink * lhi(k) / cvm(k)
1745 lhi(k) = li00 + dc_ice * tz
1746 icpk(k) = lhi(k) / cvm(k)
1752 if (qg > qcmin .and. tc > 0.)
then
1759 pgacr = min(
acr3d(vtg(k), vtr(k), qr, qg, cgacr, acco(1, 3), &
1767 if (ql > qrmin)
then
1768 factor = cgacw * qden / sqrt(den(k) * sqrt(sqrt(qden)))
1769 pgacw = factor / (1. + dts * factor) * ql
1776 pgmlt = dts * gmlt(tc, dqs0, qden, pgacw, pgacr, cgmlt, den(k))
1777 pgmlt = min(max(0., pgmlt), qg, tc / icpk(k))
1780 q_liq(k) = q_liq(k) + pgmlt
1781 q_sol(k) = q_sol(k) - pgmlt
1782 cvm(k) = c_air + qv * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1783 tz = tz - pgmlt * lhi(k) / cvm(k)
1797 if (qi > 3.e-7)
then
1799 if (qs > 1.e-7)
then
1804 factor = dts * denfac(k) * csaci * exp(0.05 * tc + 0.8125 * log(qs * den(k)))
1805 psaci = factor / (1. + factor) * qi
1816 if (qi0_crt < 0.)
then
1819 qim = qi0_crt / den(k)
1829 tmp = fac_i2s * exp(0.025 * tc)
1832 di(k) = max(di(k), qrmin)
1834 if (q_plus > (qim + qrmin))
then
1835 if (qim > (qi - di(k)))
then
1836 dq = (0.25 * (q_plus - qim) ** 2) / di(k)
1847 sink = min(0.75 * qi, psaci + psaut)
1855 if (qg > 1.e-6)
then
1860 factor = dts * cgaci * sqrt(den(k)) * qg
1861 pgaci = factor / (1. + factor) * qi
1878 if (qr > 1.e-7 .and. tc < 0.)
then
1890 if (qs > 1.e-7)
then
1891 psacr = dts *
acr3d(vts(k), vtr(k), qr, qs, csacr, acco(1, 2), den(k))
1900 pgfr = dts * cgfr(1) / den(k) * (exp(- cgfr(2) * tc) - 1.) * &
1901 exp(1.75 * log(qr * den(k)))
1911 factor = min(sink, qr, - tc / icpk(k)) / max(sink, qrmin)
1913 psacr = factor * psacr
1914 pgfr = factor * pgfr
1920 q_liq(k) = q_liq(k) - sink
1921 q_sol(k) = q_sol(k) + sink
1922 cvm(k) = c_air + qv * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
1923 tz = tz + sink * lhi(k) / cvm(k)
1931 lhi(k) = li00 + dc_ice * tz
1932 icpk(k) = lhi(k) / cvm(k)
1938 if (qs > 1.e-7)
then
1944 if (qg > qrmin)
then
1945 sink = dts *
acr3d(vtg(k), vts(k), qs, qg, cgacs, acco(1, 4), den(k))
1954 qsm = qs0_crt / den(k)
1956 factor = dts * 1.e-3 * exp(0.09 * (tz - tice))
1957 sink = sink + factor / (1. + factor) * (qs - qsm)
1959 sink = min(qs, sink)
1965 if (qg > 1.e-7 .and. tz < tice0)
then
1971 if (ql > 1.e-6)
then
1973 factor = dts * cgacw * qden / sqrt(den(k) * sqrt(sqrt(qden)))
1974 pgacw = factor / (1. + factor) * ql
1983 if (qr > 1.e-6)
then
1984 pgacr = min(dts *
acr3d(vtg(k), vtr(k), qr, qg, cgacr, acco(1, 3), &
1990 sink = pgacr + pgacw
1991 factor = min(sink, dim(tice, tz) / icpk(k)) / max(sink, qrmin)
1992 pgacr = factor * pgacr
1993 pgacw = factor * pgacw
1995 sink = pgacr + pgacw
1999 q_liq(k) = q_liq(k) - sink
2000 q_sol(k) = q_sol(k) + sink
2001 cvm(k) = c_air + qv * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2002 tz = tz + sink * lhi(k) / cvm(k)
2022 call subgrid_z_proc (ktop, kbot, p1, den, denfac, dts, rh_adj, tzk, qvk, &
2023 qlk, qrk, qik, qsk, qgk, qak, h_var, rh_rain)
2032 ql, qr, qi, qs, qg, qa, h_var, rh_rain)
2036 integer,
intent (in) :: ktop, kbot
2038 real,
intent (in),
dimension (ktop:kbot) :: p1, den, denfac
2040 real,
intent (in) :: dts, rh_adj, h_var, rh_rain
2042 real,
intent (inout),
dimension (ktop:kbot) :: tz, qv, ql, qr, qi, qs, qg, qa
2044 real,
dimension (ktop:kbot) :: lcpk, icpk, tcpk, tcp3, lhl, lhi
2045 real,
dimension (ktop:kbot) :: cvm, q_liq, q_sol, q_cond
2047 real :: fac_v2l, fac_l2v
2049 real :: pidep, qi_crt
2056 real :: rh, rqi, tin, qsw, qsi, qpz, qstar
2057 real :: dqsdt, dwsdt, dq, dq0, factor, tmp
2058 real :: q_plus, q_minus, dt_evap, dt_pisub
2059 real :: evap, sink, tc, pisub, q_adj, dtmp
2060 real :: pssub, pgsub, tsq, qden, fac_g2v, fac_v2g
2064 if (fast_sat_adj)
then
2074 fac_v2l = 1. - exp(- dt_evap / tau_v2l)
2075 fac_l2v = 1. - exp(- dt_evap / tau_l2v)
2077 fac_g2v = 1. - exp(- dts / tau_g2v)
2078 fac_v2g = 1. - exp(- dts / tau_v2g)
2085 lhl(k) = lv00 + d0_vap * tz(k)
2086 lhi(k) = li00 + dc_ice * tz(k)
2087 q_liq(k) = ql(k) + qr(k)
2088 q_sol(k) = qi(k) + qs(k) + qg(k)
2089 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2090 lcpk(k) = lhl(k) / cvm(k)
2091 icpk(k) = lhi(k) / cvm(k)
2092 tcpk(k) = lcpk(k) + icpk(k)
2093 tcp3(k) = lcpk(k) + icpk(k) * min(1., dim(tice, tz(k)) / (tice - t_wfr))
2098 if (p1(k) < p_min) cycle
2104 if (tz(k) < t_min)
then
2105 sink = dim(qv(k), 1.e-7)
2106 qv(k) = qv(k) - sink
2107 qi(k) = qi(k) + sink
2108 q_sol(k) = q_sol(k) + sink
2109 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2110 tz(k) = tz(k) + sink * (lhl(k) + lhi(k)) / cvm(k)
2111 if (.not. do_qa) qa(k) = qa(k) + 1.
2119 lhl(k) = lv00 + d0_vap * tz(k)
2120 lhi(k) = li00 + dc_ice * tz(k)
2121 lcpk(k) = lhl(k) / cvm(k)
2122 icpk(k) = lhi(k) / cvm(k)
2123 tcpk(k) = lcpk(k) + icpk(k)
2124 tcp3(k) = lcpk(k) + icpk(k) * min(1., dim(tice, tz(k)) / (tice - t_wfr))
2130 qpz = qv(k) + ql(k) + qi(k)
2131 tin = tz(k) - (lhl(k) * (ql(k) + qi(k)) + lhi(k) * qi(k)) / (c_air + &
2132 qpz * c_vap + qr(k) * c_liq + (qs(k) + qg(k)) * c_ice)
2133 if (tin > t_sub + 6.)
then
2134 rh = qpz / iqs1(tin, den(k))
2135 if (rh < rh_adj)
then
2148 qsw = wqs2(tz(k), den(k), dwsdt)
2155 factor = min(1., fac_l2v * (10. * dq0 / qsw))
2156 evap = min(ql(k), factor * dq0 / (1. + tcp3(k) * dwsdt))
2162 evap = dq0 / (1. + tcp3(k) * dwsdt)
2164 qv(k) = qv(k) + evap
2165 ql(k) = ql(k) - evap
2166 q_liq(k) = q_liq(k) - evap
2167 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2168 tz(k) = tz(k) - evap * lhl(k) / cvm(k)
2174 lhi(k) = li00 + dc_ice * tz(k)
2175 icpk(k) = lhi(k) / cvm(k)
2181 dtmp = t_wfr - tz(k)
2182 if (dtmp > 0. .and. ql(k) > qcmin)
then
2183 sink = min(ql(k), ql(k) * dtmp * 0.125, dtmp / icpk(k))
2184 ql(k) = ql(k) - sink
2185 qi(k) = qi(k) + sink
2186 q_liq(k) = q_liq(k) - sink
2187 q_sol(k) = q_sol(k) + sink
2188 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2189 tz(k) = tz(k) + sink * lhi(k) / cvm(k)
2196 lhi(k) = li00 + dc_ice * tz(k)
2197 icpk(k) = lhi(k) / cvm(k)
2203 if (fast_sat_adj)
then
2204 dt_pisub = 0.5 * dts
2208 if (ql(k) > qrmin .and. tc > 0.)
then
2209 sink = 3.3333e-10 * dts * (exp(0.66 * tc) - 1.) * den(k) * ql(k) * ql(k)
2210 sink = min(ql(k), tc / icpk(k), sink)
2211 ql(k) = ql(k) - sink
2212 qi(k) = qi(k) + sink
2213 q_liq(k) = q_liq(k) - sink
2214 q_sol(k) = q_sol(k) + sink
2215 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2216 tz(k) = tz(k) + sink * lhi(k) / cvm(k)
2224 lhl(k) = lv00 + d0_vap * tz(k)
2225 lhi(k) = li00 + dc_ice * tz(k)
2226 lcpk(k) = lhl(k) / cvm(k)
2227 icpk(k) = lhi(k) / cvm(k)
2228 tcpk(k) = lcpk(k) + icpk(k)
2234 if (tz(k) < tice)
then
2235 qsi = iqs2(tz(k), den(k), dqsdt)
2237 sink = dq / (1. + tcpk(k) * dqsdt)
2238 if (qi(k) > qrmin)
then
2241 pidep = dt_pisub * dq * 349138.78 * exp(0.875 * log(qi(k) * den(k))) &
2242 / (qsi * den(k) * lat2 / (0.0243 * rvgas * tz(k) ** 2) + 4.42478e4)
2250 qi_crt = qi_gen * min(qi_lim, 0.1 * tmp) / den(k)
2251 sink = min(sink, max(qi_crt - qi(k), pidep), tmp / tcpk(k))
2253 pidep = pidep * min(1., dim(tz(k), t_sub) * 0.2)
2254 sink = max(pidep, sink, - qi(k))
2256 qv(k) = qv(k) - sink
2257 qi(k) = qi(k) + sink
2258 q_sol(k) = q_sol(k) + sink
2259 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2260 tz(k) = tz(k) + sink * (lhl(k) + lhi(k)) / cvm(k)
2267 lhl(k) = lv00 + d0_vap * tz(k)
2268 lhi(k) = li00 + dc_ice * tz(k)
2269 lcpk(k) = lhl(k) / cvm(k)
2270 icpk(k) = lhi(k) / cvm(k)
2271 tcpk(k) = lcpk(k) + icpk(k)
2278 if (qs(k) > qrmin)
then
2279 qsi = iqs2(tz(k), den(k), dqsdt)
2280 qden = qs(k) * den(k)
2281 tmp = exp(0.65625 * log(qden))
2283 dq = (qsi - qv(k)) / (1. + tcpk(k) * dqsdt)
2284 pssub = cssub(1) * tsq * (cssub(2) * sqrt(qden) + cssub(3) * tmp * &
2285 sqrt(denfac(k))) / (cssub(4) * tsq + cssub(5) * qsi * den(k))
2286 pssub = (qsi - qv(k)) * dts * pssub
2287 if (pssub > 0.)
then
2288 pssub = min(pssub * min(1., dim(tz(k), t_sub) * 0.2), qs(k))
2290 if (tz(k) > tice)
then
2293 pssub = max(pssub, dq, (tz(k) - tice) / tcpk(k))
2296 qs(k) = qs(k) - pssub
2297 qv(k) = qv(k) + pssub
2298 q_sol(k) = q_sol(k) - pssub
2299 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2300 tz(k) = tz(k) - pssub * (lhl(k) + lhi(k)) / cvm(k)
2307 lhl(k) = lv00 + d0_vap * tz(k)
2308 lhi(k) = li00 + dc_ice * tz(k)
2309 lcpk(k) = lhl(k) / cvm(k)
2310 icpk(k) = lhi(k) / cvm(k)
2311 tcpk(k) = lcpk(k) + icpk(k)
2317 if (qg(k) > qrmin)
then
2318 qsi = iqs2(tz(k), den(k), dqsdt)
2319 dq = (qv(k) - qsi) / (1. + tcpk(k) * dqsdt)
2320 pgsub = (qv(k) / qsi - 1.) * qg(k)
2321 if (pgsub > 0.)
then
2322 if (tz(k) > tice)
then
2325 pgsub = min(fac_v2g * pgsub, 0.2 * dq, ql(k) + qr(k), &
2326 (tice - tz(k)) / tcpk(k))
2329 pgsub = max(fac_g2v * pgsub, dq) * min(1., dim(tz(k), t_sub) * 0.1)
2331 qg(k) = qg(k) + pgsub
2332 qv(k) = qv(k) - pgsub
2333 q_sol(k) = q_sol(k) + pgsub
2334 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2335 tz(k) = tz(k) + pgsub * (lhl(k) + lhi(k)) / cvm(k)
2343 lhl(k) = lv00 + d0_vap * tz(k)
2344 lcpk(k) = lhl(k) / cvm(k)
2350 if (qr(k) > qcmin)
then
2351 qsw = wqs2(tz(k), den(k), dqsdt)
2352 sink = min(qr(k), dim(rh_rain * qsw, qv(k)) / (1. + lcpk(k) * dqsdt))
2353 qv(k) = qv(k) + sink
2354 qr(k) = qr(k) - sink
2355 q_liq(k) = q_liq(k) - sink
2356 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2357 tz(k) = tz(k) - sink * lhl(k) / cvm(k)
2365 lhl(k) = lv00 + d0_vap * tz(k)
2366 cvm(k) = c_air + (qv(k) + q_liq(k) + q_sol(k)) * c_vap
2367 lcpk(k) = lhl(k) / cvm(k)
2380 q_sol(k) = qi(k) + qs(k)
2385 q_liq(k) = ql(k) + qr(k)
2389 q_cond(k) = q_liq(k) + q_sol(k)
2391 qpz = qv(k) + q_cond(k)
2397 tin = tz(k) - (lcpk(k) * q_cond(k) + icpk(k) * q_sol(k))
2405 if (tin <= t_wfr)
then
2407 qstar = iqs1(tin, den(k))
2408 elseif (tin >= tice)
then
2410 qstar =
wqs1(tin, den(k))
2413 qsi = iqs1(tin, den(k))
2414 qsw =
wqs1(tin, den(k))
2415 if (q_cond(k) > 3.e-6)
then
2416 rqi = q_sol(k) / q_cond(k)
2421 rqi = (tice - tin) / (tice - t_wfr)
2423 qstar = rqi * qsi + (1. - rqi) * qsw
2431 if (qpz > qrmin)
then
2433 dq = max(qcmin, h_var * qpz)
2436 if (qstar < q_minus)
then
2438 elseif (qstar < q_plus .and. q_cond(k) > qc_crt)
then
2439 qa(k) = qa(k) + (q_plus - qstar) / (dq + dq)
2451subroutine revap_rac1 (hydrostatic, is, ie, dt, tz, qv, ql, qr, qi, qs, qg, den, hvar)
2455 logical,
intent (in) :: hydrostatic
2457 integer,
intent (in) :: is, ie
2459 real,
intent (in) :: dt
2461 real,
intent (in),
dimension (is:ie) :: den, hvar, qi, qs, qg
2463 real,
intent (inout),
dimension (is:ie) :: tz, qv, qr, ql
2465 real,
dimension (is:ie) :: lcp2, denfac, q_liq, q_sol, cvm, lhl
2467 real :: dqv, qsat, dqsdt, evap, qden, q_plus, q_minus, sink
2468 real :: tin, t2, qpz, dq, dqh
2477 lhl(i) = lv00 + d0_vap * tz(i)
2478 q_liq(i) = ql(i) + qr(i)
2479 q_sol(i) = qi(i) + qs(i) + qg(i)
2480 cvm(i) = c_air + qv(i) * c_vap + q_liq(i) * c_liq + q_sol(i) * c_ice
2481 lcp2(i) = lhl(i) / cvm(i)
2486 if (qr(i) > qrmin .and. tz(i) > t_wfr)
then
2488 tin = tz(i) - lcp2(i) * ql(i)
2489 qsat = wqs2(tin, den(i), dqsdt)
2490 dqh = max(ql(i), hvar(i) * max(qpz, qcmin))
2504 if (dqv > qvmin .and. qsat > q_minus)
then
2505 if (qsat > q_plus)
then
2510 dq = 0.25 * (q_minus - qsat) ** 2 / dqh
2512 qden = qr(i) * den(i)
2514 evap = crevp(1) * t2 * dq * (crevp(2) * sqrt(qden) + crevp(3) * exp(0.725 * log(qden))) &
2515 / (crevp(4) * t2 + crevp(5) * qsat * den(i))
2516 evap = min(qr(i), dt * evap, dqv / (1. + lcp2(i) * dqsdt))
2517 qr(i) = qr(i) - evap
2518 qv(i) = qv(i) + evap
2519 q_liq(i) = q_liq(i) - evap
2520 cvm(i) = c_air + qv(i) * c_vap + q_liq(i) * c_liq + q_sol(i) * c_ice
2521 tz(i) = tz(i) - evap * lhl(i) / cvm(i)
2528 if (qr(i) > qrmin .and. ql(i) > 1.e-8 .and. qsat < q_plus)
then
2529 denfac(i) = sqrt(sfcrho / den(i))
2530 sink = dt * denfac(i) * cracw * exp(0.95 * log(qr(i) * den(i)))
2531 sink = sink / (1. + sink) * ql(i)
2532 ql(i) = ql(i) - sink
2533 qr(i) = qr(i) + sink
2544subroutine terminal_fall (dtm, ktop, kbot, tz, qv, ql, qr, qg, qs, qi, dz, dp, &
2545 den, vtg, vts, vti, r1, g1, s1, i1, m1_sol, w1)
2549 integer,
intent (in) :: ktop, kbot
2551 real,
intent (in) :: dtm
2553 real,
intent (in),
dimension (ktop:kbot) :: vtg, vts, vti, den, dp, dz
2555 real,
intent (inout),
dimension (ktop:kbot) :: qv, ql, qr, qg, qs, qi, tz, m1_sol, w1
2557 real,
intent (out) :: r1, g1, s1, i1
2559 real,
dimension (ktop:kbot + 1) :: ze, zt
2561 real :: qsat, dqsdt, dt5, evap, dtime
2562 real :: factor, frac
2563 real :: tmp, precip, tc, sink
2565 real,
dimension (ktop:kbot) :: lcpk, icpk, cvm, q_liq, q_sol, lhl, lhi
2566 real,
dimension (ktop:kbot) :: m1, dm
2576 fac_imlt = 1. - exp(- dt5 / tau_imlt)
2584 lhl(k) = lv00 + d0_vap * tz(k)
2585 lhi(k) = li00 + dc_ice * tz(k)
2586 q_liq(k) = ql(k) + qr(k)
2587 q_sol(k) = qi(k) + qs(k) + qg(k)
2588 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2589 lcpk(k) = lhl(k) / cvm(k)
2590 icpk(k) = lhi(k) / cvm(k)
2598 do k = ktop, kbot - 1
2599 if (tz(k) > tice)
then
2611 if (qi(k) > qcmin .and. tc > 0.)
then
2612 sink = min(qi(k), fac_imlt * tc / icpk(k))
2613 tmp = min(sink, dim(ql_mlt, ql(k)))
2615 qr(k) = qr(k) + sink - tmp
2616 qi(k) = qi(k) - sink
2617 q_liq(k) = q_liq(k) + sink
2618 q_sol(k) = q_sol(k) - sink
2619 cvm(k) = c_air + qv(k) * c_vap + q_liq(k) * c_liq + q_sol(k) * c_ice
2620 tz(k) = tz(k) - sink * lhi(k) / cvm(k)
2629 if (dtm < 60.) k0 = kbot
2636 do k = kbot, ktop, - 1
2637 ze(k) = ze(k + 1) - dz(k)
2647 lhi(k) = li00 + dc_ice * tz(k)
2648 icpk(k) = lhi(k) / cvm(k)
2657 if (vi_fac < 1.e-5 .or. no_fall)
then
2661 do k = ktop + 1, kbot
2662 zt(k) = ze(k) - dt5 * (vti(k - 1) + vti(k))
2664 zt(kbot + 1) = zs - dtm * vti(kbot)
2667 if (zt(k + 1) >= zt(k)) zt(k + 1) = zt(k) - dz_min
2671 do k = kbot - 1, k0, - 1
2672 if (qi(k) > qrmin)
then
2674 if (zt(k + 1) >= ze(m))
exit
2675 if (zt(k) < ze(m + 1) .and. tz(m) > tice)
then
2676 dtime = min(1.0, (ze(m) - ze(m + 1)) / (max(vr_min, vti(k)) * tau_imlt))
2677 sink = min(qi(k) * dp(k) / dp(m), dtime * (tz(m) - tice) / icpk(m))
2678 tmp = min(sink, dim(ql_mlt, ql(m)))
2680 qr(m) = qr(m) - tmp + sink
2681 tz(m) = tz(m) - sink * icpk(m)
2682 qi(k) = qi(k) - sink * dp(m) / dp(k)
2691 dm(k) = dp(k) * (1. + qv(k) + ql(k) + qr(k) + qi(k) + qs(k) + qg(k))
2698 call implicit_fall (dtm, ktop, kbot, ze, vti, dp, qi, i1, m1_sol)
2702 w1(ktop) = (dm(ktop) * w1(ktop) + m1_sol(ktop) * vti(ktop)) / (dm(ktop) - m1_sol(ktop))
2703 do k = ktop + 1, kbot
2704 w1(k) = (dm(k) * w1(k) - m1_sol(k - 1) * vti(k - 1) + m1_sol(k) * vti(k)) &
2705 / (dm(k) + m1_sol(k - 1) - m1_sol(k))
2723 do k = ktop + 1, kbot
2724 zt(k) = ze(k) - dt5 * (vts(k - 1) + vts(k))
2726 zt(kbot + 1) = zs - dtm * vts(kbot)
2729 if (zt(k + 1) >= zt(k)) zt(k + 1) = zt(k) - dz_min
2733 do k = kbot - 1, k0, - 1
2734 if (qs(k) > qrmin)
then
2736 if (zt(k + 1) >= ze(m))
exit
2737 dtime = min(dtm, (ze(m) - ze(m + 1)) / (vr_min + vts(k)))
2738 if (zt(k) < ze(m + 1) .and. tz(m) > tice)
then
2739 dtime = min(1.0, dtime / tau_smlt)
2740 sink = min(qs(k) * dp(k) / dp(m), dtime * (tz(m) - tice) / icpk(m))
2741 tz(m) = tz(m) - sink * icpk(m)
2742 qs(k) = qs(k) - sink * dp(m) / dp(k)
2743 if (zt(k) < zs)
then
2744 r1 = r1 + sink * dp(m)
2747 qr(m) = qr(m) + sink
2750 if (qs(k) < qrmin)
exit
2758 dm(k) = dp(k) * (1. + qv(k) + ql(k) + qr(k) + qi(k) + qs(k) + qg(k))
2765 call implicit_fall (dtm, ktop, kbot, ze, vts, dp, qs, s1, m1)
2769 m1_sol(k) = m1_sol(k) + m1(k)
2773 w1(ktop) = (dm(ktop) * w1(ktop) + m1(ktop) * vts(ktop)) / (dm(ktop) - m1(ktop))
2774 do k = ktop + 1, kbot
2775 w1(k) = (dm(k) * w1(k) - m1(k - 1) * vts(k - 1) + m1(k) * vts(k)) &
2776 / (dm(k) + m1(k - 1) - m1(k))
2792 do k = ktop + 1, kbot
2793 zt(k) = ze(k) - dt5 * (vtg(k - 1) + vtg(k))
2795 zt(kbot + 1) = zs - dtm * vtg(kbot)
2798 if (zt(k + 1) >= zt(k)) zt(k + 1) = zt(k) - dz_min
2802 do k = kbot - 1, k0, - 1
2803 if (qg(k) > qrmin)
then
2805 if (zt(k + 1) >= ze(m))
exit
2806 dtime = min(dtm, (ze(m) - ze(m + 1)) / vtg(k))
2807 if (zt(k) < ze(m + 1) .and. tz(m) > tice)
then
2808 dtime = min(1., dtime / tau_g2r)
2809 sink = min(qg(k) * dp(k) / dp(m), dtime * (tz(m) - tice) / icpk(m))
2810 tz(m) = tz(m) - sink * icpk(m)
2811 qg(k) = qg(k) - sink * dp(m) / dp(k)
2812 if (zt(k) < zs)
then
2813 r1 = r1 + sink * dp(m)
2815 qr(m) = qr(m) + sink
2818 if (qg(k) < qrmin)
exit
2826 dm(k) = dp(k) * (1. + qv(k) + ql(k) + qr(k) + qi(k) + qs(k) + qg(k))
2833 call implicit_fall (dtm, ktop, kbot, ze, vtg, dp, qg, g1, m1)
2837 m1_sol(k) = m1_sol(k) + m1(k)
2841 w1(ktop) = (dm(ktop) * w1(ktop) + m1(ktop) * vtg(ktop)) / (dm(ktop) - m1(ktop))
2842 do k = ktop + 1, kbot
2843 w1(k) = (dm(k) * w1(k) - m1(k - 1) * vtg(k - 1) + m1(k) * vtg(k)) &
2844 / (dm(k) + m1(k - 1) - m1(k))
2860 integer,
intent (in) :: ktop, kbot
2862 real,
intent (in) :: q (ktop:kbot)
2864 logical,
intent (out) :: no_fall
2871 if (q(k) > qrmin)
then
2888 integer,
intent (in) :: ktop, kbot
2890 real,
intent (in) :: dt
2892 real,
intent (in),
dimension (ktop:kbot + 1) :: ze
2894 real,
intent (in),
dimension (ktop:kbot) :: vt, dp
2896 real,
intent (inout),
dimension (ktop:kbot) :: q
2898 real,
intent (out),
dimension (ktop:kbot) :: m1
2900 real,
intent (out) :: precip
2902 real,
dimension (ktop:kbot) :: dz, qm, dd
2907 dz(k) = ze(k) - ze(k + 1)
2916 qm(ktop) = q(ktop) / (dz(ktop) + dd(ktop))
2917 do k = ktop + 1, kbot
2918 qm(k) = (q(k) + dd(k - 1) * qm(k - 1)) / (dz(k) + dd(k))
2926 qm(k) = qm(k) * dz(k)
2933 m1(ktop) = q(ktop) - qm(ktop)
2934 do k = ktop + 1, kbot
2935 m1(k) = m1(k - 1) + q(k) - qm(k)
2944 q(k) = qm(k) / dp(k)
2957 integer,
intent (in) :: ktop, kbot
2959 real,
intent (in) :: zs
2961 logical,
intent (in) :: mono
2963 real,
intent (in),
dimension (ktop:kbot + 1) :: ze, zt
2965 real,
intent (in),
dimension (ktop:kbot) :: dp
2968 real,
intent (inout),
dimension (ktop:kbot) :: q, m1
2970 real,
intent (out) :: precip
2972 real,
dimension (ktop:kbot) :: qm, dz
2974 real :: a4 (4, ktop:kbot)
2976 real :: pl, pr, delz, esl
2978 integer :: k, k0, n, m
2980 real,
parameter :: r3 = 1. / 3., r23 = 2. / 3.
2987 dz(k) = zt(k) - zt(k + 1)
2989 a4(1, k) = q(k) / dz(k)
2997 call cs_profile (a4(1, ktop), dz(ktop), kbot - ktop + 1, mono)
3002 if (ze(k) <= zt(n) .and. ze(k) >= zt(n + 1))
then
3003 pl = (zt(n) - ze(k)) / dz(n)
3004 if (zt(n + 1) <= ze(k + 1))
then
3006 pr = (zt(n) - ze(k + 1)) / dz(n)
3007 qm(k) = a4(2, n) + 0.5 * (a4(4, n) + a4(3, n) - a4(2, n)) * (pr + pl) - &
3008 a4(4, n) * r3 * (pr * (pr + pl) + pl ** 2)
3009 qm(k) = qm(k) * (ze(k) - ze(k + 1))
3013 qm(k) = (ze(k) - zt(n + 1)) * (a4(2, n) + 0.5 * (a4(4, n) + &
3014 a4(3, n) - a4(2, n)) * (1. + pl) - a4(4, n) * (r3 * (1. + pl * (1. + pl))))
3018 if (ze(k + 1) < zt(m + 1))
then
3019 qm(k) = qm(k) + q(m)
3021 delz = zt(m) - ze(k + 1)
3023 qm(k) = qm(k) + delz * (a4(2, m) + 0.5 * esl * &
3024 (a4(3, m) - a4(2, m) + a4(4, m) * (1. - r23 * esl)))
3037 m1(ktop) = q(ktop) - qm(ktop)
3038 do k = ktop + 1, kbot
3039 m1(k) = m1(k - 1) + q(k) - qm(k)
3047 q(k) = qm(k) / dp(k)
3057 integer,
intent (in) :: km
3059 real,
intent (in) :: del (km)
3061 logical,
intent (in) :: do_mono
3063 real,
intent (inout) :: a4 (4, km)
3065 real,
parameter :: qp_min = 1.e-6
3069 real :: d4, bet, a_bot, grat, pmp, lac
3070 real :: pmp_1, lac_1, pmp_2, lac_2
3071 real :: da1, da2, a6da
3077 grat = del(2) / del(1)
3078 bet = grat * (grat + 0.5)
3079 q(1) = (2. * grat * (grat + 1.) * a4(1, 1) + a4(1, 2)) / bet
3080 gam(1) = (1. + grat * (grat + 1.5)) / bet
3083 d4 = del(k - 1) / del(k)
3084 bet = 2. + 2. * d4 - gam(k - 1)
3085 q(k) = (3. * (a4(1, k - 1) + d4 * a4(1, k)) - q(k - 1)) / bet
3089 a_bot = 1. + d4 * (d4 + 1.5)
3090 q(km + 1) = (2. * d4 * (d4 + 1.) * a4(1, km) + a4(1, km - 1) - a_bot * q(km)) &
3091 / (d4 * (d4 + 0.5) - a_bot * gam(km))
3094 q(k) = q(k) - gam(k) * q(k + 1)
3102 gam(k) = a4(1, k) - a4(1, k - 1)
3113 q(1) = max(q(1), 0.)
3114 q(2) = min(q(2), max(a4(1, 1), a4(1, 2)))
3115 q(2) = max(q(2), min(a4(1, 1), a4(1, 2)), 0.)
3122 if (gam(k - 1) * gam(k + 1) > 0.)
then
3123 q(k) = min(q(k), max(a4(1, k - 1), a4(1, k)))
3124 q(k) = max(q(k), min(a4(1, k - 1), a4(1, k)))
3126 if (gam(k - 1) > 0.)
then
3128 q(k) = max(q(k), min(a4(1, k - 1), a4(1, k)))
3131 q(k) = min(q(k), max(a4(1, k - 1), a4(1, k)))
3132 q(k) = max(q(k), 0.0)
3141 q(km) = min(q(km), max(a4(1, km - 1), a4(1, km)))
3142 q(km) = max(q(km), min(a4(1, km - 1), a4(1, km)), 0.)
3155 if (gam(k) * gam(k + 1) > 0.0)
then
3166 if (a4(1, k) < qp_min .or. extm(k - 1) .or. extm(k + 1))
then
3171 a4(4, k) = 6. * a4(1, k) - 3. * (a4(2, k) + a4(3, k))
3172 if (abs(a4(4, k)) > abs(a4(2, k) - a4(3, k)))
then
3174 pmp_1 = a4(1, k) - 2.0 * gam(k + 1)
3175 lac_1 = pmp_1 + 1.5 * gam(k + 2)
3176 a4(2, k) = min(max(a4(2, k), min(a4(1, k), pmp_1, lac_1)), &
3177 max(a4(1, k), pmp_1, lac_1))
3178 pmp_2 = a4(1, k) + 2.0 * gam(k)
3179 lac_2 = pmp_2 - 1.5 * gam(k - 1)
3180 a4(3, k) = min(max(a4(3, k), min(a4(1, k), pmp_2, lac_2)), &
3181 max(a4(1, k), pmp_2, lac_2))
3188 if (a4(1, k) < qp_min .or. extm(k - 1) .or. extm(k + 1))
then
3197 a4(4, k) = 6. * a4(1, k) - 3. * (a4(2, k) + a4(3, k))
3206 da1 = a4(3, k) - a4(2, k)
3208 a6da = a4(4, k) * da1
3209 if (a6da < - da2)
then
3210 a4(4, k) = 3. * (a4(2, k) - a4(1, k))
3211 a4(3, k) = a4(2, k) - a4(4, k)
3212 elseif (a6da > da2)
then
3213 a4(4, k) = 3. * (a4(3, k) - a4(1, k))
3214 a4(2, k) = a4(3, k) - a4(4, k)
3224 a4(2, km) = a4(1, km)
3225 a4(3, km) = a4(1, km)
3236 integer,
intent (in) :: km
3238 real,
intent (inout) :: a4 (4, km)
3240 real,
parameter :: r12 = 1. / 12.
3249 if (abs(a4(3, k) - a4(2, k)) < - a4(4, k))
then
3250 if ((a4(1, k) + 0.25 * (a4(3, k) - a4(2, k)) ** 2 / a4(4, k) + a4(4, k) * r12) < 0.)
then
3251 if (a4(1, k) < a4(3, k) .and. a4(1, k) < a4(2, k))
then
3255 elseif (a4(3, k) > a4(2, k))
then
3256 a4(4, k) = 3. * (a4(2, k) - a4(1, k))
3257 a4(3, k) = a4(2, k) - a4(4, k)
3259 a4(4, k) = 3. * (a4(3, k) - a4(1, k))
3260 a4(2, k) = a4(3, k) - a4(4, k)
3271subroutine fall_speed (ktop, kbot, den, qs, qi, qg, ql, tk, vts, vti, vtg)
3275 integer,
intent (in) :: ktop, kbot
3277 real,
intent (in),
dimension (ktop:kbot) :: den, qs, qi, qg, ql, tk
3278 real,
intent (out),
dimension (ktop:kbot) :: vts, vti, vtg
3282 real,
parameter :: thi = 1.0e-8
3283 real,
parameter :: thg = 1.0e-8
3284 real,
parameter :: ths = 1.0e-8
3289 real,
parameter :: aa = - 4.14122e-5
3290 real,
parameter :: bb = - 0.00538922
3291 real,
parameter :: cc = - 0.0516344
3292 real,
parameter :: dd = 0.00216078
3293 real,
parameter :: ee = 1.9714
3297 real,
parameter :: vcons = 6.6280504
3298 real,
parameter :: vcong = 87.2382675
3299 real,
parameter :: vconh = vcong * sqrt(rhoh / rhog)
3300 real,
parameter :: norms = 942477796.076938
3301 real,
parameter :: normg = 5026548245.74367
3302 real,
parameter :: normh = pi * rhoh * rnzh
3304 real,
dimension (ktop:kbot) :: qden, tc, rhof
3320 rhof(k) = sqrt(min(10., sfcrho / den(k)))
3336 if (qi(k) < thi)
then
3339 tc(k) = tk(k) - tice
3340 vti(k) = (3. + log10(qi(k) * den(k))) * (tc(k) * (aa * tc(k) + bb) + cc) + dd * tc(k) + ee
3341 vti(k) = vi0 * exp(log_10 * vti(k)) * 0.9
3342 vti(k) = min(vi_max, max(vf_min, vti(k)))
3355 if (qs(k) < ths)
then
3358 vts(k) = vs_fac * vcons * rhof(k) * exp(0.0625 * log(qs(k) * den(k) / norms))
3359 vts(k) = min(vs_max, max(vf_min, vts(k)))
3372 if (qg(k) < thg)
then
3375 vtg(k) = vg_fac * vconh * rhof(k) * sqrt(sqrt(sqrt(qg(k) * den(k) / normh)))
3376 vtg(k) = min(vg_max, max(vf_min, vtg(k)))
3381 if (qg(k) < thg)
then
3384 vtg(k) = vg_fac * vcong * rhof(k) * sqrt(sqrt(sqrt(qg(k) * den(k) / normg)))
3385 vtg(k) = min(vg_max, max(vf_min, vtg(k)))
3400 real :: gcon, cd, scm3, pisq, act (8)
3401 real :: vdifu, tcond
3404 real :: hlts, hltc, ri50
3406 real,
parameter :: gam263 = 1.456943, gam275 = 1.608355, gam290 = 1.827363, &
3407 gam325 = 2.54925, gam350 = 3.323363, gam380 = 4.694155, &
3408 gam425 = 8.285063, gam450 = 11.631769, gam480 = 17.837789, &
3409 gam625 = 184.860962, gam680 = 496.604067
3421 real,
parameter :: acc (3) = (/ 5.0, 2.0, 0.5 /)
3427 pie = 4. * atan(1.0)
3431 fac_rc = (4. / 3.) * pie * rhor * rthresh ** 3
3436 den_rc = fac_rc * ccn_o * 1.e6
3438 den_rc = fac_rc * ccn_l * 1.e6
3454 scm3 = (visk / vdifu) ** (1. / 3.)
3456 cracs = pisq * rnzr * rnzs * rhos
3457 csacr = pisq * rnzr * rnzs * rhor
3459 cgacr = pisq * rnzr * rnzh * rhor
3460 cgacs = pisq * rnzh * rnzs * rhos
3462 cgacr = pisq * rnzr * rnzg * rhor
3463 cgacs = pisq * rnzg * rnzs * rhos
3465 cgacs = cgacs * c_pgacs
3470 act(1) = pie * rnzs * rhos
3471 act(2) = pie * rnzr * rhor
3473 act(6) = pie * rnzh * rhoh
3475 act(6) = pie * rnzg * rhog
3485 acco(i, k) = acc(i) / (act(2 * k - 1) ** ((7 - i) * 0.25) * act(2 * k) ** (i * 0.25))
3489 gcon = 40.74 * sqrt(sfcrho)
3491 csacw = pie * rnzs * clin * gam325 / (4. * act(1) ** 0.8125)
3494 craci = pie * rnzr * alin * gam380 / (4. * act(2) ** 0.95)
3495 csaci = csacw * c_psaci
3498 cgacw = pie * rnzh * gam350 * gcon / (4. * act(6) ** 0.875)
3500 cgacw = pie * rnzg * gam350 * gcon / (4. * act(6) ** 0.875)
3505 cgaci = cgacw * 0.05
3509 cracw = c_cracw * cracw
3513 cssub(1) = 2. * pie * vdifu * tcond * rvgas * rnzs
3515 cgsub(1) = 2. * pie * vdifu * tcond * rvgas * rnzh
3517 cgsub(1) = 2. * pie * vdifu * tcond * rvgas * rnzg
3519 crevp(1) = 2. * pie * vdifu * tcond * rvgas * rnzr
3520 cssub(2) = 0.78 / sqrt(act(1))
3521 cgsub(2) = 0.78 / sqrt(act(6))
3522 crevp(2) = 0.78 / sqrt(act(2))
3523 cssub(3) = 0.31 * scm3 * gam263 * sqrt(clin / visk) / act(1) ** 0.65625
3524 cgsub(3) = 0.31 * scm3 * gam275 * sqrt(gcon / visk) / act(6) ** 0.6875
3525 crevp(3) = 0.31 * scm3 * gam290 * sqrt(alin / visk) / act(2) ** 0.725
3526 cssub(4) = tcond * rvgas
3527 cssub(5) = hlts ** 2 * vdifu
3531 crevp(5) = hltc ** 2 * vdifu
3533 cgfr(1) = 20.e2 * pisq * rnzr * rhor / act(2) ** 1.75
3538 csmlt(1) = 2. * pie * tcond * rnzs / hltf
3539 csmlt(2) = 2. * pie * vdifu * rnzs * hltc / hltf
3542 csmlt(5) = ch2o / hltf
3547 cgmlt(1) = 2. * pie * tcond * rnzh / hltf
3548 cgmlt(2) = 2. * pie * vdifu * rnzh * hltc / hltf
3550 cgmlt(1) = 2. * pie * tcond * rnzg / hltf
3551 cgmlt(2) = 2. * pie * vdifu * rnzg * hltc / hltf
3555 cgmlt(5) = ch2o / hltf
3568 fn_nml, errmsg, errflg)
3572 integer,
intent (in) :: me
3573 integer,
intent (in) :: master
3574 integer,
intent (in) :: nlunit
3575 integer,
intent (in) :: logunit
3577 character (len = 64),
intent (in) :: fn_nml
3578 character (len = *),
intent (in) :: input_nml_file(:)
3579 character(len=*),
intent(out) :: errmsg
3580 integer,
intent(out) :: errflg
3599#ifdef INTERNAL_FILE_NML
3600 read (input_nml_file, nml = gfdl_cloud_microphysics_nml)
3602 inquire (file = trim(fn_nml), exist = exists)
3603 if (.not. exists)
then
3604 write (6, *)
'gfdl - mp :: namelist file: ', trim(fn_nml),
' does not exist'
3606 errmsg =
'ERROR(gfdl_cloud_microphys_mod_init): namelist file '//trim(fn_nml)//
' does not exist'
3609 open (unit = nlunit, file = fn_nml, action =
'read' , status =
'old', iostat = ios)
3612 read (nlunit, nml = gfdl_cloud_microphysics_nml)
3617 if (me == master)
then
3618 write (logunit, *)
" ================================================================== "
3619 write (logunit, *)
"gfdl_cloud_microphys_mod"
3620 write (logunit, nml = gfdl_cloud_microphysics_nml)
3685 module_is_initialized = .true.
3724 tables_are_initialized = .false.
3740 if (.not. qsmith_tables_initialized)
call qsmith_init
3742 qsmith_tables_initialized = .true.
3752real function acr3d (v1, v2, q1, q2, c, cac, rho)
3756 real,
intent (in) :: v1, v2, c, rho
3757 real,
intent (in) :: q1, q2
3758 real,
intent (in) :: cac (3)
3777 acr3d = c * abs(v1 - v2) * q1 * s2 * (cac(1) * t1 + cac(2) * sqrt(t1) * s2 + cac(3) * s1)
3787real function smlt (tc, dqs, qsrho, psacw, psacr, c, rho, rhofac)
3791 real,
intent (in) :: tc, dqs, qsrho, psacw, psacr, c (5), rho, rhofac
3793 smlt = (c(1) * tc / rho - c(2) * dqs) * (c(3) * sqrt(qsrho) + &
3794 c(4) * qsrho ** 0.65625 * sqrt(rhofac)) + c(5) * tc * (psacw + psacr)
3803real function gmlt (tc, dqs, qgrho, pgacw, pgacr, c, rho)
3807 real,
intent (in) :: tc, dqs, qgrho, pgacw, pgacr, c (5), rho
3809 gmlt = (c(1) * tc / rho - c(2) * dqs) * (c(3) * sqrt(qgrho) + &
3810 c(4) * qgrho ** 0.6875 / rho ** 0.25) + c(5) * tc * (pgacw + pgacr)
3829 integer,
parameter :: length = 2621
3833 if (.not. tables_are_initialized)
then
3846 allocate (table(length))
3847 allocate (table2(length))
3848 allocate (table3(length))
3849 allocate (tablew(length))
3850 allocate (des(length))
3851 allocate (des2(length))
3852 allocate (des3(length))
3853 allocate (desw(length))
3860 do i = 1, length - 1
3861 des(i) = max(0., table(i + 1) - table(i))
3862 des2(i) = max(0., table2(i + 1) - table2(i))
3863 des3(i) = max(0., table3(i + 1) - table3(i))
3864 desw(i) = max(0., tablew(i + 1) - tablew(i))
3866 des(length) = des(length - 1)
3867 des2(length) = des2(length - 1)
3868 des3(length) = des3(length - 1)
3869 desw(length) = desw(length - 1)
3871 tables_are_initialized = .true.
3889 real,
intent (in) :: ta, den
3891 real :: es, ap1, tmin
3895 tmin = table_ice - 160.
3896 ap1 = 10. * dim(ta, tmin) + 1.
3897 ap1 = min(2621., ap1)
3899 es = tablew(it) + (ap1 - it) * desw(it)
3900 wqs1 = es / (rvgas * ta * den)
3911real function wqs2 (ta, den, dqdt)
3918 real,
intent (in) :: ta, den
3920 real,
intent (out) :: dqdt
3922 real :: es, ap1, tmin
3926 tmin = table_ice - 160.
3928 if (.not. tables_are_initialized)
call qsmith_init
3930 ap1 = 10. * dim(ta, tmin) + 1.
3931 ap1 = min(2621., ap1)
3933 es = tablew(it) + (ap1 - it) * desw(it)
3934 wqs2 = es / (rvgas * ta * den)
3937 dqdt = 10. * (desw(it) + (ap1 - it) * (desw(it + 1) - desw(it))) / (rvgas * ta * den)
3947real function wet_bulb (q, t, den)
3951 real,
intent (in) :: t, q, den
3953 real :: qs, tp, dqdt
3956 qs = wqs2(wet_bulb, den, dqdt)
3957 tp = 0.5 * (qs - q) / (1. + lcp * dqdt) * lcp
3958 wet_bulb = wet_bulb - tp
3962 qs = wqs2(wet_bulb, den, dqdt)
3963 tp = (qs - q) / (1. + lcp * dqdt) * lcp
3964 wet_bulb = wet_bulb - tp
3967end function wet_bulb
3974real function iqs1 (ta, den)
3981 real,
intent (in) :: ta, den
3983 real :: es, ap1, tmin
3987 tmin = table_ice - 160.
3988 ap1 = 10. * dim(ta, tmin) + 1.
3989 ap1 = min(2621., ap1)
3991 es = table2(it) + (ap1 - it) * des2(it)
3992 iqs1 = es / (rvgas * ta * den)
4001real function iqs2 (ta, den, dqdt)
4008 real,
intent (in) :: ta, den
4010 real,
intent (out) :: dqdt
4012 real :: es, ap1, tmin
4016 tmin = table_ice - 160.
4017 ap1 = 10. * dim(ta, tmin) + 1.
4018 ap1 = min(2621., ap1)
4020 es = table2(it) + (ap1 - it) * des2(it)
4021 iqs2 = es / (rvgas * ta * den)
4023 dqdt = 10. * (des2(it) + (ap1 - it) * (des2(it + 1) - des2(it))) / (rvgas * ta * den)
4032real function qs1d_moist (ta, qv, pa, dqdt)
4036 real,
intent (in) :: ta, pa, qv
4038 real,
intent (out) :: dqdt
4040 real :: es, ap1, tmin, eps10
4044 tmin = table_ice - 160.
4046 ap1 = 10. * dim(ta, tmin) + 1.
4047 ap1 = min(2621., ap1)
4049 es = table2(it) + (ap1 - it) * des2(it)
4050 qs1d_moist = eps * es * (1. + zvir * qv) / pa
4052 dqdt = eps10 * (des2(it) + (ap1 - it) * (des2(it + 1) - des2(it))) * (1. + zvir * qv) / pa
4054end function qs1d_moist
4062real function wqsat2_moist (ta, qv, pa, dqdt)
4066 real,
intent (in) :: ta, pa, qv
4068 real,
intent (out) :: dqdt
4070 real :: es, ap1, tmin, eps10
4074 tmin = table_ice - 160.
4076 ap1 = 10. * dim(ta, tmin) + 1.
4077 ap1 = min(2621., ap1)
4079 es = tablew(it) + (ap1 - it) * desw(it)
4080 wqsat2_moist = eps * es * (1. + zvir * qv) / pa
4082 dqdt = eps10 * (desw(it) + (ap1 - it) * (desw(it + 1) - desw(it))) * (1. + zvir * qv) / pa
4084end function wqsat2_moist
4092real function wqsat_moist (ta, qv, pa)
4096 real,
intent (in) :: ta, pa, qv
4098 real :: es, ap1, tmin
4102 tmin = table_ice - 160.
4103 ap1 = 10. * dim(ta, tmin) + 1.
4104 ap1 = min(2621., ap1)
4106 es = tablew(it) + (ap1 - it) * desw(it)
4107 wqsat_moist = eps * es * (1. + zvir * qv) / pa
4109end function wqsat_moist
4116real function qs1d_m (ta, qv, pa)
4120 real,
intent (in) :: ta, pa, qv
4122 real :: es, ap1, tmin
4126 tmin = table_ice - 160.
4127 ap1 = 10. * dim(ta, tmin) + 1.
4128 ap1 = min(2621., ap1)
4130 es = table2(it) + (ap1 - it) * des2(it)
4131 qs1d_m = eps * es * (1. + zvir * qv) / pa
4140real function d_sat (ta, den)
4144 real,
intent (in) :: ta, den
4146 real :: es_w, es_i, ap1, tmin
4150 tmin = table_ice - 160.
4151 ap1 = 10. * dim(ta, tmin) + 1.
4152 ap1 = min(2621., ap1)
4154 es_w = tablew(it) + (ap1 - it) * desw(it)
4155 es_i = table2(it) + (ap1 - it) * des2(it)
4156 d_sat = dim(es_w, es_i) / (rvgas * ta * den)
4165real function esw_table (ta)
4169 real,
intent (in) :: ta
4175 tmin = table_ice - 160.
4176 ap1 = 10. * dim(ta, tmin) + 1.
4177 ap1 = min(2621., ap1)
4179 esw_table = tablew(it) + (ap1 - it) * desw(it)
4181end function esw_table
4188real function es2_table (ta)
4192 real,
intent (in) :: ta
4198 tmin = table_ice - 160.
4199 ap1 = 10. * dim(ta, tmin) + 1.
4200 ap1 = min(2621., ap1)
4202 es2_table = table2(it) + (ap1 - it) * des2(it)
4204end function es2_table
4214 integer,
intent (in) :: n
4216 real,
intent (in) :: ta (n)
4218 real,
intent (out) :: es (n)
4224 tmin = table_ice - 160.
4227 ap1 = 10. * dim(ta(i), tmin) + 1.
4228 ap1 = min(2621., ap1)
4230 es(i) = tablew(it) + (ap1 - it) * desw(it)
4243 integer,
intent (in) :: n
4245 real,
intent (in) :: ta (n)
4247 real,
intent (out) :: es (n)
4253 tmin = table_ice - 160.
4256 ap1 = 10. * dim(ta(i), tmin) + 1.
4257 ap1 = min(2621., ap1)
4259 es(i) = table2(it) + (ap1 - it) * des2(it)
4272 integer,
intent (in) :: n
4274 real,
intent (in) :: ta (n)
4276 real,
intent (out) :: es (n)
4282 tmin = table_ice - 160.
4285 ap1 = 10. * dim(ta(i), tmin) + 1.
4286 ap1 = min(2621., ap1)
4288 es(i) = table3(it) + (ap1 - it) * des3(it)
4301 integer,
intent (in) :: n
4304 real :: tmin, tem, fac0, fac1, fac2
4308 tmin = table_ice - 160.
4315 tem = tmin + delt * real(i - 1)
4316 fac0 = (tem - t_ice) / (tem * t_ice)
4318 fac2 = (dc_vap * log(tem / t_ice) + fac1) / rvgas
4319 tablew(i) = e00 * exp(fac2)
4332 integer,
intent (in) :: n
4335 real :: tmin, tem0, tem1, fac0, fac1, fac2
4337 integer :: i, i0, i1
4339 tmin = table_ice - 160.
4342 tem0 = tmin + delt * real(i - 1)
4343 fac0 = (tem0 - t_ice) / (tem0 * t_ice)
4349 fac2 = (d2ice * log(tem0 / t_ice) + fac1) / rvgas
4355 fac2 = (dc_vap * log(tem0 / t_ice) + fac1) / rvgas
4357 table2(i) = e00 * exp(fac2)
4366 tem0 = 0.25 * (table2(i0 - 1) + 2. * table(i0) + table2(i0 + 1))
4367 tem1 = 0.25 * (table2(i1 - 1) + 2. * table(i1) + table2(i1 + 1))
4381 integer,
intent (in) :: n
4384 real :: esbasw, tbasw, esbasi, tmin, tem, aa, b, c, d, e
4387 integer :: i, i0, i1
4390 tbasw = table_ice + 100.
4392 tmin = table_ice - 160.
4395 tem = tmin + delt * real(i - 1)
4402 aa = - 9.09718 * (table_ice / tem - 1.)
4403 b = - 3.56654 * alog10(table_ice / tem)
4404 c = 0.876793 * (1. - tem / table_ice)
4406 table3(i) = 0.1 * 10 ** (aa + b + c + e)
4412 aa = - 7.90298 * (tbasw / tem - 1.)
4413 b = 5.02808 * alog10(tbasw / tem)
4414 c = - 1.3816e-7 * (10 ** ((1. - tem / tbasw) * 11.344) - 1.)
4415 d = 8.1328e-3 * (10 ** ((tbasw / tem - 1.) * (- 3.49149)) - 1.)
4417 table3(i) = 0.1 * 10 ** (aa + b + c + d + e)
4427 tem0 = 0.25 * (table3(i0 - 1) + 2. * table(i0) + table3(i0 + 1))
4428 tem1 = 0.25 * (table3(i1 - 1) + 2. * table(i1) + table3(i1 + 1))
4444 real,
intent (in) :: t, p, q
4446 real :: es, ap1, tmin
4450 tmin = table_ice - 160.
4451 ap1 = 10. * dim(t, tmin) + 1.
4452 ap1 = min(2621., ap1)
4454 es = table(it) + (ap1 - it) * des(it)
4455 qs_blend = eps * es * (1. + zvir * q) / p
4467 integer,
intent (in) :: n
4470 real :: tmin, tem, esh20
4471 real :: wice, wh2o, fac0, fac1, fac2
4476 tmin = table_ice - 160.
4483 tem = tmin + delt * real(i - 1)
4484 fac0 = (tem - t_ice) / (tem * t_ice)
4486 fac2 = (d2ice * log(tem / t_ice) + fac1) / rvgas
4487 table(i) = e00 * exp(fac2)
4495 tem = 253.16 + delt * real(i - 1)
4496 fac0 = (tem - t_ice) / (tem * t_ice)
4498 fac2 = (dc_vap * log(tem / t_ice) + fac1) / rvgas
4499 esh20 = e00 * exp(fac2)
4503 table(i + 1400) = esh20
4512 tem = 253.16 + delt * real(i - 1)
4513 wice = 0.05 * (table_ice - tem)
4514 wh2o = 0.05 * (tem - 253.16)
4515 table(i + 1400) = wice * table(i + 1400) + wh2o * esupc(i)
4527subroutine qsmith (im, km, ks, t, p, q, qs, dqdt)
4531 integer,
intent (in) :: im, km, ks
4533 real,
intent (in),
dimension (im, km) :: t, p, q
4535 real,
intent (out),
dimension (im, km) :: qs
4537 real,
intent (out),
dimension (im, km),
optional :: dqdt
4539 real :: eps10, ap1, tmin
4541 real,
dimension (im, km) :: es
4545 tmin = table_ice - 160.
4548 if (.not. tables_are_initialized)
then
4554 ap1 = 10. * dim(t(i, k), tmin) + 1.
4555 ap1 = min(2621., ap1)
4557 es(i, k) = table(it) + (ap1 - it) * des(it)
4558 qs(i, k) = eps * es(i, k) * (1. + zvir * q(i, k)) / p(i, k)
4562 if (
present (dqdt))
then
4565 ap1 = 10. * dim(t(i, k), tmin) + 1.
4566 ap1 = min(2621., ap1) - 0.5
4568 dqdt(i, k) = eps10 * (des(it) + (ap1 - it) * (des(it + 1) - des(it))) * (1. + zvir * q(i, k)) / p(i, k)
4579subroutine neg_adj (ktop, kbot, pt, dp, qv, ql, qr, qi, qs, qg)
4583 integer,
intent (in) :: ktop, kbot
4585 real,
intent (in),
dimension (ktop:kbot) :: dp
4587 real,
intent (inout),
dimension (ktop:kbot) :: pt, qv, ql, qr, qi, qs, qg
4589 real,
dimension (ktop:kbot) :: lcpk, icpk
4600 cvm = c_air + qv(k) * c_vap + (qr(k) + ql(k)) * c_liq + (qi(k) + qs(k) + qg(k)) * c_ice
4601 lcpk(k) = (lv00 + d0_vap * pt(k)) / cvm
4602 icpk(k) = (li00 + dc_ice * pt(k)) / cvm
4612 if (qi(k) < 0.)
then
4613 qs(k) = qs(k) + qi(k)
4617 if (qs(k) < 0.)
then
4618 qg(k) = qg(k) + qs(k)
4622 if (qg(k) < 0.)
then
4623 qr(k) = qr(k) + qg(k)
4624 pt(k) = pt(k) - qg(k) * icpk(k)
4633 if (qr(k) < 0.)
then
4634 ql(k) = ql(k) + qr(k)
4638 if (ql(k) < 0.)
then
4639 qv(k) = qv(k) + ql(k)
4640 pt(k) = pt(k) - ql(k) * lcpk(k)
4650 do k = ktop, kbot - 1
4651 if (qv(k) < 0.)
then
4652 qv(k + 1) = qv(k + 1) + qv(k) * dp(k) / dp(k + 1)
4661 if (qv(kbot) < 0. .and. qv(kbot - 1) > 0.)
then
4662 dq = min(- qv(kbot) * dp(kbot), qv(kbot - 1) * dp(kbot - 1))
4663 qv(kbot - 1) = qv(kbot - 1) - dq / dp(kbot - 1)
4664 qv(kbot) = qv(kbot) + dq / dp(kbot)
4722 integer,
intent (in) :: is, ie, js, je, km
4724 real,
intent (in),
dimension (is:ie, js:je, km) :: a3
4726 real,
intent (in),
dimension (is:ie, js:je, km + 1) :: hgt
4728 real,
intent (in) :: zl
4730 real,
intent (out),
dimension (is:ie, js:je) :: a2
4732 real,
dimension (km) :: zm
4741 zm(k) = 0.5 * (hgt(i, j, k) + hgt(i, j, k + 1))
4743 if (zl >= zm(1))
then
4744 a2(i, j) = a3(i, j, 1)
4745 elseif (zl <= zm(km))
then
4746 a2(i, j) = a3(i, j, km)
4749 if (zl <= zm(k) .and. zl >= zm(k + 1))
then
4750 a2(i, j) = a3(i, j, k) + (a3(i, j, k + 1) - a3(i, j, k)) * (zm(k) - zl) / (zm(k) - zm(k + 1))
4766subroutine cloud_diagnosis (is, ie, ks, ke, den, delp, lsm, qmw, qmi, qmr, qms, qmg, t, &
4767 rew, rei, rer, res, reg)
4771 integer,
intent (in) :: is, ie, ks, ke
4772 integer,
intent (in),
dimension (is:ie) :: lsm
4774 real,
intent (in),
dimension (is:ie, ks:ke) :: den, delp, t
4775 real,
intent (in),
dimension (is:ie, ks:ke) :: qmw, qmi, qmr, qms, qmg
4777 real,
intent (out),
dimension (is:ie, ks:ke) :: rew, rei, rer, res, reg
4779 real,
dimension (is:ie, ks:ke) :: qcw, qci, qcr, qcs, qcg
4783 real :: lambdar, lambdas, lambdag
4784 real :: dpg, rei_fac, mask, ccn, bw
4785 real,
parameter :: rho_0 = 50.e-3
4787 real :: rhow = 1.0e3, rhor = 1.0e3, rhos = 1.0e2, rhog = 4.0e2
4788 real :: n0r = 8.0e6, n0s = 3.0e6, n0g = 4.0e6
4789 real :: alphar = 0.8, alphas = 0.25, alphag = 0.5
4790 real :: gammar = 17.837789, gammas = 8.2850630, gammag = 11.631769
4791 real :: qmin = 1.0e-12, beta = 1.22, qmin1 = 9.e-6
4796 dpg = abs(delp(i, k)) / grav
4797 mask = min(max(real(lsm(i)), 0.0), 2.0)
4803 ccn = 0.80 * (- 1.15e-3 * (ccn_o ** 2) + 0.963 * ccn_o + 5.30) * abs(mask - 1.0) + &
4804 0.67 * (- 2.10e-4 * (ccn_l ** 2) + 0.568 * ccn_l - 27.9) * (1.0 - abs(mask - 1.0))
4806 if (qmw(i, k) .gt. qmin)
then
4807 qcw(i, k) = dpg * qmw(i, k) * 1.0e3
4808 rew(i, k) = exp(1.0 / 3.0 * log((3.0 * den(i, k) * qmw(i, k)) / (4.0 * pi * rhow * ccn))) * 1.0e4
4809 rew(i, k) = max(rewmin, min(rewmax, rew(i, k)))
4815 if (reiflag .eq. 1)
then
4821 if (qmi(i, k) .gt. qmin1)
then
4822 qci(i, k) = dpg * qmi(i, k) * 1.0e3
4823 rei_fac = log(1.0e3 * qmi(i, k) * den(i, k))
4824 if (t(i, k) - tice .lt. - 50)
then
4825 rei(i, k) = beta / 9.917 * exp(0.109 * rei_fac) * 1.0e3
4826 elseif (t(i, k) - tice .lt. - 40)
then
4827 rei(i, k) = beta / 9.337 * exp(0.080 * rei_fac) * 1.0e3
4828 elseif (t(i, k) - tice .lt. - 30)
then
4829 rei(i, k) = beta / 9.208 * exp(0.055 * rei_fac) * 1.0e3
4831 rei(i, k) = beta / 9.387 * exp(0.031 * rei_fac) * 1.0e3
4833 rei(i, k) = max(reimin, min(reimax, rei(i, k)))
4841 if (reiflag .eq. 2)
then
4847 if (qmi(i, k) .gt. qmin1)
then
4848 qci(i, k) = dpg * qmi(i, k) * 1.0e3
4849 bw = - 2. + 1.e-3 * log10(den(i, k) * qmi(i, k) / rho_0) * max(0.0, tice - t(i, k)) ** 1.5
4850 rei(i, k) = 377.4 + bw * (203.3 + bw * (37.91 + 2.3696 * bw))
4851 rei(i, k) = max(reimin, min(reimax, rei(i, k)))
4863 if (qmr(i, k) .gt. qmin)
then
4864 qcr(i, k) = dpg * qmr(i, k) * 1.0e3
4865 lambdar = exp(0.25 * log(pi * rhor * n0r / qmr(i, k) / den(i, k)))
4866 rer(i, k) = 0.5 * exp(log(gammar / 6) / alphar) / lambdar * 1.0e6
4867 rer(i, k) = max(rermin, min(rermax, rer(i, k)))
4877 if (qms(i, k) .gt. qmin1)
then
4878 qcs(i, k) = dpg * qms(i, k) * 1.0e3
4879 lambdas = exp(0.25 * log(pi * rhos * n0s / qms(i, k) / den(i, k)))
4880 res(i, k) = 0.5 * exp(log(gammas / 6) / alphas) / lambdas * 1.0e6
4881 res(i, k) = max(resmin, min(resmax, res(i, k)))
4891 if (qmg(i, k) .gt. qmin)
then
4892 qcg(i, k) = dpg * qmg(i, k) * 1.0e3
4893 lambdag = exp(0.25 * log(pi * rhog * n0g / qmg(i, k) / den(i, k)))
4894 reg(i, k) = 0.5 * exp(log(gammag / 6) / alphag) / lambdag * 1.0e6
4895 reg(i, k) = max(regmin, min(regmax, reg(i, k)))
4910 t1d, p1d, dBZ, kts, kte, ii, jj, melti)
4915 INTEGER,
INTENT(IN):: kts, kte, ii,jj
4916 REAL,
DIMENSION(kts:kte),
INTENT(IN):: &
4917 qv1d, qr1d, qs1d, qg1d, t1d, p1d
4918 REAL,
DIMENSION(kts:kte),
INTENT(INOUT):: dBZ
4921 REAL,
DIMENSION(kts:kte):: temp, pres, qv, rho
4922 REAL,
DIMENSION(kts:kte):: rr, rs, rg
4925 DOUBLE PRECISION,
DIMENSION(kts:kte):: ilamr, ilams, ilamg
4926 DOUBLE PRECISION,
DIMENSION(kts:kte):: N0_r, N0_s, N0_g
4927 DOUBLE PRECISION:: lamr, lams, lamg
4928 LOGICAL,
DIMENSION(kts:kte):: L_qr, L_qs, L_qg
4930 REAL,
DIMENSION(kts:kte):: ze_rain, ze_snow, ze_graupel
4931 DOUBLE PRECISION:: fmelt_s, fmelt_g
4933 INTEGER:: i, k, k_0, kbot, n
4934 LOGICAL,
INTENT(IN):: melti
4935 DOUBLE PRECISION:: cback, x, eta, f_d
4948 qv(k) = max(1.e-10, qv1d(k))
4950 rho(k) = 0.622*pres(k)/(rdgas*temp(k)*(qv(k)+0.622))
4952 if (qr1d(k) .gt. 1.e-9)
then
4953 rr(k) = qr1d(k)*rho(k)
4955 lamr = (xam_r*xcrg(3)*n0_r(k)/rr(k))**(1./xcre(1))
4963 if (qs1d(k) .gt. 1.e-9)
then
4964 rs(k) = qs1d(k)*rho(k)
4966 lams = (xam_s*xcsg(3)*n0_s(k)/rs(k))**(1./xcse(1))
4974 if (qg1d(k) .gt. 1.e-9)
then
4975 rg(k) = qg1d(k)*rho(k)
4977 lamg = (xam_g*xcgg(3)*n0_g(k)/rg(k))**(1./xcge(1))
4990 k_loop:
do k = kte-1, kts, -1
4991 if ( melti .and. (temp(k).gt.273.15) .and. l_qr(k) &
4992 .and. (l_qs(k+1).or.l_qg(k+1)) )
then
5005 ze_graupel(k) = 1.e-22
5006 if (l_qr(k)) ze_rain(k) = n0_r(k)*xcrg(4)*ilamr(k)**xcre(4)
5007 if (l_qs(k)) ze_snow(k) = (0.176/0.93) * (6.0/pi)*(6.0/pi) &
5008 * (xam_s/900.0)*(xam_s/900.0) &
5009 * n0_s(k)*xcsg(4)*ilams(k)**xcse(4)
5010 if (l_qg(k)) ze_graupel(k) = (0.176/0.93) * (6.0/pi)*(6.0/pi) &
5011 * (xam_g/900.0)*(xam_g/900.0) &
5012 * n0_g(k)*xcgg(4)*ilamg(k)**xcge(4)
5024 if (melti .and. k_0.ge.kts+1)
then
5025 do k = k_0-1, kts, -1
5028 if (l_qs(k) .and. l_qs(k_0) )
then
5029 fmelt_s = max(0.005d0, min(1.0d0-rs(k)/rs(k_0), 0.99d0))
5033 x = xam_s * xxds(n)**xbm_s
5034 call rayleigh_soak_wetgraupel (x,dble(xocms),dble(xobms), &
5035 fmelt_s, melt_outside_s, m_w_0, m_i_0, lamda_radar, &
5036 cback, mixingrulestring_s, matrixstring_s, &
5037 inclusionstring_s, hoststring_s, &
5038 hostmatrixstring_s, hostinclusionstring_s)
5039 f_d = n0_s(k)*xxds(n)**xmu_s * dexp(-lams*xxds(n))
5040 eta = eta + f_d * cback * simpson(n) * xdts(n)
5042 ze_snow(k) = sngl(lamda4 / (pi5 * k_w) * eta)
5048 if (l_qg(k) .and. l_qg(k_0) )
then
5049 fmelt_g = max(0.005d0, min(1.0d0-rg(k)/rg(k_0), 0.99d0))
5053 x = xam_g * xxdg(n)**xbm_g
5054 call rayleigh_soak_wetgraupel (x,dble(xocmg),dble(xobmg), &
5055 fmelt_g, melt_outside_g, m_w_0, m_i_0, lamda_radar, &
5056 cback, mixingrulestring_g, matrixstring_g, &
5057 inclusionstring_g, hoststring_g, &
5058 hostmatrixstring_g, hostinclusionstring_g)
5059 f_d = n0_g(k)*xxdg(n)**xmu_g * dexp(-lamg*xxdg(n))
5060 eta = eta + f_d * cback * simpson(n) * xdtg(n)
5062 ze_graupel(k) = sngl(lamda4 / (pi5 * k_w) * eta)
5069 dbz(k) = 10.*log10((ze_rain(k)+ze_snow(k)+ze_graupel(k))*1.d18)
real function acr3d(v1, v2, q1, q2, c, cac, rho)
The function is an accretion function (Lin et al.(1983) lin_et_al_1983 )
real function smlt(tc, dqs, qsrho, psacw, psacr, c, rho, rhofac)
Melting of snow function (Lin et al.(1983) lin_et_al_1983) note: psacw and psacr must be calc before ...
subroutine esw_table1d(ta, es, n)
The subroutine 'esw_table1d' computes the saturated water vapor pressure for table ii.
subroutine interpolate_z(is, ie, js, je, km, zl, hgt, a3, a2)
quick local sum algorithm
subroutine qs_table(n)
saturation water vapor pressure table i
subroutine qs_table3(n)
saturation water vapor pressure table iv
subroutine refl10cm_gfdl(qv1d, qr1d, qs1d, qg1d, t1d, p1d, dbz, kts, kte, ii, jj, melti)
This subroutine calculates radar reflectivity.
subroutine implicit_fall(dt, ktop, kbot, ze, vt, dp, q, precip, m1)
The subroutine computes the time-implicit monotonic fall scheme.
subroutine qsmith(im, km, ks, t, p, q, qs, dqdt)
The function 'qsmith' computes the saturated specific humidity with a blend of water and ice dependin...
subroutine, public cloud_diagnosis(is, ie, ks, ke, den, delp, lsm, qmw, qmi, qmr, qms, qmg, t, rew, rei, rer, res, reg)
The subroutine 'cloud_diagnosis' diagnoses the radius of cloud species.
subroutine cs_limiters(km, a4)
This subroutine perform positive definite constraint.
subroutine linear_prof(km, q, dm, z_var, h_var)
Definition of vertical subgrid variability used for cloud ice and cloud water autoconversion.
subroutine qs_table2(n)
saturation water vapor pressure table iii
subroutine fall_speed(ktop, kbot, den, qs, qi, qg, ql, tk, vts, vti, vtg)
The subroutine calculates vertical fall speed of snow/ice/graupel.
subroutine check_column(ktop, kbot, q, no_fall)
The subroutine 'check_column' checks if the water species is large enough to fall.
subroutine revap_racc(ktop, kbot, dt, tz, qv, ql, qr, qi, qs, qg, den, denfac, rh_rain, h_var)
This subroutine calculates evaporation of rain and accretion of rain.
subroutine icloud(ktop, kbot, tzk, p1, qvk, qlk, qrk, qik, qsk, qgk, dp1, den, denfac, vts, vtg, vtr, qak, rh_adj, rh_rain, dts, h_var)
This subroutine includes cloud ice microphysics processes.
real function wqs1(ta, den)
The function 'wqs1' returns the saturation vapor pressure over pure liquid water for a given temperat...
subroutine revap_rac1(hydrostatic, is, ie, dt, tz, qv, ql, qr, qi, qs, qg, den, hvar)
This subroutine calculates rain evaporation.
subroutine terminal_fall(dtm, ktop, kbot, tz, qv, ql, qr, qg, qs, qi, dz, dp, den, vtg, vts, vti, r1, g1, s1, i1, m1_sol, w1)
The subroutine 'terminal_fall' computes terminal fall speed.
subroutine neg_adj(ktop, kbot, pt, dp, qv, ql, qr, qi, qs, qg)
The subroutine 'neg_adj' fixes negative water species.
subroutine mpdrv(hydrostatic, uin, vin, w, delp, pt, qv, ql, qr, qi, qs, qg, qa, qn, dz, is, ie, js, je, ks, ke, ktop, kbot, j, dt_in, ntimes, rain, snow, graupel, ice, m2_rain, m2_sol, cond, area1, land, u_dt, v_dt, pt_dt, qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, w_var, vt_r, vt_s, vt_g, vt_i, qn2)
GFDL cloud microphysics, major program, and is based on Lin et al.(1983) lin_et_al_1983 and Rutledge ...
subroutine setupm
The subroutine sets up gfdl cloud microphysics parameters.
subroutine es3_table1d(ta, es, n)
The subroutine 'es3_table1d' computes the saturated water vapor pressure for table iv.
subroutine, public gfdl_cloud_microphys_mod_end()
The subroutine 'gfdl_cloud_microphys_init' terminates the GFDL cloud microphysics.
subroutine, public gfdl_cloud_microphys_mod_driver(iis, iie, jjs, jje, kks, kke, ktop, kbot, qv, ql, qr, qi, qs, qg, qa, qn, qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, pt_dt, pt, w, uin, vin, udt, vdt, dz, delp, area, dt_in, land, rain, snow, ice, graupel, hydrostatic, phys_hydrostatic, p, lradar, refl_10cm, reset, pfils, pflls)
This subroutine is the driver of the GFDL cloud microphysics.
subroutine lagrangian_fall_ppm(ktop, kbot, zs, ze, zt, dp, q, precip, m1, mono)
Lagrangian scheme.
subroutine qsmith_init
The subroutine 'qsmith_init' initializes lookup tables for saturation water vapor pressure for the fo...
subroutine, public gfdl_cloud_microphys_mod_init(me, master, nlunit, input_nml_file, logunit, fn_nml, errmsg, errflg)
The subroutine 'gfdl_cloud_microphys_init' initializes the GFDL cloud microphysics.
subroutine warm_rain(dt, ktop, kbot, dp, dz, tz, qv, ql, qr, qi, qs, qg, den, denfac, ccn, c_praut, rh_rain, vtr, r1, m1_rain, w1, h_var)
This subroutine includes warm rain cloud microphysics.
subroutine qs_tablew(n)
saturation water vapor pressure table ii
subroutine sedi_heat(ktop, kbot, dm, m1, dz, tz, qv, ql, qr, qi, qs, qg, cw)
This subroutine calculates sedimentation of heat.
real function qs_blend(t, p, q)
The function 'qs_blend' computes the saturated specific humidity with a blend of water and ice depend...
subroutine setup_con
The subroutine 'setup_con' sets up constants and calls 'qsmith_init'.
subroutine cs_profile(a4, del, km, do_mono)
subroutine subgrid_z_proc(ktop, kbot, p1, den, denfac, dts, rh_adj, tz, qv, ql, qr, qi, qs, qg, qa, h_var, rh_rain)
This subroutine calculates temperature sentive high vertical resolution processes.
subroutine es2_table1d(ta, es, n)
The subroutine 'es3_table1d' computes the saturated water vapor pressure for table iii.
This module contains the column GFDL Cloud microphysics scheme.
This module is more library code whereas the individual microphysics schemes contains specific detail...