16 subroutine cmp_tlev(nCol,nLev,minP,p_lay,t_lay,p_lev,tsfc,t_lev)
18 integer,
intent(in) :: &
20 real(kind_phys),
intent(in) :: &
22 real(kind_phys),
dimension(nCol),
intent(in) :: &
24 real(kind_phys),
dimension(nCol,nLev),
intent(in) :: &
26 real(kind_phys),
dimension(nCol,nLev+1),
intent(in) :: &
30 real(kind_phys),
dimension(nCol,nLev+1),
intent(out) :: &
34 integer :: iCol,iLay, iSFC, iTOA
36 real(kind_phys),
dimension(nCol,nLev) :: tem2da, tem2db
38 top_at_1 = (p_lev(1,1) .lt. p_lev(1, nlev))
48 tem2da(1:ncol,2:isfc) = log(p_lay(1:ncol,2:isfc))
49 tem2db(1:ncol,2:isfc) = log(p_lev(1:ncol,2:isfc))
51 tem2da(icol,1) = log(p_lay(icol,1) )
52 tem2db(icol,1) = log(max(minp, p_lev(icol,1)) )
53 tem2db(icol,isfc) = log(p_lev(icol,isfc) )
55 t_lev(1:ncol,1) = t_lay(1:ncol,itoa)
58 t_lev(icol,ilay) = t_lay(icol,ilay) + (t_lay(icol,ilay-1) - t_lay(icol,ilay))&
59 * (tem2db(icol,ilay) - tem2da(icol,ilay)) &
60 / (tem2da(icol,ilay-1) - tem2da(icol,ilay))
63 t_lev(1:ncol,isfc+1) = tsfc(1:ncol)
65 tem2da(1:ncol,2:itoa) = log(p_lay(1:ncol,2:itoa))
66 tem2db(1:ncol,2:itoa) = log(p_lev(1:ncol,2:itoa))
68 tem2da(icol,1) = log(p_lay(icol,1))
69 tem2db(icol,1) = log(p_lev(icol,1))
70 tem2db(icol,itoa) = log(max(minp, p_lev(icol,itoa)) )
73 t_lev(1:ncol,1) = tsfc(1:ncol)
76 t_lev(icol,ilay+1) = t_lay(icol,ilay) + (t_lay(icol,ilay+1) - t_lay(icol,ilay))&
77 * (tem2db(icol,ilay+1) - tem2da(icol,ilay)) &
78 / (tem2da(icol,ilay+1) - tem2da(icol,ilay))
81 t_lev(1:ncol,itoa+1) = t_lay(1:ncol,itoa)