1 subroutine da_cumulus (zcb, tcb, qcb, pcb, pk, te, z, t, q, lcb, lct, pct, zct, kts, kte)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 integer, intent(in) :: kts, kte
10 real, intent(inout) :: zcb, tcb, qcb, pcb
11 real, intent(in) :: pk(kts:kte)
12 real, intent(in) :: te(kts:kte)
13 real, intent(out) :: z(kts:kte)
14 real, intent(out) :: t(kts:kte)
15 real, intent(out) :: q(kts:kte)
16 integer, intent(out) :: lcb, lct
17 real, intent(out) :: pct, zct
19 integer :: k, ia, l, ncb
20 real :: cp, r, hl, em, et, p
21 real :: tll, qll, pll, zll, tbar, pbar, qbar
22 real :: dp, dz, ddt, dt
24 if (trace_use) call da_trace_entry("da_cumulus")
38 em=gravity*zcb+cp*tcb+hl*qcb
42 if (pk(kte) > pcb) then
70 call da_qfrmrh(p, t(l), 100.0, q(l))
76 dz=(r*tbar*(1.0+0.61*qbar)*dp)/(gravity*pbar)
78 et=gravity*z(l)+cp*t(l)+hl*q(l)
79 if ((et-em) <= 0.0) exit
109 if (trace_use) call da_trace_exit("da_cumulus")
111 end subroutine da_cumulus