46 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
56 integer,
intent(in) :: ka, ks, ke
57 integer,
intent(in) :: ia, is, ie
58 integer,
intent(in) :: ja, js, je
60 real(
rp),
intent(in) :: dens (ka,ia,ja)
61 real(
rp),
intent(in) :: pres (ka,ia,ja)
62 real(
rp),
intent(in) :: qv (ka,ia,ja)
63 real(
rp),
intent(in) :: sfc_temp(ia,ja)
64 real(
rp),
intent(in) :: fz (0:ka,ia,ja)
65 real(
rp),
intent(out) :: sfc_dens(ia,ja)
66 real(
rp),
intent(out) :: sfc_pres(ia,ja)
70 real(
rp) :: f2h1, f2h2
71 real(
rp) :: logp1, logp2
85 dz1 = fz(ks+1,i,j) - fz(ks,i,j)
86 dz2 = fz(ks,i,j) - fz(ks-1,i,j)
88 f2h1 = dz2 / ( dz1 + dz2 )
89 f2h2 = dz1 / ( dz1 + dz2 )
91 logp1 = log( pres(ks+1,i,j) )
92 logp2 = log( pres(ks,i,j) )
94 presh = exp( f2h1 * logp1 + f2h2 * logp2 )
96 rtot = rdry * ( 1.0_rp + epstvap * qv(ks,i,j) )
98 sfc_pres(i,j) = presh + grav * dens(ks,i,j) * dz2
99 sfc_dens(i,j) = sfc_pres(i,j) / ( rtot * sfc_temp(i,j) )
114 real(
rp),
intent(in) :: p
115 real(
rp),
intent(in) :: x(3), y(3)
119 q = ( (p-x(2)) * (p-x(3)) ) / ( (x(1)-x(2)) * (x(1)-x(3)) ) * y(1) &
120 + ( (p-x(1)) * (p-x(3)) ) / ( (x(2)-x(1)) * (x(2)-x(3)) ) * y(2) &
121 + ( (p-x(1)) * (p-x(2)) ) / ( (x(3)-x(1)) * (x(3)-x(2)) ) * y(3)