57 & itimestep,iter,flag_iter, &
58 & flag_init,flag_restart,lsm,lsm_ruc,&
59 & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
61 & redrag,sfc_z0_type, &
63 & sfclay_compute_flux, &
64 & sfclay_compute_diag, &
66 & u, v, t3d, qvsh, qc, prsl, phii, &
67 & exner, ps, pblh, slmsk, &
69 & tskin_wat, tskin_lnd, tskin_ice, &
70 & tsurf_wat, tsurf_lnd, tsurf_ice, &
71 & qsfc_wat, qsfc_lnd, qsfc_ice, &
72 & snowh_lnd, snowh_ice, &
73 & znt_wat, znt_lnd, znt_ice, &
74 & ust_wat, ust_lnd, ust_ice, &
75 & cm_wat, cm_lnd, cm_ice, &
76 & ch_wat, ch_lnd, ch_ice, &
77 & rb_wat, rb_lnd, rb_ice, &
78 & stress_wat,stress_lnd,stress_ice, &
79 & fm_wat, fm_lnd, fm_ice, &
80 & fh_wat, fh_lnd, fh_ice, &
81 & fm10_wat, fm10_lnd, fm10_ice, &
82 & fh2_wat, fh2_lnd, fh2_ice, &
83 & hflx_wat, hflx_lnd, hflx_ice, &
84 & qflx_wat, qflx_lnd, qflx_ice, &
85 & qsfc, qsfc_lnd_ruc, qsfc_ice_ruc, &
87 & rmol, wspd, ch, hflx, qflx, lh, &
89 & u10, v10, th2, t2, q2, &
90 & wstar, chs2, cqs2, &
91 & spp_wts_sfc, spp_sfc, &
92 & lprnt, errmsg, errflg )
96 use machine ,
only : kind_phys
97 use physcons,
only : cp => con_cp, &
115 real(kind_phys),
parameter :: g_inv=1./grav
117 character(len=*),
intent(out) :: errmsg
118 integer,
intent(out) :: errflg
121 INTEGER,
PARAMETER :: isfflx = 1
122 logical,
intent(in) :: sfclay_compute_flux,sfclay_compute_diag
123 integer,
intent(in) :: isftcflx,iz0tlnd
124 integer,
intent(in) :: im, levs
125 integer,
intent(in) :: iter, itimestep, lsm, lsm_ruc
126 logical,
dimension(:),
intent(in) :: flag_iter
127 logical,
intent(in) :: flag_init,flag_restart,lprnt
128 integer,
intent(in) :: ivegsrc
129 integer,
intent(in) :: sfc_z0_type
130 logical,
intent(in) :: redrag
131 integer,
intent(in) :: spp_sfc
133 real(kind_phys),
intent(in) :: delt
136 integer,
dimension(:),
intent(in) :: vegtype
137 real(kind_phys),
dimension(:),
intent(in) :: &
138 & sigmaf,shdmax,z0pert,ztpert
139 real(kind_phys),
dimension(:,:),
intent(in),
optional :: &
142 real(kind_phys),
dimension(:,:), &
144 real(kind_phys),
dimension(:,:), &
145 & intent(in) :: exner, PRSL, &
146 & u, v, t3d, qvsh, qc
148 logical,
dimension(:),
intent(in) :: wet, dry, icy
150 real(kind_phys),
dimension(:),
intent(in) :: &
151 & tskin_wat, tskin_lnd, tskin_ice, &
152 & tsurf_wat, tsurf_lnd, tsurf_ice, &
153 & snowh_lnd, snowh_ice
155 real(kind_phys),
dimension(:),
intent(inout) :: &
156 & znt_wat, znt_lnd, znt_ice, &
157 & ust_wat, ust_lnd, ust_ice, &
158 & cm_wat, cm_lnd, cm_ice, &
159 & ch_wat, ch_lnd, ch_ice, &
160 & rb_wat, rb_lnd, rb_ice, &
161 & stress_wat,stress_lnd,stress_ice, &
162 & fm_wat, fm_lnd, fm_ice, &
163 & fh_wat, fh_lnd, fh_ice, &
164 & fm10_wat, fm10_lnd, fm10_ice, &
165 & fh2_wat, fh2_lnd, fh2_ice, &
166 & hflx_wat, hflx_lnd, hflx_ice, &
167 & qflx_wat, qflx_lnd, qflx_ice, &
168 & qsfc_wat, qsfc_lnd, qsfc_ice
171 real(kind_phys),
dimension(:),
intent(in) :: &
172 & dx, pblh, slmsk, ps
173 real(kind_phys),
dimension(:),
intent(in),
optional :: &
174 & qsfc_lnd_ruc, qsfc_ice_ruc
176 real(kind_phys),
dimension(:),
intent(inout) :: &
177 & hflx, qflx, wspd, qsfc, &
178 & FLHC, FLQC, U10, V10, TH2, T2, Q2, &
180 real(kind_phys),
dimension(:),
intent(inout),
optional :: &
181 & ustm, zol, mol, lh, wstar, CHS2, CQS2
183 real(kind_phys),
dimension(im) :: &
184 & hfx, znt, psim, psih, &
185 & chs, ck, cd, mavail, xland, GZ1OZ0, &
186 & cpm, qgh, qfx, snowh_wat
188 real(kind_phys),
dimension(im,levs) :: &
193 INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, &
194 & IMS,IME,JMS,JME,KMS,KME, &
195 & ITS,ITE,JTS,JTE,KTS,KTE
232 dz(i,k)=(phii(i,k+1) - phii(i,k))*g_inv
233 th(i,k)=t3d(i,k)/exner(i,k)
235 qv(i,k)=qvsh(i,k)/(1.0 - qvsh(i,k))
241 if (slmsk(i)==1. .or. slmsk(i)==2.)
then
258 where (dry) znt_lnd=znt_lnd*0.01
259 where (wet) znt_wat=znt_wat*0.01
260 where (icy) znt_ice=znt_ice*0.01
264 where (dry) qsfc_lnd = qsfc_lnd_ruc/(1.+qsfc_lnd_ruc)
265 where (icy) qsfc_ice = qsfc_ice_ruc/(1.+qsfc_ice_ruc)
301 u3d=u,v3d=v,t3d=t3d,qv3d=qv,p3d=prsl,dz8w=dz, &
302 th3d=th,pi3d=exner,qc3d=qc, &
303 psfcpa=ps,pblh=pblh,mavail=mavail,xland=xland,dx=dx, &
305 iz0tlnd=iz0tlnd,psi_opt=psi_opt, &
306 compute_flux=sfclay_compute_flux,compute_diag=sfclay_compute_diag,&
307 sigmaf=sigmaf,vegtype=vegtype,shdmax=shdmax,ivegsrc=ivegsrc, &
308 z0pert=z0pert,ztpert=ztpert, &
309 redrag=redrag,sfc_z0_type=sfc_z0_type, &
310 itimestep=itimestep,iter=iter,flag_iter=flag_iter, &
311 flag_restart=flag_restart, &
312 wet=wet, dry=dry, icy=icy, &
313 tskin_wat=tskin_wat, tskin_lnd=tskin_lnd, tskin_ice=tskin_ice, &
314 tsurf_wat=tsurf_wat, tsurf_lnd=tsurf_lnd, tsurf_ice=tsurf_ice, &
315 qsfc_wat=qsfc_wat, qsfc_lnd=qsfc_lnd, qsfc_ice=qsfc_ice, &
316 snowh_wat=snowh_wat, snowh_lnd=snowh_lnd, snowh_ice=snowh_ice, &
317 znt_wat=znt_wat, znt_lnd=znt_lnd, znt_ice=znt_ice, &
318 ust_wat=ust_wat, ust_lnd=ust_lnd, ust_ice=ust_ice, &
319 cm_wat=cm_wat, cm_lnd=cm_lnd, cm_ice=cm_ice, &
320 ch_wat=ch_wat, ch_lnd=ch_lnd, ch_ice=ch_ice, &
321 rb_wat=rb_wat, rb_lnd=rb_lnd, rb_ice=rb_ice, &
322 stress_wat=stress_wat,stress_lnd=stress_lnd,stress_ice=stress_ice, &
323 fm_wat=fm_wat, fm_lnd=fm_lnd, fm_ice=fm_ice, &
324 fh_wat=fh_wat, fh_lnd=fh_lnd, fh_ice=fh_ice, &
325 fm10_wat=fm10_wat, fm10_lnd=fm10_lnd, fm10_ice=fm10_ice, &
326 fh2_wat=fh2_wat, fh2_lnd=fh2_lnd, fh2_ice=fh2_ice, &
327 hflx_wat=hflx_wat, hflx_lnd=hflx_lnd, hflx_ice=hflx_ice, &
328 qflx_wat=qflx_wat, qflx_lnd=qflx_lnd, qflx_ice=qflx_ice, &
329 ch=ch,chs=chs,chs2=chs2,cqs2=cqs2,cpm=cpm, &
330 znt=znt,ustm=ustm,zol=zol,mol=mol,rmol=rmol, &
331 psim=psim,psih=psih, &
332 hflx=hflx,hfx=hfx,qflx=qflx,qfx=qfx,lh=lh,flhc=flhc,flqc=flqc, &
334 u10=u10,v10=v10,th2=th2,t2=t2,q2=q2, &
335 gz1oz0=gz1oz0,wspd=wspd,wstar=wstar, &
336 spp_sfc=spp_sfc,pattern_spp_sfc=spp_wts_sfc, &
337 ids=1,ide=im, jds=1,jde=1, kds=1,kde=levs, &
338 ims=1,ime=im, jms=1,jme=1, kms=1,kme=levs, &
339 its=1,ite=im, jts=1,jte=1, kts=1,kte=levs, &
340 errmsg=errmsg, errflg=errflg )
341 if (errflg/=0)
return
370 where (dry) znt_lnd=znt_lnd*100.
371 where (wet) znt_wat=znt_wat*100.
372 where (icy) znt_ice=znt_ice*100.
subroutine sfclay_mynn(u3d, v3d, t3d, qv3d, p3d, dz8w, th3d, pi3d, qc3d, psfcpa, pblh, mavail, xland, dx, isfflx, isftcflx, lsm, lsm_ruc, compute_flux, compute_diag, iz0tlnd, psi_opt, sigmaf, vegtype, shdmax, ivegsrc, z0pert, ztpert, redrag, sfc_z0_type, itimestep, iter, flag_iter, flag_restart, wet, dry, icy, tskin_wat, tskin_lnd, tskin_ice, tsurf_wat, tsurf_lnd, tsurf_ice, qsfc_wat, qsfc_lnd, qsfc_ice, snowh_wat, snowh_lnd, snowh_ice, znt_wat, znt_lnd, znt_ice, ust_wat, ust_lnd, ust_ice, cm_wat, cm_lnd, cm_ice, ch_wat, ch_lnd, ch_ice, rb_wat, rb_lnd, rb_ice, stress_wat, stress_lnd, stress_ice, fm_wat, fm_lnd, fm_ice, fh_wat, fh_lnd, fh_ice, fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, hflx_wat, hflx_lnd, hflx_ice, qflx_wat, qflx_lnd, qflx_ice, ch, chs, chs2, cqs2, cpm, znt, ustm, zol, mol, rmol, psim, psih, hflx, hfx, qflx, qfx, lh, flhc, flqc, qgh, qsfc, u10, v10, th2, t2, q2, gz1oz0, wspd, wstar, spp_sfc, pattern_spp_sfc, ids, ide, jds, jde, kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts, kte, errmsg, errflg)
This subroutine.
subroutine mynnsfc_wrapper_run(im, levs, itimestep, iter, flag_iter, flag_init, flag_restart, lsm, lsm_ruc, sigmaf, vegtype, shdmax, ivegsrc, z0pert, ztpert, redrag, sfc_z0_type, isftcflx, iz0tlnd, sfclay_compute_flux, sfclay_compute_diag, delt, dx, u, v, t3d, qvsh, qc, prsl, phii, exner, ps, pblh, slmsk, wet, dry, icy, tskin_wat, tskin_lnd, tskin_ice, tsurf_wat, tsurf_lnd, tsurf_ice, qsfc_wat, qsfc_lnd, qsfc_ice, snowh_lnd, snowh_ice, znt_wat, znt_lnd, znt_ice, ust_wat, ust_lnd, ust_ice, cm_wat, cm_lnd, cm_ice, ch_wat, ch_lnd, ch_ice, rb_wat, rb_lnd, rb_ice, stress_wat, stress_lnd, stress_ice, fm_wat, fm_lnd, fm_ice, fh_wat, fh_lnd, fh_ice, fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, hflx_wat, hflx_lnd, hflx_ice, qflx_wat, qflx_lnd, qflx_ice, qsfc, qsfc_lnd_ruc, qsfc_ice_ruc, ustm, zol, mol, rmol, wspd, ch, hflx, qflx, lh, flhc, flqc, u10, v10, th2, t2, q2, wstar, chs2, cqs2, spp_wts_sfc, spp_sfc, lprnt, errmsg, errflg)