26 & ( im, hvap, cp, rd, eps, epsm1, rvrdm1, ps, u1, v1, t1, q1, &
27 & tskin, cm, ch, lseaspray, fm, fm10, &
28 & usfco, vsfco, icplocn2atm, &
29 & prsl1, prslki, wet, use_lake_model, wind, &,
30 & flag_iter, use_med_flux, dqsfc_med, dtsfc_med, &
31 & qsurf, cmm, chh, gflux, evap, hflx, ep, &
104 use machine ,
only : kind_phys
105 use funcphys,
only : fpvs
110 real (kind=kind_phys),
parameter :: one = 1.0_kind_phys, &
111 & zero = 0.0_kind_phys, qmin = 1.0e-8_kind_phys
113 integer,
intent(in) :: im
114 real (kind=kind_phys),
intent(in) :: hvap, cp, rd, &
117 real (kind=kind_phys),
dimension(:),
intent(in) :: ps, u1, v1, &
118 & t1, q1, tskin, cm, ch, fm, fm10, prsl1, prslki, wind, &
122 logical,
intent(in) :: lseaspray
124 logical,
dimension(:),
intent(in) :: flag_iter, wet
125 integer,
dimension(:),
intent(in) :: use_lake_model
126 integer,
intent(in) :: icplocn2atm
128 logical,
intent(in) :: use_med_flux
131 real (kind=kind_phys),
dimension(:),
intent(in),
optional :: &
132 & dqsfc_med, dtsfc_med
135 real (kind=kind_phys),
dimension(:),
intent(inout) :: qsurf, &
136 & cmm, chh, gflux, evap, hflx, ep
138 character(len=*),
intent(out) :: errmsg
139 integer,
intent(out) :: errflg
143 real (kind=kind_phys) :: qss, rch, tem,
144 & elocp, cpinv, hvapi
145 real (kind=kind_phys),
dimension(im) :: rho, q0
146 real (kind=kind_phys),
dimension(im) :: windrel
154 real (kind=kind_phys) :: f10m, u10m, v10m, ws10, ru10, qss1,
155 & bb1, hflxs, evaps, ptem
160 real (kind=kind_phys),
parameter :: alps=0.75,bets=0.75,gams=0.15,
161 & ws10cr=30., conlf=7.2e-9, consf=6.4e-8
176 flag(i) = (wet(i) .and. flag_iter(i) .and. use_lake_model(i)/=1)
182 if (use_med_flux)
then
183 q0(i) = max( q1(i), qmin )
184 rho(i) = prsl1(i) / (rd*t1(i)*(one + rvrdm1*q0(i)))
186 if (icplocn2atm == 0)
then
187 tem = ch(i) * wind(i)
188 cmm(i) = cm(i) * wind(i)
189 else if (icplocn2atm ==1)
then
190 windrel(i)=sqrt( (u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2 )
191 tem = ch(i) * windrel(i)
192 cmm(i) = cm(i) * windrel(i)
194 chh(i) = rho(i) * tem
196 hflx(i) = dtsfc_med(i)
197 evap(i) = dqsfc_med(i)
199 qsurf(i) = q1(i) + dqsfc_med(i) / (hvap*chh(i))
202 q0(i) = max( q1(i), qmin )
203 rho(i) = prsl1(i) / (rd*t1(i)*(one + rvrdm1*q0(i)))
205 qss = fpvs( tskin(i) )
206 qss = eps*qss / (ps(i) + epsm1*qss)
210 if (icplocn2atm == 0)
then
211 rch = rho(i) * cp * ch(i) * wind(i)
212 tem = ch(i) * wind(i)
213 cmm(i) = cm(i) * wind(i)
214 else if (icplocn2atm ==1)
then
215 windrel(i)=sqrt( (u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2 )
216 rch = rho(i) * cp * ch(i) * windrel(i)
217 tem = ch(i) * windrel(i)
218 cmm(i) = cm(i) * windrel(i)
220 chh(i) = rho(i) * tem
224 hflx(i) = rch * (tskin(i) - t1(i) * prslki(i))
226 evap(i) = elocp * rch * (qss - q0(i))
237 if(lseaspray .and. flag(i))
then
238 f10m = fm10(i) / fm(i)
241 ws10 = sqrt(u10m*u10m + v10m*v10m)
243 ws10 = min(ws10,ws10cr)
244 tem = .015 * ws10 * ws10
245 ru10 = 1. - .087 * log(10./tem)
247 qss1 = eps * qss1 / (prsl1(i) + epsm1 * qss1)
248 tem = rd * cp * t1(i) * t1(i)
249 tem = 1. + eps * hvap * hvap * qss1 / tem
251 evaps = conlf * (ws10**5.4) * ru10 * bb1
252 evaps = evaps * rho(i) * hvap * (qss1 - q0(i))
253 evap(i) = evap(i) + alps * evaps
254 hflxs = consf * (ws10**3.4) * ru10
255 hflxs = hflxs * rho(i) * cp * (tskin(i) - t1(i))
257 hflx(i) = hflx(i) + bets * hflxs - ptem * evaps
264 hflx(i) = hflx(i) * tem * cpinv
265 evap(i) = evap(i) * tem * hvapi
subroutine, public sfc_ocean_run(im, hvap, cp, rd, eps, epsm1, rvrdm1, ps, u1, v1, t1, q1, tskin, cm, ch, lseaspray, fm, fm10, usfco, vsfco, icplocn2atm, prsl1, prslki, wet, use_lake_model, wind,,