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