da_lcl.inc

References to this file elsewhere.
1 subroutine da_lcl(p0, z0, t0, q0, plcl, zlcl, tlcl, qlcl)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    real, intent(in)   :: p0, z0, t0, q0
10    real, intent(out)  :: plcl, zlcl, tlcl, qlcl
11 
12    real   :: dp, qs, eps
13 
14    if (trace_use) call da_trace_entry("da_lcl")
15 
16    dp=5.0
17    plcl=300.0
18 
19    do
20       tlcl=t0*((plcl/p0)**0.286)
21 
22       call da_qfrmrh(plcl, tlcl, 100.0, qs)
23 
24       eps=qs-q0
25 
26       if (eps >= 0.0) then
27          zlcl=(1004.0/gravity)*(t0-tlcl)+z0
28          qlcl=qs
29          return
30       else
31          plcl=plcl+dp
32 
33          if (plcl >= p0) then
34             zlcl=z0
35             qlcl=q0
36             plcl=p0
37             return
38         end if
39       end if
40    end do
41 
42    if (trace_use) call da_trace_exit("da_lcl")
43 
44 end subroutine da_lcl
45 
46