36 subroutine ozphys (ix, im, levs, ko3, dt, ozi, ozo, tin, po3,
37 & prsl, prdout, pl_coeff, delp, ldiag3d,
43 use machine
, only : kind_phys
44 use physcons
, only : grav =>
con_g
47 real,
parameter :: gravi=1.0/grav
48 integer im, ix, levs, ko3, pl_coeff,me
49 real(kind=kind_phys) ozi(ix,levs), ozo(ix,levs), po3(ko3),
50 & prsl(ix,levs), tin(ix,levs), delp(ix,levs),
51 & prdout(ix,ko3,pl_coeff),
52 & ozp(ix,levs,pl_coeff), dt
54 integer k,kmax,kmin,l,i,j
55 logical ldiag3d, flg(im)
56 real(kind=kind_phys) pmax, pmin, tem, temp
57 real(kind=kind_phys) wk1(im), wk2(im), wk3(im), prod(im,pl_coeff),
58 & ozib(im), colo3(im,levs+1)
60 if (pl_coeff > 2)
then
64 colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l) * gravi
74 wk1(i) = log(prsl(i,l))
75 pmin = min(wk1(i), pmin)
76 pmax = max(wk1(i), pmax)
82 if (pmin < po3(k)) kmax = k
83 if (pmax < po3(k)) kmin = k
87 temp = 1.0 / (po3(k) - po3(k+1))
90 if (wk1(i) < po3(k) .and. wk1(i) >= po3(k+1))
then
92 wk2(i) = (wk1(i) - po3(k+1)) * temp
99 prod(i,j) = wk2(i) * prdout(i,k,j)
100 & + wk3(i) * prdout(i,k+1,j)
108 if (wk1(i) < po3(ko3))
then
109 prod(i,j) = prdout(i,ko3,j)
111 if (wk1(i) >= po3(1))
then
112 prod(i,j) = prdout(i,1,j)
116 if (pl_coeff == 2)
then
119 ozo(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt)
124 ozp(i,l,1) = ozp(i,l,1) + prod(i,1)*dt
125 ozp(i,l,2) = ozp(i,l,2) + (ozo(i,l) - ozib(i))
129 if (pl_coeff == 4)
then
132 tem = prod(i,1) + prod(i,3)*tin(i,l)
133 & + prod(i,4)*colo3(i,l+1)
136 ozo(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt)
140 ozp(i,l,1) = ozp(i,l,1) + prod(i,1)*dt
141 ozp(i,l,2) = ozp(i,l,2) + (ozo(i,l) - ozib(i))
142 ozp(i,l,3) = ozp(i,l,3) + prod(i,3)*tin(i,l)*dt
143 ozp(i,l,4) = ozp(i,l,4) + prod(i,4)*colo3(i,l+1)*dt
real(kind=kind_phys), parameter con_g
gravity ( )