41 & h2opltc, h2o_coeff, me, &
50 use machine ,
only : kind_phys
53 integer,
intent(in) :: im, levs, kh2o, h2o_coeff, me
54 real(kind=kind_phys),
intent(in) :: dt
55 real(kind=kind_phys),
intent(inout) :: h2o(:,:)
56 real(kind=kind_phys),
intent(in) :: ph2o(:)
57 real(kind=kind_phys),
intent(in) :: prsl(:,:)
58 real(kind=kind_phys),
intent(in) :: h2opltc(:,:,:)
60 character(len=*),
intent(out) :: errmsg
61 integer,
intent(out) :: errflg
63 integer k,kmax,kmin,l,i,j
65 real(kind=kind_phys) pmax, pmin, tem, temp
66 real(kind=kind_phys) wk1(im), wk2(im), wk3(im), pltc(im,h2o_coeff)
68 real,
parameter :: prsmax=10000.0, pmaxl=log(prsmax)
80 wk1(i) = log(prsl(i,l))
81 pmin = min(wk1(i), pmin)
82 pmax = max(wk1(i), pmax)
85 if (pmin < pmaxl)
then
89 if (pmin < ph2o(k)) kmax = k
90 if (pmax < ph2o(k)) kmin = k
94 temp = 1.0 / (ph2o(k) - ph2o(k+1))
97 if (wk1(i) < ph2o(k) .and. wk1(i) >= ph2o(k+1))
then
99 wk2(i) = (wk1(i) - ph2o(k+1)) * temp
100 wk3(i) = 1.0 - wk2(i)
106 pltc(i,j) = wk2(i) * h2opltc(i,k,j)
107 & + wk3(i) * h2opltc(i,k+1,j)
115 if (wk1(i) < ph2o(kh2o))
then
116 pltc(i,j) = h2opltc(i,kh2o,j)
118 if (wk1(i) >= ph2o(1))
then
119 pltc(i,j) = h2opltc(i,1,j)
125 if (prsl(i,l) < prsmax .and. pltc(i,2) /= 0.0)
then
127 tem = 1.0 / pltc(i,2)
128 h2o(i,l) = (h2oib(i) + (pltc(i,1)+pltc(i,3)*tem)*dt)
subroutine, public h2ophys_run(im, levs, kh2o, dt, h2o, ph2o, prsl, h2opltc, h2o_coeff, me, errmsg, errflg)