CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
noahmpdrv.F90
1#define CCPP
2
4
10
12 module noahmpdrv
13
14 use module_sf_noahmplsm
15
16 implicit none
17
18 integer, parameter :: psi_opt = 0 ! 0: MYNN or 1:GFS
19
20 private
21
23
24 contains
25
32 subroutine noahmpdrv_init(lsm, lsm_noahmp, me, isot, ivegsrc, &
33 nlunit, pores, resid, &
34 do_mynnsfclay,do_mynnedmf, &
35 errmsg, errflg)
36
37 use machine, only: kind_phys
41
42 implicit none
43 integer, intent(in) :: lsm
44 integer, intent(in) :: lsm_noahmp
45 integer, intent(in) :: me, isot, ivegsrc, nlunit
46
47 real (kind=kind_phys), dimension(:), intent(out) :: pores, resid
48
49 logical, intent(in) :: do_mynnsfclay
50 logical, intent(in) :: do_mynnedmf
51
52
53 character(len=*), intent(out) :: errmsg
54 integer, intent(out) :: errflg
55
56 ! Initialize CCPP error handling variables
57 errmsg = ''
58 errflg = 0
59
60 ! Consistency checks
61 if (lsm/=lsm_noahmp) then
62 write(errmsg,'(*(a))') 'Logic error: namelist choice of ', &
63 & 'LSM is different from Noah'
64 errflg = 1
65 return
66 end if
67
68 if (ivegsrc /= 1) then
69 errmsg = 'The NOAHMP LSM expects that the ivegsrc physics '// &
70 'namelist parameter is 1. Exiting...'
71 errflg = 1
72 return
73 end if
74 if (isot /= 1) then
75 errmsg = 'The NOAHMP LSM expects that the isot physics '// &
76 'namelist parameter is 1. Exiting...'
77 errflg = 1
78 return
79 end if
80
81 if ( do_mynnsfclay .and. .not. do_mynnedmf) then
82 errmsg = 'Problem : do_mynnsfclay = .true.' // &
83 'but mynnpbl is .false.. Exiting ...'
84 errflg = 1
85 return
86 end if
87
88
89 !--- initialize soil vegetation
90 call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg)
91
92 !--- read in noahmp table
93 call read_mp_table_parameters(errmsg, errflg)
94
95 ! initialize psih and psim
96
97 if ( do_mynnsfclay ) then
98 call psi_init(psi_opt,errmsg,errflg)
99 endif
100
101 pores(:) = maxsmc(:)
102 resid(:) = drysmc(:)
103
104 end subroutine noahmpdrv_init
105
127 subroutine noahmpdrv_run &
128!...................................
129! --- inputs:
130 ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, soiltyp,soilcol,&
131 vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, &
132 prsl1, prslk1, prslki, prsik1, zf,pblh, dry, wind, slopetyp,&
133 shdmin, shdmax, snoalb, sfalb, flag_iter,con_g, &
134 idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, &
135 iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot,iopt_stc,&
136 iopt_trs,iopt_diag,xlatin, xcoszin, iyrlen, julian, garea, &
137 rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, rhonewsn1,&
138 con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, &
139 con_fvirt, con_rd, con_hfus, thsfc_loc, cpllnd, cpllnd2atm,&
140
141! --- in/outs:
142 weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, &
143 canopy, trans, tsurf, zorl, &
144 rb1, fm1, fh1, ustar1, stress1, fm101, fh21, &
145 rmol1,flhc1,flqc1,do_mynnsfclay, &
146
147! --- Noah MP specific
148
149 snowxy, tvxy, tgxy, canicexy, canliqxy, eahxy, tahxy, cmxy,&
150 chxy, fwetxy, sneqvoxy, alboldxy, qsnowxy, wslakexy, zwtxy,&
151 waxy, wtxy, tsnoxy, zsnsoxy, snicexy, snliqxy, lfmassxy, &
152 rtmassxy, stmassxy, woodxy, stblcpxy, fastcpxy, xlaixy, &
153 xsaixy, taussxy, smoiseq, smcwtdxy, deeprechxy, rechxy, &
154 albdvis, albdnir, albivis, albinir,emiss, &
155
156! --- outputs:
157 sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, &
158 cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc,&
159 stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, &
160 ztmax, rca, errmsg, errflg, &
161 canopy_heat_storage_ccpp, &
162 rainfall_ccpp, &
163 sw_absorbed_total_ccpp, &
164 sw_reflected_total_ccpp, &
165 lw_absorbed_total_ccpp, &
166 temperature_bare_grd_ccpp, &
167 temperature_veg_grd_ccpp, &
168 temperature_veg_2m_ccpp, &
169 temperature_bare_2m_ccpp, &
170 spec_humidity_veg_2m_ccpp, &
171 spec_humidity_bare_2m_ccpp, &
172 sw_absorbed_veg_ccpp, &
173 sw_absorbed_ground_ccpp, &
174 snowmelt_out_ccpp, &
175 snowmelt_shallow_ccpp, &
176 albedo_direct_snow_ccpp, &
177 albedo_diffuse_snow_ccpp, &
178 ch_vegetated_ccpp, &
179 ch_bare_ground_ccpp, &
180 sensible_heat_grd_veg_ccpp, &
181 sensible_heat_leaf_ccpp, &
182 sensible_heat_grd_bar_ccpp, &
183 latent_heat_grd_veg_ccpp, &
184 latent_heat_grd_bare_ccpp, &
185 ground_heat_veg_ccpp, &
186 ground_heat_bare_ccpp, &
187 lw_absorbed_grd_veg_ccpp, &
188 lw_absorbed_leaf_ccpp, &
189 lw_absorbed_grd_bare_ccpp, &
190 latent_heat_trans_ccpp, &
191 latent_heat_leaf_ccpp, &
192 ch_leaf_ccpp, &
193 ch_below_canopy_ccpp, &
194 ch_vegetated_2m_ccpp, &
195 ch_bare_ground_2m_ccpp, &
196 precip_adv_heat_veg_ccpp, &
197 precip_adv_heat_grd_v_ccpp, &
198 precip_adv_heat_grd_b_ccpp, &
199 spec_humid_sfc_veg_ccpp, &
200 spec_humid_sfc_bare_ccpp &
201 )
202
203 use machine , only : kind_phys
204 use funcphys, only : fpvs
205
206 use module_sf_noahmplsm, only : gfs_stability
208 use noahmp_tables
209
210 implicit none
211
212 real(kind=kind_phys), parameter :: a2 = 17.2693882
213 real(kind=kind_phys), parameter :: a3 = 273.16
214 real(kind=kind_phys), parameter :: a4 = 35.86
215 real(kind=kind_phys), parameter :: a23m4 = a2*(a3-a4)
216 real(kind=kind_phys), intent(in) :: con_g
217
218 real, parameter :: undefined = 9.99e20_kind_phys
219
220 integer, parameter :: nsoil = 4 ! hardwired to Noah
221 integer, parameter :: nsnow = 3 ! max. snow layers
222
223 integer, parameter :: iz0tlnd = 0 ! z0t treatment option
224
225 real(kind=kind_phys), save :: zsoil(nsoil)
226 data zsoil / -0.1, -0.4, -1.0, -2.0 /
227
228!
229! --- CCPP interface fields (in call order)
230!
231
232 integer , intent(in) :: im ! horiz dimension and num of used pts
233 integer , intent(in) :: km ! vertical soil layer dimension
234 integer , intent(in) :: lsnowl ! lower bound for snow level arrays
235 integer , intent(in) :: itime ! NOT USED
236 real(kind=kind_phys), dimension(:) , intent(in) :: ps ! surface pressure [Pa]
237 real(kind=kind_phys), dimension(:) , intent(in) :: u1 ! u-component of wind [m/s]
238 real(kind=kind_phys), dimension(:) , intent(in) :: v1 ! u-component of wind [m/s]
239 real(kind=kind_phys), dimension(:) , intent(in) :: t1 ! layer 1 temperature [K]
240 real(kind=kind_phys), dimension(:) , intent(in) :: q1 ! layer 1 specific humidity [kg/kg]
241 integer , dimension(:) , intent(in) :: soiltyp ! soil type (integer index)
242 integer , dimension(:) , intent(in) :: soilcol ! soil color (integer index)
243 integer , dimension(:) , intent(in) :: vegtype ! vegetation type (integer index)
244 real(kind=kind_phys), dimension(:) , intent(in) :: sigmaf ! areal fractional cover of green vegetation
245 real(kind=kind_phys), dimension(:) , intent(in) :: dlwflx ! downward longwave radiation [W/m2]
246 real(kind=kind_phys), dimension(:) , intent(in) :: dswsfc ! downward shortwave radiation [W/m2]
247 real(kind=kind_phys), dimension(:) , intent(in) :: snet ! total sky sfc netsw flx into ground[W/m2]
248 real(kind=kind_phys) , intent(in) :: delt ! time interval [s]
249 real(kind=kind_phys), dimension(:) , intent(in) :: tg3 ! deep soil temperature [K]
250 real(kind=kind_phys), dimension(:) , intent(inout) :: cm ! surface exchange coeff for momentum [-]
251 real(kind=kind_phys), dimension(:) , intent(inout) :: ch ! surface exchange coeff heat & moisture[-]
252 real(kind=kind_phys), dimension(:) , intent(in) :: prsl1 ! sfc layer 1 mean pressure [Pa]
253 real(kind=kind_phys), dimension(:) , intent(in) :: prslk1 ! exner_function_at lowest model layer
254
255 real(kind=kind_phys), dimension(:) , intent(in) :: prslki ! Exner function bt midlayer and interface at 1st layer
256 real(kind=kind_phys), dimension(:) , intent(in) :: prsik1 ! Exner function at the ground surfac
257
258 real(kind=kind_phys), dimension(:) , intent(in) :: zf ! height of bottom layer [m]
259
260 logical , intent(in) :: do_mynnsfclay !flag for MYNN sfc layer scheme
261
262 real(kind=kind_phys), dimension(:) , intent(in) :: pblh ! height of pbl
263 real(kind=kind_phys), dimension(:) , intent(inout) :: rmol1 !
264 real(kind=kind_phys), dimension(:) , intent(inout) :: flhc1 !
265 real(kind=kind_phys), dimension(:) , intent(inout) :: flqc1 !
266
267
268 logical , dimension(:) , intent(in) :: dry ! = T if a point with any land
269 real(kind=kind_phys), dimension(:) , intent(in) :: wind ! wind speed [m/s]
270 integer , dimension(:) , intent(in) :: slopetyp ! surface slope classification
271 real(kind=kind_phys), dimension(:) , intent(in) :: shdmin ! min green vegetation coverage [fraction]
272 real(kind=kind_phys), dimension(:) , intent(in) :: shdmax ! max green vegetation coverage [fraction]
273 real(kind=kind_phys), dimension(:) , intent(in) :: snoalb ! upper bound on max albedo over deep snow
274 real(kind=kind_phys), dimension(:) , intent(inout) :: sfalb ! mean surface albedo [fraction]
275 logical , dimension(:) , intent(in) :: flag_iter !
276 integer , intent(in) :: idveg ! option for dynamic vegetation
277 integer , intent(in) :: iopt_crs ! option for canopy stomatal resistance
278 integer , intent(in) :: iopt_btr ! option for soil moisture factor for stomatal resistance
279 integer , intent(in) :: iopt_run ! option for runoff and groundwater
280 integer , intent(in) :: iopt_sfc ! option for surface layer drag coeff (ch & cm)
281 integer , intent(in) :: iopt_frz ! option for supercooled liquid water (or ice fraction)
282 integer , intent(in) :: iopt_inf ! option for frozen soil permeability
283 integer , intent(in) :: iopt_rad ! option for radiation transfer
284 integer , intent(in) :: iopt_alb ! option for ground snow surface albedo
285 integer , intent(in) :: iopt_snf ! option for partitioning precipitation into rainfall & snowfall
286 integer , intent(in) :: iopt_tbot ! option for lower boundary condition of soil temperature
287 integer , intent(in) :: iopt_stc ! option for snow/soil temperature time scheme (only layer 1)
288 integer , intent(in) :: iopt_trs ! option for thermal roughness scheme
289 integer , intent(in) :: iopt_diag ! option for surface diagnose approach
290 real(kind=kind_phys), dimension(:) , intent(in) :: xlatin ! latitude
291 real(kind=kind_phys), dimension(:) , intent(in) :: xcoszin ! cosine of zenith angle
292 integer , intent(in) :: iyrlen ! year length [days]
293 real(kind=kind_phys) , intent(in) :: julian ! julian day of year
294 real(kind=kind_phys), dimension(:) , intent(in) :: garea ! area of the grid cell
295 real(kind=kind_phys), dimension(:) , intent(in), optional :: rainn_mp ! microphysics non-convective precipitation [mm]
296 real(kind=kind_phys), dimension(:) , intent(in), optional :: rainc_mp ! microphysics convective precipitation [mm]
297 real(kind=kind_phys), dimension(:) , intent(in), optional :: snow_mp ! microphysics snow [mm]
298 real(kind=kind_phys), dimension(:) , intent(in), optional :: graupel_mp ! microphysics graupel [mm]
299 real(kind=kind_phys), dimension(:) , intent(in), optional :: ice_mp ! microphysics ice/hail [mm]
300 real(kind=kind_phys), dimension(:) , intent(in) :: rhonewsn1 ! precipitation ice density (kg/m^3)
301 real(kind=kind_phys) , intent(in) :: con_hvap ! latent heat condensation [J/kg]
302 real(kind=kind_phys) , intent(in) :: con_cp ! specific heat air [J/kg/K]
303 real(kind=kind_phys) , intent(in) :: con_jcal ! joules per calorie (not used)
304 real(kind=kind_phys) , intent(in) :: rhoh2o ! density of water [kg/m^3]
305 real(kind=kind_phys) , intent(in) :: con_eps ! Rd/Rv
306 real(kind=kind_phys) , intent(in) :: con_epsm1 ! Rd/Rv - 1
307 real(kind=kind_phys) , intent(in) :: con_fvirt ! Rv/Rd - 1
308 real(kind=kind_phys) , intent(in) :: con_rd ! gas constant air [J/kg/K]
309 real(kind=kind_phys) , intent(in) :: con_hfus ! lat heat H2O fusion [J/kg]
310
311 logical , intent(in) :: thsfc_loc ! Flag for reference pressure in theta calculation
312
313 logical , intent(in) :: cpllnd ! Flag for land coupling (atm->lnd)
314 logical , intent(in) :: cpllnd2atm ! Flag for land coupling (lnd->atm)
315
316 real(kind=kind_phys), dimension(:) , intent(inout) :: weasd ! water equivalent accumulated snow depth [mm]
317 real(kind=kind_phys), dimension(:) , intent(inout) :: snwdph ! snow depth [mm]
318 real(kind=kind_phys), dimension(:) , intent(inout) :: tskin ! ground surface skin temperature [K]
319 real(kind=kind_phys), dimension(:) , intent(inout) :: tprcp ! total precipitation [m]
320 real(kind=kind_phys), dimension(:) , intent(inout) :: srflag ! snow/rain flag for precipitation
321 real(kind=kind_phys), dimension(:,:) , intent(inout) :: smc ! total soil moisture content [m3/m3]
322 real(kind=kind_phys), dimension(:,:) , intent(inout) :: stc ! soil temp [K]
323 real(kind=kind_phys), dimension(:,:) , intent(inout) :: slc ! liquid soil moisture [m3/m3]
324 real(kind=kind_phys), dimension(:) , intent(inout) :: canopy ! canopy moisture content [mm]
325 real(kind=kind_phys), dimension(:) , intent(inout) :: trans ! total plant transpiration [m/s]
326 real(kind=kind_phys), dimension(:) , intent(inout) :: tsurf ! surface skin temperature [K]
327 real(kind=kind_phys), dimension(:) , intent(inout) :: zorl ! surface roughness [cm]
328
329 real(kind=kind_phys), dimension(:) , intent(inout) :: rb1 ! bulk richardson #
330 real(kind=kind_phys), dimension(:) , intent(inout) :: fm1 ! Monin_Obukhov_silarity_function for momentum
331 real(kind=kind_phys), dimension(:) , intent(inout) :: fh1 ! Monin_Obukhov_silarity_function for heat
332 real(kind=kind_phys), dimension(:) , intent(inout) :: ustar1 ! friction velocity m s-1
333 real(kind=kind_phys), dimension(:) , intent(inout) :: stress1 ! Wind stress m2 S-2
334 real(kind=kind_phys), dimension(:) , intent(inout) :: fm101 ! MOS function for momentum evaulated @ 10 m
335 real(kind=kind_phys), dimension(:) , intent(inout) :: fh21 ! MOS function for heat evaulated @ 2m
336
337 real(kind=kind_phys), dimension(:) , intent(inout), optional :: snowxy ! actual no. of snow layers
338 real(kind=kind_phys), dimension(:) , intent(inout), optional :: tvxy ! vegetation leaf temperature [K]
339 real(kind=kind_phys), dimension(:) , intent(inout), optional :: tgxy ! bulk ground surface temperature [K]
340 real(kind=kind_phys), dimension(:) , intent(inout), optional :: canicexy ! canopy-intercepted ice [mm]
341 real(kind=kind_phys), dimension(:) , intent(inout), optional :: canliqxy ! canopy-intercepted liquid water [mm]
342 real(kind=kind_phys), dimension(:) , intent(inout), optional :: eahxy ! canopy air vapor pressure [Pa]
343 real(kind=kind_phys), dimension(:) , intent(inout), optional :: tahxy ! canopy air temperature [K]
344 real(kind=kind_phys), dimension(:) , intent(inout), optional :: cmxy ! bulk momentum drag coefficient [m/s]
345 real(kind=kind_phys), dimension(:) , intent(inout), optional :: chxy ! bulk sensible heat exchange coefficient [m/s]
346 real(kind=kind_phys), dimension(:) , intent(inout), optional :: fwetxy ! wetted or snowed fraction of the canopy [-]
347 real(kind=kind_phys), dimension(:) , intent(inout), optional :: sneqvoxy ! snow mass at last time step[mm h2o]
348 real(kind=kind_phys), dimension(:) , intent(inout), optional :: alboldxy ! snow albedo at last time step [-]
349 real(kind=kind_phys), dimension(:) , intent(inout), optional :: qsnowxy ! snowfall on the ground [mm/s]
350 real(kind=kind_phys), dimension(:) , intent(inout), optional :: wslakexy ! lake water storage [mm]
351 real(kind=kind_phys), dimension(:) , intent(inout), optional :: zwtxy ! water table depth [m]
352 real(kind=kind_phys), dimension(:) , intent(inout), optional :: waxy ! water in the "aquifer" [mm]
353 real(kind=kind_phys), dimension(:) , intent(inout), optional :: wtxy ! groundwater storage [mm]
354 real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: tsnoxy ! snow temperature [K]
355 real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: zsnsoxy ! snow/soil layer depth [m]
356 real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: snicexy ! snow layer ice [mm]
357 real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: snliqxy ! snow layer liquid water [mm]
358 real(kind=kind_phys), dimension(:) , intent(inout), optional :: lfmassxy ! leaf mass [g/m2]
359 real(kind=kind_phys), dimension(:) , intent(inout), optional :: rtmassxy ! mass of fine roots [g/m2]
360 real(kind=kind_phys), dimension(:) , intent(inout), optional :: stmassxy ! stem mass [g/m2]
361 real(kind=kind_phys), dimension(:) , intent(inout), optional :: woodxy ! mass of wood (incl. woody roots) [g/m2]
362 real(kind=kind_phys), dimension(:) , intent(inout), optional :: stblcpxy ! stable carbon in deep soil [g/m2]
363 real(kind=kind_phys), dimension(:) , intent(inout), optional :: fastcpxy ! short-lived carbon, shallow soil [g/m2]
364 real(kind=kind_phys), dimension(:) , intent(inout), optional :: xlaixy ! leaf area index [m2/m2]
365 real(kind=kind_phys), dimension(:) , intent(inout), optional :: xsaixy ! stem area index [m2/m2]
366 real(kind=kind_phys), dimension(:) , intent(inout), optional :: taussxy ! snow age factor [-]
367 real(kind=kind_phys), dimension(:,:) , intent(inout), optional :: smoiseq ! eq volumetric soil moisture [m3/m3]
368 real(kind=kind_phys), dimension(:) , intent(inout), optional :: smcwtdxy ! soil moisture content in the layer to the water table when deep
369 real(kind=kind_phys), dimension(:) , intent(inout), optional :: deeprechxy ! recharge to the water table when deep
370 real(kind=kind_phys), dimension(:) , intent(inout), optional :: rechxy ! recharge to the water table
371 real(kind=kind_phys), dimension(:) , intent(out) :: albdvis ! albedo - direct visible [fraction]
372 real(kind=kind_phys), dimension(:) , intent(out) :: albdnir ! albedo - direct NIR [fraction]
373 real(kind=kind_phys), dimension(:) , intent(out) :: albivis ! albedo - diffuse visible [fraction]
374 real(kind=kind_phys), dimension(:) , intent(out) :: albinir ! albedo - diffuse NIR [fraction]
375 real(kind=kind_phys), dimension(:) , intent(out) :: emiss ! sfc lw emissivity [fraction]
376 real(kind=kind_phys), dimension(:) , intent(out) :: sncovr1 ! snow cover over land [fraction]
377 real(kind=kind_phys), dimension(:) , intent(out) :: qsurf ! specific humidity at sfc [kg/kg]
378 real(kind=kind_phys), dimension(:) , intent(out) :: gflux ! soil heat flux [W/m2]
379 real(kind=kind_phys), dimension(:) , intent(out) :: drain ! subsurface runoff [mm/s]
380 real(kind=kind_phys), dimension(:) , intent(out) :: evap ! total latent heat flux [W/m2]
381 real(kind=kind_phys), dimension(:) , intent(out) :: hflx ! sensible heat flux [W/m2]
382 real(kind=kind_phys), dimension(:) , intent(out) :: ep ! potential evaporation [mm/s?]
383 real(kind=kind_phys), dimension(:) , intent(out) :: runoff ! surface runoff [mm/s]
384 real(kind=kind_phys), dimension(:) , intent(out) :: cmm ! cm*U [m/s]
385 real(kind=kind_phys), dimension(:) , intent(out) :: chh ! ch*U*rho [kg/m2/s]
386 real(kind=kind_phys), dimension(:) , intent(out) :: evbs ! direct soil evaporation [m/s]
387 real(kind=kind_phys), dimension(:) , intent(out) :: evcw ! canopy water evaporation [m/s]
388 real(kind=kind_phys), dimension(:) , intent(out) :: sbsno ! sublimation/deposit from snopack [W/m2]
389 real(kind=kind_phys), dimension(:) , intent(out) :: pah ! precipitation advected heat - total (w/m2)
390 real(kind=kind_phys), dimension(:) , intent(out) :: ecan ! evaporation of intercepted water (mm/s)
391 real(kind=kind_phys), dimension(:) , intent(out) :: etran ! transpiration rate (mm/s)
392 real(kind=kind_phys), dimension(:) , intent(out) :: edir ! soil surface evaporation rate (mm/s)
393 real(kind=kind_phys), dimension(:) , intent(out) :: snowc ! fractional snow cover [-]
394 real(kind=kind_phys), dimension(:) , intent(out) :: stm ! total soil column moisture content [mm]
395 real(kind=kind_phys), dimension(:) , intent(out) :: snohf ! snow/freezing-rain latent heat flux [W/m2]
396 real(kind=kind_phys), dimension(:) , intent(out) :: smcwlt2 ! dry soil moisture threshold [m3/m3]
397 real(kind=kind_phys), dimension(:) , intent(out) :: smcref2 ! soil moisture threshold [m3/m3]
398 real(kind=kind_phys), dimension(:) , intent(out), optional :: wet1 ! normalized surface soil saturated fraction
399 real(kind=kind_phys), dimension(:) , intent(out), optional :: t2mmp ! combined T2m from tiles
400 real(kind=kind_phys), dimension(:) , intent(out), optional :: q2mp ! combined q2m from tiles
401 real(kind=kind_phys), dimension(:) , intent(out) :: zvfun !
402 real(kind=kind_phys), dimension(:) , intent(out) :: ztmax ! thermal roughness length
403 real(kind=kind_phys), dimension(:) , intent(out), optional :: rca ! total canopy/stomatal resistance (s/m)
404
405 character(len=*) , intent(out) :: errmsg
406 integer , intent(out) :: errflg
407
408 real(kind=kind_phys), dimension(:) , intent(out), optional :: canopy_heat_storage_ccpp ! within-canopy heat [W/m2]
409 real(kind=kind_phys), dimension(:) , intent(out), optional :: rainfall_ccpp
410 real(kind=kind_phys), dimension(:) , intent(out), optional :: sw_absorbed_total_ccpp
411 real(kind=kind_phys), dimension(:) , intent(out), optional :: sw_reflected_total_ccpp
412 real(kind=kind_phys), dimension(:) , intent(out), optional :: lw_absorbed_total_ccpp
413 real(kind=kind_phys), dimension(:) , intent(out), optional :: temperature_bare_grd_ccpp
414 real(kind=kind_phys), dimension(:) , intent(out), optional :: temperature_veg_grd_ccpp
415 real(kind=kind_phys), dimension(:) , intent(out), optional :: temperature_veg_2m_ccpp
416 real(kind=kind_phys), dimension(:) , intent(out), optional :: temperature_bare_2m_ccpp
417 real(kind=kind_phys), dimension(:) , intent(out), optional :: spec_humidity_veg_2m_ccpp
418 real(kind=kind_phys), dimension(:) , intent(out), optional :: spec_humidity_bare_2m_ccpp
419 real(kind=kind_phys), dimension(:) , intent(out), optional :: sw_absorbed_veg_ccpp
420 real(kind=kind_phys), dimension(:) , intent(out), optional :: sw_absorbed_ground_ccpp
421 real(kind=kind_phys), dimension(:) , intent(out), optional :: snowmelt_out_ccpp
422 real(kind=kind_phys), dimension(:) , intent(out), optional :: snowmelt_shallow_ccpp
423 real(kind=kind_phys), dimension(:,:), intent(out), optional :: albedo_direct_snow_ccpp
424 real(kind=kind_phys), dimension(:,:), intent(out), optional :: albedo_diffuse_snow_ccpp
425 real(kind=kind_phys), dimension(:) , intent(out), optional :: ch_vegetated_ccpp
426 real(kind=kind_phys), dimension(:) , intent(out), optional :: ch_bare_ground_ccpp
427 real(kind=kind_phys), dimension(:) , intent(out), optional :: sensible_heat_grd_veg_ccpp
428 real(kind=kind_phys), dimension(:) , intent(out), optional :: sensible_heat_leaf_ccpp
429 real(kind=kind_phys), dimension(:) , intent(out), optional :: sensible_heat_grd_bar_ccpp
430 real(kind=kind_phys), dimension(:) , intent(out), optional :: latent_heat_grd_veg_ccpp
431 real(kind=kind_phys), dimension(:) , intent(out), optional :: latent_heat_grd_bare_ccpp
432 real(kind=kind_phys), dimension(:) , intent(out), optional :: ground_heat_veg_ccpp
433 real(kind=kind_phys), dimension(:) , intent(out), optional :: ground_heat_bare_ccpp
434 real(kind=kind_phys), dimension(:) , intent(out), optional :: lw_absorbed_grd_veg_ccpp
435 real(kind=kind_phys), dimension(:) , intent(out), optional :: lw_absorbed_leaf_ccpp
436 real(kind=kind_phys), dimension(:) , intent(out), optional :: lw_absorbed_grd_bare_ccpp
437 real(kind=kind_phys), dimension(:) , intent(out), optional :: latent_heat_trans_ccpp
438 real(kind=kind_phys), dimension(:) , intent(out), optional :: latent_heat_leaf_ccpp
439 real(kind=kind_phys), dimension(:) , intent(out), optional :: ch_leaf_ccpp
440 real(kind=kind_phys), dimension(:) , intent(out), optional :: ch_below_canopy_ccpp
441 real(kind=kind_phys), dimension(:) , intent(out), optional :: ch_vegetated_2m_ccpp
442 real(kind=kind_phys), dimension(:) , intent(out), optional :: ch_bare_ground_2m_ccpp
443 real(kind=kind_phys), dimension(:) , intent(out), optional :: precip_adv_heat_veg_ccpp
444 real(kind=kind_phys), dimension(:) , intent(out), optional :: precip_adv_heat_grd_v_ccpp
445 real(kind=kind_phys), dimension(:) , intent(out), optional :: precip_adv_heat_grd_b_ccpp
446 real(kind=kind_phys), dimension(:) , intent(out), optional :: spec_humid_sfc_veg_ccpp
447 real(kind=kind_phys), dimension(:) , intent(out), optional :: spec_humid_sfc_bare_ccpp
448
449!
450! --- some new options, hard code for now
451!
452
453 integer :: iopt_rsf = 4 ! option for surface resistance
454 integer :: iopt_soil = 1 ! option for soil parameter treatment
455 integer :: iopt_pedo = 1 ! option for pedotransfer function
456 integer :: iopt_crop = 0 ! option for crop model
457 integer :: iopt_gla = 2 ! option for glacier treatment
458 integer :: iopt_z0m = 1 ! option for z0m treatment
459
460!
461! --- local inputs to noah-mp and glacier subroutines; listed in order in noah-mp call
462!
463 ! intent
464 integer :: i_location ! in | grid index
465 integer :: j_location ! in | grid index (not used in ccpp)
466 real (kind=kind_phys) :: latitude ! in | latitude [radians]
467 integer :: year_length ! in | number of days in the current year
468 real (kind=kind_phys) :: julian_day ! in | julian day of year [floating point]
469 real (kind=kind_phys) :: cosine_zenith ! in | cosine solar zenith angle [-1,1]
470 real (kind=kind_phys) :: timestep ! in | time step [sec]
471 real (kind=kind_phys) :: spatial_scale ! in | spatial scale [m] (not used in noah-mp)
472 real (kind=kind_phys) :: atmosphere_thickness ! in | thickness of lowest atmo layer [m] (not used in noah-mp)
473 integer :: soil_levels ! in | soil levels
474 real (kind=kind_phys), dimension( 1:nsoil) :: soil_interface_depth ! in | soil layer-bottom depth from surface [m]
475 integer :: max_snow_levels ! in | maximum number of snow levels
476 real (kind=kind_phys) :: vegetation_frac ! in | vegetation fraction [0.0-1.0]
477 real (kind=kind_phys) :: area_grid ! in |
478 real (kind=kind_phys) :: max_vegetation_frac ! in | annual maximum vegetation fraction [0.0-1.0]
479 integer :: vegetation_category ! in | vegetation category
480 integer :: ice_flag ! in | ice flag (1->ice)
481 integer :: surface_type ! in | surface type flag 1->soil; 2->lake
482 integer :: crop_type ! in | crop type category
483 real (kind=kind_phys), dimension( 1:nsoil) :: eq_soil_water_vol ! in | (opt_run=5) equilibrium soil water content [m3/m3]
484 real (kind=kind_phys) :: temperature_forcing ! in | forcing air temperature [K]
485 real (kind=kind_phys) :: air_pressure_surface ! in | surface air pressure [Pa]
486 real (kind=kind_phys) :: air_pressure_forcing ! in | forcing air pressure [Pa]
487 real (kind=kind_phys) :: uwind_forcing ! in | forcing u-wind [m/s]
488 real (kind=kind_phys) :: vwind_forcing ! in | forcing v-wind [m/s]
489 real (kind=kind_phys) :: spec_humidity_forcing ! in | forcing mixing ratio [kg/kg]
490 real (kind=kind_phys) :: cloud_water_forcing ! in | cloud water mixing ratio [kg/kg] (not used in noah-mp)
491 real (kind=kind_phys) :: sw_radiation_forcing ! in | forcing downward shortwave radiation [W/m2]
492 real (kind=kind_phys) :: radiation_lw_forcing ! in | forcing downward longwave radiation [W/m2]
493 real (kind=kind_phys) :: precipitation_forcing ! in | total precipitation [mm/s]
494 real (kind=kind_phys) :: precip_convective ! in | convective precipitation [mm/s]
495 real (kind=kind_phys) :: precip_non_convective ! in | non-convective precipitation [mm/s]
496 real (kind=kind_phys) :: precip_sh_convective ! in | shallow convective precipitation [mm/s]
497 real (kind=kind_phys) :: precip_snow ! in | snow precipitation [mm/s]
498 real (kind=kind_phys) :: precip_graupel ! in | graupel precipitation [mm/s]
499 real (kind=kind_phys) :: precip_hail ! in | hail precipitation [mm/s]
500 real (kind=kind_phys) :: temperature_soil_bot ! in | soil bottom boundary condition temperature [K]
501 real (kind=kind_phys) :: co2_air ! in | atmospheric co2 concentration [Pa]
502 real (kind=kind_phys) :: o2_air ! in | atmospheric o2 concentration [Pa]
503 real (kind=kind_phys) :: foliage_nitrogen ! in | foliage nitrogen [%] [1-saturated]
504 real (kind=kind_phys), dimension(-nsnow+1: 0) :: snow_ice_frac_old ! in | snow ice fraction at last timestep [-]
505 real (kind=kind_phys) :: forcing_height ! inout | forcing height [m]
506 real (kind=kind_phys) :: snow_albedo_old ! inout | snow albedo at last time step (class option) [-]
507 real (kind=kind_phys) :: snow_water_equiv_old ! inout | snow water equivalent at last time step [mm]
508 real (kind=kind_phys), dimension(-nsnow+1:nsoil) :: temperature_snow_soil ! inout | snow/soil temperature [K]
509 real (kind=kind_phys), dimension( 1:nsoil) :: soil_liquid_vol ! inout | volumetric liquid soil moisture [m3/m3]
510 real (kind=kind_phys), dimension( 1:nsoil) :: soil_moisture_vol ! inout | volumetric soil moisture (ice + liq.) [m3/m3]
511
512 real (kind=kind_phys) :: surface_temperature ! out | surface aerodynamic temp
513
514 real (kind=kind_phys) :: temperature_canopy_air! inout | canopy air tmeperature [K]
515 real (kind=kind_phys) :: vapor_pres_canopy_air ! inout | canopy air vapor pressure [Pa]
516 real (kind=kind_phys) :: canopy_wet_fraction ! inout | wetted or snowed fraction of canopy (-)
517 real (kind=kind_phys) :: canopy_liquid ! inout | canopy intercepted liquid [mm]
518 real (kind=kind_phys) :: canopy_ice ! inout | canopy intercepted ice [mm]
519 real (kind=kind_phys) :: temperature_leaf ! inout | leaf temperature [K]
520 real (kind=kind_phys) :: temperature_ground ! inout | grid ground surface temperature [K]
521 real (kind=kind_phys) :: spec_humidity_surface ! inout | surface specific humidty [kg/kg]
522 real (kind=kind_phys) :: snowfall ! inout | land model partitioned snowfall [mm/s]
523 real (kind=kind_phys) :: rainfall ! inout | land model partitioned rainfall [mm/s]
524 integer :: snow_levels ! inout | active snow levels [-]
525 real (kind=kind_phys), dimension(-nsnow+1:nsoil) :: interface_depth ! inout | layer-bottom depth from snow surf [m]
526 real (kind=kind_phys) :: snow_depth ! inout | snow depth [m]
527 real (kind=kind_phys) :: snow_water_equiv ! inout | snow water equivalent [mm]
528 real (kind=kind_phys), dimension(-nsnow+1: 0) :: snow_level_ice ! inout | snow level ice [mm]
529 real (kind=kind_phys), dimension(-nsnow+1: 0) :: snow_level_liquid ! inout | snow level liquid [mm]
530 real (kind=kind_phys) :: depth_water_table ! inout | depth to water table [m]
531 real (kind=kind_phys) :: aquifer_water ! inout | water storage in aquifer [mm]
532 real (kind=kind_phys) :: saturated_water ! inout | water in aquifer+saturated soil [mm]
533 real (kind=kind_phys) :: lake_water ! inout | lake water storage (can be neg.) [mm]
534 real (kind=kind_phys) :: leaf_carbon ! inout | leaf mass [g/m2]
535 real (kind=kind_phys) :: root_carbon ! inout | mass of fine roots [g/m2]
536 real (kind=kind_phys) :: stem_carbon ! inout | stem mass [g/m2]
537 real (kind=kind_phys) :: wood_carbon ! inout | mass of wood (incl. woody roots) [g/m2]
538 real (kind=kind_phys) :: soil_carbon_stable ! inout | stable soil carbon [g/m2]
539 real (kind=kind_phys) :: soil_carbon_fast ! inout | short-lived soil carbon [g/m2]
540 real (kind=kind_phys) :: leaf_area_index ! inout | leaf area index [-]
541 real (kind=kind_phys) :: stem_area_index ! inout | stem area index [-]
542 real (kind=kind_phys) :: cm_noahmp ! inout | grid momentum drag coefficient [m/s]
543 real (kind=kind_phys) :: ch_noahmp ! inout | grid heat exchange coefficient [m/s]
544 real (kind=kind_phys) :: snow_age ! inout | non-dimensional snow age [-]
545 real (kind=kind_phys) :: grain_carbon ! inout | grain mass [g/m2]
546 real (kind=kind_phys) :: growing_deg_days ! inout | growing degree days [-]
547 integer :: plant_growth_stage ! inout | plant growing stage [-]
548 real (kind=kind_phys) :: soil_moisture_wtd ! inout | (opt_run=5) soil water content between bottom of the soil and water table [m3/m3]
549 real (kind=kind_phys) :: deep_recharge ! inout | (opt_run=5) recharge to or from the water table when deep [m]
550 real (kind=kind_phys) :: recharge ! inout | (opt_run=5) recharge to or from the water table when shallow [m] (diagnostic)
551 real (kind=kind_phys) :: z0_total ! out | weighted z0 sent to coupled model [m]
552 real (kind=kind_phys) :: z0h_total ! out | weighted z0h sent to coupled model [m]
553
554 real (kind=kind_phys) :: sw_absorbed_total ! out | total absorbed solar radiation [W/m2]
555 real (kind=kind_phys) :: sw_reflected_total ! out | total reflected solar radiation [W/m2]
556 real (kind=kind_phys) :: lw_absorbed_total ! out | total net lw rad [W/m2] [+ to atm]
557 real (kind=kind_phys) :: sensible_heat_total ! out | total sensible heat [W/m2] [+ to atm]
558 real (kind=kind_phys) :: ground_heat_total ! out | ground heat flux [W/m2] [+ to soil]
559 real (kind=kind_phys) :: latent_heat_canopy ! out | canopy evaporation heat flux [W/m2] [+ to atm]
560 real (kind=kind_phys) :: latent_heat_ground ! out | ground evaporation heat flux [W/m2] [+ to atm]
561 real (kind=kind_phys) :: transpiration_heat ! out | transpiration heat flux [W/m2] [+ to atm]
562 real (kind=kind_phys) :: evaporation_canopy ! out | canopy evaporation [mm/s]
563 real (kind=kind_phys) :: transpiration ! out | transpiration [mm/s]
564 real (kind=kind_phys) :: evaporation_soil ! out | soil surface evaporation [mm/s]
565 real (kind=kind_phys) :: temperature_radiative ! out | surface radiative temperature [K]
566 real (kind=kind_phys) :: temperature_bare_grd ! out | bare ground surface temperature [K]
567 real (kind=kind_phys) :: temperature_veg_grd ! out | below_canopy ground surface temperature [K]
568 real (kind=kind_phys) :: temperature_veg_2m ! out | vegetated 2-m air temperature [K]
569 real (kind=kind_phys) :: temperature_bare_2m ! out | bare ground 2-m air temperature [K]
570 real (kind=kind_phys) :: spec_humidity_veg_2m ! out | vegetated 2-m air specific humidity [K]
571 real (kind=kind_phys) :: spec_humidity_bare_2m ! out | bare ground 2-m air specfic humidity [K]
572 real (kind=kind_phys) :: runoff_surface ! out | surface runoff [mm/s]
573 real (kind=kind_phys) :: runoff_baseflow ! out | baseflow runoff [mm/s]
574 real (kind=kind_phys) :: par_absorbed ! out | absorbed photosynthesis active radiation [W/m2]
575 real (kind=kind_phys) :: photosynthesis ! out | total photosynthesis [umol CO2/m2/s] [+ out]
576 real (kind=kind_phys) :: sw_absorbed_veg ! out | solar radiation absorbed by vegetation [W/m2]
577 real (kind=kind_phys) :: sw_absorbed_ground ! out | solar radiation absorbed by ground [W/m2]
578 real (kind=kind_phys) :: snow_cover_fraction ! out | snow cover fraction on the ground [-]
579 real (kind=kind_phys) :: net_eco_exchange ! out | net ecosystem exchange [g/m2/s CO2]
580 real (kind=kind_phys) :: global_prim_prod ! out | global primary production [g/m2/s C]
581 real (kind=kind_phys) :: net_prim_prod ! out | net primary productivity [g/m2/s C]
582 real (kind=kind_phys) :: vegetation_fraction ! out | vegetation fraction [0.0-1.0]
583 real (kind=kind_phys) :: albedo_total ! out | total surface albedo [-]
584 real (kind=kind_phys) :: snowmelt_out ! out | snowmelt out bottom of pack [mm/s]
585 real (kind=kind_phys) :: snowmelt_shallow ! out | shallow snow melt [mm]
586 real (kind=kind_phys) :: snowmelt_shallow_1 ! out | additional shallow snow melt [mm]
587 real (kind=kind_phys) :: snowmelt_shallow_2 ! out | additional shallow snow melt [mm]
588 real (kind=kind_phys) :: rs_sunlit ! out | sunlit leaf stomatal resistance [s/m]
589 real (kind=kind_phys) :: rs_shaded ! out | shaded leaf stomatal resistance [s/m]
590 real (kind=kind_phys), dimension(1:2) :: albedo_direct ! out | direct vis/nir albedo [-]
591 real (kind=kind_phys), dimension(1:2) :: albedo_diffuse ! out | diffuse vis/nir albedo [-]
592 real (kind=kind_phys), dimension(1:2) :: albedo_direct_snow ! out | direct vis/nir snow albedo [-]
593 real (kind=kind_phys), dimension(1:2) :: albedo_diffuse_snow ! out | diffuse vis/nir snow albedo [-]
594 real (kind=kind_phys) :: canopy_gap_fraction ! out | between canopy gap fraction [-]
595 real (kind=kind_phys) :: incanopy_gap_fraction ! out | within canopy gap fraction for beam [-]
596 real (kind=kind_phys) :: ch_vegetated ! out | vegetated heat exchange coefficient [m/s]
597 real (kind=kind_phys) :: ch_bare_ground ! out | bare-ground heat exchange coefficient [m/s]
598 real (kind=kind_phys) :: emissivity_total ! out | grid emissivity [-]
599 real (kind=kind_phys) :: sensible_heat_grd_veg ! out | below-canopy ground sensible heat flux [W/m2]
600 real (kind=kind_phys) :: sensible_heat_leaf ! out | leaf-to-canopy sensible heat flux [W/m2]
601 real (kind=kind_phys) :: sensible_heat_grd_bar ! out | bare ground sensible heat flux [W/m2]
602 real (kind=kind_phys) :: latent_heat_grd_veg ! out | below-canopy ground evaporation heat flux [W/m2]
603 real (kind=kind_phys) :: latent_heat_grd_bare ! out | bare ground evaporation heat flux [W/m2]
604 real (kind=kind_phys) :: ground_heat_veg ! out | below-canopy ground heat flux [W/m2]
605 real (kind=kind_phys) :: ground_heat_bare ! out | bare ground heat flux [W/m2]
606 real (kind=kind_phys) :: lw_absorbed_grd_veg ! out | below-canopy ground absorbed longwave radiation [W/m2]
607 real (kind=kind_phys) :: lw_absorbed_leaf ! out | leaf absorbed longwave radiation [W/m2]
608 real (kind=kind_phys) :: lw_absorbed_grd_bare ! out | bare ground net longwave radiation [W/m2]
609 real (kind=kind_phys) :: latent_heat_trans ! out | transpiration [W/m2]
610 real (kind=kind_phys) :: latent_heat_leaf ! out | leaf evaporation [W/m2]
611 real (kind=kind_phys) :: ch_leaf ! out | leaf exchange coefficient [m/s]
612 real (kind=kind_phys) :: ch_below_canopy ! out | below-canopy exchange coefficient [m/s]
613 real (kind=kind_phys) :: ch_vegetated_2m ! out | 2-m vegetated heat exchange coefficient [m/s]
614 real (kind=kind_phys) :: ch_bare_ground_2m ! out | 2-m bare-ground heat exchange coefficient [m/s]
615 real (kind=kind_phys) :: precip_frozen_frac ! out | precipitation snow fraction [-]
616 real (kind=kind_phys) :: precip_adv_heat_veg ! out | precipitation advected heat - vegetation net [W/m2]
617 real (kind=kind_phys) :: precip_adv_heat_grd_v ! out | precipitation advected heat - below-canopy net [W/m2]
618 real (kind=kind_phys) :: precip_adv_heat_grd_b ! out | precipitation advected heat - bare ground net [W/m2]
619 real (kind=kind_phys) :: precip_adv_heat_total ! out | precipitation advected heat - total [W/m2)
620 real (kind=kind_phys) :: snow_sublimation ! out | snow sublimation [W/m2]
621 real (kind=kind_phys) :: lai_sunlit ! out | sunlit leaf area index [m2/m2]
622 real (kind=kind_phys) :: lai_shaded ! out | shaded leaf area index [m2/m2]
623 real (kind=kind_phys) :: leaf_air_resistance ! out | leaf boundary layer resistance [s/m]
624
625 real (kind=kind_phys) :: canopy_heat_storage ! out | within-canopy heat [W/m2]
626 real (kind=kind_phys) :: spec_humid_sfc_veg ! out | surface specific humidty over vegetation [kg/kg]
627 real (kind=kind_phys) :: spec_humid_sfc_bare ! out | surface specific humidty over bare soil [kg/kg]
628
629 real (kind=kind_phys) :: ustarx ! inout |surface friction velocity
630 real (kind=kind_phys) :: prslkix ! in exner function
631 real (kind=kind_phys) :: prsik1x ! in exner function
632 real (kind=kind_phys) :: prslk1x ! in exner function
633
634 real (kind=kind_phys) :: ch2
635 real (kind=kind_phys) :: cq2
636 real (kind=kind_phys) :: qfx
637 real (kind=kind_phys) :: wspd1 ! wind speed with all components
638 real (kind=kind_phys) :: pblhx ! height of pbl
639 integer :: mnice
640
641 real (kind=kind_phys) :: rah_total !
642 real (kind=kind_phys) :: cah_total !
643
644
645!
646! --- local variable
647!
648
649 integer :: soil_category(nsoil)
650 integer :: slope_category
651 integer :: soil_color_category
652 character(len=256) :: dataset_identifier
653
654 real (kind=kind_phys) :: spec_humidity_sat ! saturation specific humidity
655 real (kind=kind_phys) :: vapor_pressure_sat ! saturation vapor pressure
656 real (kind=kind_phys) :: latent_heat_total ! total latent heat flux [W/m2]
657 real (kind=kind_phys) :: density ! air density
658 real (kind=kind_phys) :: virtual_temperature ! used for penman calculation and density
659 real (kind=kind_phys) :: potential_evaporation ! used for penman calculation
660 real (kind=kind_phys) :: potential_temperature ! used for penman calculation
661 real (kind=kind_phys) :: penman_radiation ! used for penman calculation
662 real (kind=kind_phys) :: dqsdt ! used for penman calculation
663 real (kind=kind_phys) :: precip_freeze_frac_in ! used for penman calculation
664
665 real (kind=kind_phys) :: virtfac1 ! virtual factor
666 real (kind=kind_phys) :: tvs1 ! surface virtual temp
667 real (kind=kind_phys) :: vptemp ! virtual potential temp
668
669 real(kind=kind_phys) :: tem1,tem2,gdx
670 real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0
671
672 logical :: is_snowing ! used for penman calculation
673 logical :: is_freeze_rain ! used for penman calculation
674 integer :: i, k
675
676!
677! --- local derived constants:
678!
679
680 type(noahmp_parameters) :: parameters
681
682!
683! --- end declaration
684!
685
686!
687! --- Initialize CCPP error handling variables
688!
689 errmsg = ''
690 errflg = 0
691
692!
693! --- Just return if external land component is activated for two-way interaction
694!
695 if (cpllnd .and. cpllnd2atm) return
696
697 do i = 1, im
698
699 if (flag_iter(i) .and. dry(i)) then
700
701!
702! --- variable checks and derived fields
703!
704
705 if(vegtype(i) == isice_table ) then
706 if(weasd(i) < 0.1) then
707 weasd(i) = 0.1
708 end if
709 end if
710
711!
712! --- noah-mp input variables (except snow_ice_frac_old done later)
713!
714
715 dataset_identifier = "modified_igbp_modis_noah"
716
717 i_location = i
718 j_location = -9999
719 latitude = xlatin(i)
720 year_length = iyrlen
721 julian_day = julian
722 cosine_zenith = xcoszin(i)
723 timestep = delt
724 spatial_scale = -9999.0
725 atmosphere_thickness = -9999.0
726 soil_levels = km
727 soil_interface_depth = zsoil
728 max_snow_levels = nsnow
729 vegetation_frac = sigmaf(i)
730 max_vegetation_frac = shdmax(i)
731 vegetation_category = vegtype(i)
732 surface_type = 1
733 crop_type = 0
734 eq_soil_water_vol = smoiseq(i,:) ! only need for run=5
735 temperature_forcing = t1(i)
736 air_pressure_surface = ps(i)
737 air_pressure_forcing = prsl1(i)
738 uwind_forcing = u1(i)
739 vwind_forcing = v1(i)
740 area_grid = garea(i)
741
742 pblhx = pblh(i)
743
744 prslkix = prslki(i)
745 prsik1x = prsik1(i)
746 prslk1x = prslk1(i)
747
748 spec_humidity_forcing = max(q1(i), 1.e-8) ! specific humidity at level 1 (kg/kg)
749 virtual_temperature = temperature_forcing * &
750 (1.0 + con_fvirt * spec_humidity_forcing) ! virtual temperature
751 vapor_pressure_sat = fpvs( temperature_forcing ) ! sat. vapor pressure at level 1 (Pa)
752 spec_humidity_sat = con_eps*vapor_pressure_sat / &
753 (prsl1(i) + con_epsm1*vapor_pressure_sat) ! sat. specific humidity at level 1 (kg/kg)
754 spec_humidity_sat = max(spec_humidity_sat, 1.e-8) ! lower limit sat. specific humidity (kg/kg)
755 spec_humidity_forcing = min(spec_humidity_sat,spec_humidity_forcing) ! limit specific humidity at level 1 (kg/kg)
756
757 cloud_water_forcing = -9999.0
758 sw_radiation_forcing = dswsfc(i)
759 radiation_lw_forcing = dlwflx(i)
760 precipitation_forcing = 1000.0 * tprcp(i) / delt
761 precip_convective = rainc_mp(i)
762 precip_non_convective = rainn_mp(i)
763 precip_sh_convective = 0.
764 precip_snow = snow_mp(i)
765 precip_graupel = graupel_mp(i)
766 precip_hail = ice_mp(i)
767 temperature_soil_bot = tg3(i)
768 co2_air = co2_table * air_pressure_forcing
769 o2_air = o2_table * air_pressure_forcing
770 foliage_nitrogen = 1.0
771
772!
773! --- noah-mp inout variables
774!
775
776 forcing_height = zf(i)
777 snow_albedo_old = alboldxy(i)
778 snow_water_equiv_old = sneqvoxy(i)
779 temperature_snow_soil(-2: 0) = tsnoxy(i,:)
780 temperature_snow_soil( 1:km) = stc(i,:)
781 soil_liquid_vol = slc(i,:)
782 soil_moisture_vol = smc(i,:)
783 temperature_canopy_air = tahxy(i)
784 vapor_pres_canopy_air = eahxy(i)
785 canopy_wet_fraction = fwetxy(i)
786 canopy_liquid = canliqxy(i)
787 canopy_ice = canicexy(i)
788 temperature_leaf = tvxy(i)
789 temperature_ground = tgxy(i)
790 spec_humidity_surface = undefined ! doesn't need inout; should be out
791 snowfall = qsnowxy(i) ! doesn't need inout; should be out
792 rainfall = -9999.0 ! doesn't need inout; should be out
793 snow_levels = nint(snowxy(i))
794 interface_depth = zsnsoxy(i,:)
795 snow_depth = snwdph(i) * 0.001 ! convert from mm to m
796 snow_water_equiv = weasd(i)
797 if (snow_water_equiv /= 0.0 .and. snow_depth == 0.0) then
798 snow_depth = 10.0 * snow_water_equiv /1000.0
799 endif
800 snow_level_ice = snicexy(i,:)
801 snow_level_liquid = snliqxy(i,:)
802 depth_water_table = zwtxy(i)
803 aquifer_water = waxy(i)
804 saturated_water = wtxy(i)
805 lake_water = wslakexy(i)
806 leaf_carbon = lfmassxy(i)
807 root_carbon = rtmassxy(i)
808 stem_carbon = stmassxy(i)
809 wood_carbon = woodxy(i)
810 soil_carbon_stable = stblcpxy(i)
811 soil_carbon_fast = fastcpxy(i)
812 leaf_area_index = xlaixy(i)
813 stem_area_index = xsaixy(i)
814 cm_noahmp = cmxy(i)
815 ch_noahmp = chxy(i)
816 snow_age = taussxy(i)
817! grain_carbon ! new variable
818! growing_deg_days ! new variable
819! plant_growth_stage ! new variable
820 soil_moisture_wtd = smcwtdxy(i)
821 deep_recharge = deeprechxy(i)
822 recharge = rechxy(i)
823
824 ustarx = ustar1(i)
825
826 snow_ice_frac_old = 0.0
827 do k = snow_levels+1, 0
828 if(snow_level_ice(k) > 0.0 ) &
829 snow_ice_frac_old(k) = snow_level_ice(k) /(snow_level_ice(k)+snow_level_liquid(k))
830 end do
831
832
833 if (snow_depth .gt. 0.1 .or. vegetation_category == isice_table ) then
834 mnice = 1
835 else
836 mnice = 0
837 endif
838
839!
840! --- some outputs for atm model?
841!
842 density = air_pressure_forcing / (con_rd * virtual_temperature)
843 chh(i) = ch(i) * wind(i) * density
844 cmm(i) = cm(i) * wind(i)
845!
846! --- noah-mp additional variables
847!
848
849 soil_category = soiltyp(i)
850 slope_category = slopetyp(i)
851 soil_color_category = soilcol(i)
852! soil_color_category = 4
853
854
855 call transfer_mp_parameters(vegetation_category, soil_category, &
856 slope_category, soil_color_category, crop_type,parameters)
857 parameters%prcpiceden = rhonewsn1(i)
858 call noahmp_options(idveg ,iopt_crs, iopt_btr , iopt_run, iopt_sfc, &
859 iopt_frz, iopt_inf , iopt_rad, iopt_alb, &
860 iopt_snf, iopt_tbot, iopt_stc, iopt_rsf, &
861 iopt_soil,iopt_pedo, iopt_crop,iopt_trs, &
862 iopt_diag,iopt_z0m)
863
864 if ( vegetation_category == isice_table ) then
865
866 if (precipitation_forcing > 0.0) then
867 if (srflag(i) > 0.0) then
868 snowfall = srflag(i) * precipitation_forcing ! need snowfall for glacier snow age
869 endif
870 endif
871
872 ice_flag = -1
873 temperature_soil_bot = min(temperature_soil_bot,263.15)
874
875 call noahmp_options_glacier(iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_gla, &
876 iopt_sfc ,iopt_trs)
877 vegetation_frac = 0.0
878 call noahmp_glacier ( &
879 i_location ,1 ,cosine_zenith ,nsnow , &
880 nsoil ,timestep , &
881 temperature_forcing ,air_pressure_forcing ,uwind_forcing ,vwind_forcing , &
882 spec_humidity_forcing,sw_radiation_forcing ,precipitation_forcing,radiation_lw_forcing , &
883 temperature_soil_bot ,forcing_height ,snow_ice_frac_old ,zsoil , &
884 thsfc_loc ,prslkix ,prsik1x ,prslk1x , &
885 air_pressure_surface ,pblhx ,iz0tlnd ,itime , &
886 vegetation_frac ,area_grid ,psi_opt , &
887 con_fvirt ,con_eps ,con_epsm1 ,con_cp , &
888 snowfall ,snow_water_equiv_old ,snow_albedo_old , &
889 cm_noahmp ,ch_noahmp ,snow_levels ,snow_water_equiv , &
890 soil_moisture_vol ,interface_depth ,snow_depth ,snow_level_ice , &
891 snow_level_liquid ,temperature_ground ,temperature_snow_soil,soil_liquid_vol , &
892 snow_age ,spec_humidity_surface,sw_absorbed_total ,sw_reflected_total , &
893 lw_absorbed_total ,sensible_heat_total ,latent_heat_ground ,ground_heat_total , &
894 temperature_radiative,evaporation_soil ,runoff_surface ,runoff_baseflow , &
895 sw_absorbed_ground ,albedo_total ,snowmelt_out ,snowmelt_shallow , &
896 snowmelt_shallow_1 ,snowmelt_shallow_2 ,temperature_bare_2m ,spec_humidity_bare_2m, &
897 z0h_total , &
898 emissivity_total ,precip_frozen_frac ,ch_bare_ground_2m ,snow_sublimation , &
899#ifdef CCPP
900 albedo_direct ,albedo_diffuse, errmsg ,errflg )
901#else
902 albedo_direct ,albedo_diffuse)
903#endif
904
905#ifdef CCPP
906 if (errflg /= 0) return
907#endif
908
909!
910! set some non-glacier fields over the glacier
911!
912
913 snow_cover_fraction = 1.0
914 temperature_leaf = undefined
915 canopy_ice = undefined
916 canopy_liquid = undefined
917 vapor_pres_canopy_air = undefined
918 temperature_canopy_air = undefined
919 canopy_wet_fraction = undefined
920 lake_water = undefined
921 depth_water_table = undefined
922 aquifer_water = undefined
923 saturated_water = undefined
924 leaf_carbon = undefined
925 root_carbon = undefined
926 stem_carbon = undefined
927 wood_carbon = undefined
928 soil_carbon_stable = undefined
929 soil_carbon_fast = undefined
930 leaf_area_index = undefined
931 stem_area_index = undefined
932 evaporation_canopy = undefined
933 transpiration = undefined
934 aquifer_water = undefined
935 precip_adv_heat_total = undefined
936 soil_moisture_wtd = 0.0
937 recharge = 0.0
938 deep_recharge = 0.0
939 eq_soil_water_vol = soil_moisture_vol
940 transpiration_heat = undefined
941 latent_heat_canopy = undefined
942 z0_total = 0.002
943 latent_heat_total = latent_heat_ground
944 t2mmp(i) = temperature_bare_2m
945 q2mp(i) = spec_humidity_bare_2m
946
947 tskin(i) = temperature_ground
948 surface_temperature = temperature_ground
949 vegetation_fraction = vegetation_frac
950 ch_vegetated = 0.0
951 ch_bare_ground = ch_noahmp
952 canopy_heat_storage = 0.0
953 lai_sunlit = 0.0
954 lai_shaded = 0.0
955 rs_sunlit = 0.0
956 rs_shaded = 0.0
957
958 else ! not glacier
959
960 ice_flag = 0
961
962 call noahmp_sflx (parameters , &
963 i_location ,j_location ,latitude , &
964 year_length ,julian_day ,cosine_zenith , &
965 timestep ,spatial_scale ,atmosphere_thickness , &
966 soil_levels ,soil_interface_depth ,max_snow_levels , &
967 vegetation_frac ,max_vegetation_frac ,vegetation_category , &
968 ice_flag ,surface_type ,crop_type , &
969 eq_soil_water_vol ,temperature_forcing ,air_pressure_forcing , &
970 air_pressure_surface ,uwind_forcing ,vwind_forcing , &
971 spec_humidity_forcing ,area_grid ,cloud_water_forcing , &
972 sw_radiation_forcing ,radiation_lw_forcing ,thsfc_loc , &
973 prslkix ,prsik1x ,prslk1x , &
974 pblhx ,iz0tlnd ,itime , &
975 psi_opt , &
976 precip_convective , &
977 precip_non_convective ,precip_sh_convective ,precip_snow , &
978 precip_graupel ,precip_hail ,temperature_soil_bot , &
979 co2_air ,o2_air ,foliage_nitrogen , &
980 snow_ice_frac_old ,forcing_height , &
981 con_fvirt ,con_eps, con_epsm1 ,con_cp , &
982 snow_albedo_old ,snow_water_equiv_old , &
983 temperature_snow_soil ,soil_liquid_vol ,soil_moisture_vol , &
984 temperature_canopy_air,vapor_pres_canopy_air ,canopy_wet_fraction , &
985 canopy_liquid ,canopy_ice ,temperature_leaf , &
986 temperature_ground ,spec_humidity_surface ,snowfall , &
987 rainfall ,snow_levels ,interface_depth , &
988 snow_depth ,snow_water_equiv ,snow_level_ice , &
989 snow_level_liquid ,depth_water_table ,aquifer_water , &
990 saturated_water , &
991 lake_water ,leaf_carbon ,root_carbon , &
992 stem_carbon ,wood_carbon ,soil_carbon_stable , &
993 soil_carbon_fast ,leaf_area_index ,stem_area_index , &
994 cm_noahmp ,ch_noahmp ,snow_age , &
995 grain_carbon ,growing_deg_days ,plant_growth_stage , &
996 soil_moisture_wtd ,deep_recharge ,recharge,ustarx , &
997 z0_total ,z0h_total ,surface_temperature , &
998 sw_absorbed_total ,sw_reflected_total , &
999 lw_absorbed_total ,sensible_heat_total ,ground_heat_total , &
1000 latent_heat_canopy ,latent_heat_ground ,transpiration_heat , &
1001 evaporation_canopy ,transpiration ,evaporation_soil , &
1002 temperature_radiative ,temperature_bare_grd ,temperature_veg_grd , &
1003 temperature_veg_2m ,temperature_bare_2m ,spec_humidity_veg_2m , &
1004 spec_humidity_bare_2m ,runoff_surface ,runoff_baseflow , &
1005 par_absorbed ,photosynthesis ,sw_absorbed_veg , &
1006 sw_absorbed_ground ,snow_cover_fraction ,net_eco_exchange , &
1007 global_prim_prod ,net_prim_prod ,vegetation_fraction , &
1008 albedo_total ,snowmelt_out ,snowmelt_shallow , &
1009 snowmelt_shallow_1 ,snowmelt_shallow_2 ,rs_sunlit , &
1010 rs_shaded ,albedo_direct ,albedo_diffuse , &
1011 albedo_direct_snow ,albedo_diffuse_snow , &
1012 canopy_gap_fraction , &
1013 incanopy_gap_fraction ,ch_vegetated ,ch_bare_ground , &
1014 emissivity_total ,sensible_heat_grd_veg ,sensible_heat_leaf , &
1015 sensible_heat_grd_bar ,latent_heat_grd_veg ,latent_heat_grd_bare , &
1016 ground_heat_veg ,ground_heat_bare ,lw_absorbed_grd_veg , &
1017 lw_absorbed_leaf ,lw_absorbed_grd_bare ,latent_heat_trans , &
1018 latent_heat_leaf ,ch_leaf ,ch_below_canopy , &
1019 ch_vegetated_2m ,ch_bare_ground_2m ,precip_frozen_frac , &
1020 precip_adv_heat_veg ,precip_adv_heat_grd_v ,precip_adv_heat_grd_b , &
1021 precip_adv_heat_total ,snow_sublimation ,canopy_heat_storage , &
1022 lai_sunlit ,lai_shaded ,leaf_air_resistance , &
1023#ifdef CCPP
1024 spec_humid_sfc_veg ,spec_humid_sfc_bare , &
1025 errmsg ,errflg )
1026#else
1027 spec_humid_sfc_veg ,spec_humid_sfc_bare )
1028#endif
1029
1030#ifdef CCPP
1031 if (errflg /= 0) return
1032#endif
1033
1034 latent_heat_total = latent_heat_canopy + latent_heat_ground + transpiration_heat
1035
1036 t2mmp(i) = temperature_veg_2m * vegetation_fraction + &
1037 temperature_bare_2m * (1-vegetation_fraction)
1038 q2mp(i) = spec_humidity_veg_2m * vegetation_fraction + &
1039 spec_humidity_bare_2m * (1-vegetation_fraction)
1040
1041 tskin(i) = surface_temperature
1042
1043 endif ! glacial split ends
1044
1045!
1046! --- noah-mp inout and out variables
1047!
1048
1049 tsnoxy(i,:) = temperature_snow_soil(-2: 0)
1050 stc(i,:) = temperature_snow_soil( 1:km)
1051 hflx(i) = sensible_heat_total !note unit change below
1052 evap(i) = latent_heat_total !note unit change below
1053 evbs(i) = latent_heat_ground
1054 evcw(i) = latent_heat_canopy
1055 trans(i) = transpiration_heat
1056 gflux(i) = -1.0*ground_heat_total ! opposite sign to be consistent with noah
1057 snohf(i) = snowmelt_out * con_hfus ! only snow that exits pack
1058 sbsno(i) = snow_sublimation
1059 pah(i) = precip_adv_heat_total
1060
1061 cmxy(i) = cm_noahmp
1062 chxy(i) = ch_noahmp
1063 zorl(i) = z0_total * 100.0 ! convert to cm
1064 ztmax(i) = z0h_total
1065
1066 !LAI-scale canopy resistance based on weighted sunlit shaded fraction
1067 if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. &
1068 lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then
1069 rca(i) = parameters%rsmax
1070 else !calculate LAI-scale canopy conductance (1/Rs)
1071 rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit) + &
1072 ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded))
1073 rca(i) = max((1.0/rca(i)),parameters%rsmin) !resistance
1074 end if
1075
1076 smc(i,:) = soil_moisture_vol
1077 slc(i,:) = soil_liquid_vol
1078 snowxy(i) = float(snow_levels)
1079 weasd(i) = snow_water_equiv
1080 snicexy(i,:) = snow_level_ice
1081 snliqxy(i,:) = snow_level_liquid
1082 snwdph(i) = snow_depth * 1000.0 ! convert from mm to m
1083 canopy(i) = canopy_ice + canopy_liquid
1084 canliqxy(i) = canopy_liquid
1085 canicexy(i) = canopy_ice
1086 zwtxy(i) = depth_water_table
1087 waxy(i) = aquifer_water
1088 wtxy(i) = saturated_water
1089 qsnowxy(i) = snowfall
1090 ecan(i) = evaporation_canopy
1091 etran(i) = transpiration
1092 edir(i) = evaporation_soil
1093 drain(i) = runoff_baseflow
1094 runoff(i) = runoff_surface
1095
1096 lfmassxy(i) = leaf_carbon
1097 rtmassxy(i) = root_carbon
1098 stmassxy(i) = stem_carbon
1099 woodxy(i) = wood_carbon
1100 stblcpxy(i) = soil_carbon_stable
1101 fastcpxy(i) = soil_carbon_fast
1102 xlaixy(i) = leaf_area_index
1103 xsaixy(i) = stem_area_index
1104
1105 snowc(i) = snow_cover_fraction
1106 sncovr1(i) = snow_cover_fraction
1107
1108 qsurf(i) = spec_humidity_surface
1109 tsurf(i) = tskin(i)
1110
1111 tvxy(i) = temperature_leaf
1112 tgxy(i) = temperature_ground
1113 tahxy(i) = temperature_canopy_air
1114 eahxy(i) = vapor_pres_canopy_air
1115 emiss(i) = emissivity_total
1116
1117 if(albedo_total > 0.0) then
1118 sfalb(i) = albedo_total
1119 albdvis(i) = albedo_direct(1)
1120 albdnir(i) = albedo_direct(2)
1121 albivis(i) = albedo_diffuse(1)
1122 albinir(i) = albedo_diffuse(2)
1123 end if
1124
1125 zsnsoxy(i,:) = interface_depth
1126
1127 if(present(canopy_heat_storage_ccpp )) canopy_heat_storage_ccpp(i) = canopy_heat_storage
1128 if(present(rainfall_ccpp )) rainfall_ccpp(i) = rainfall
1129 if(present(sw_absorbed_total_ccpp )) sw_absorbed_total_ccpp(i) = sw_absorbed_total
1130 if(present(sw_reflected_total_ccpp )) sw_reflected_total_ccpp(i) = sw_reflected_total
1131 if(present(lw_absorbed_total_ccpp )) lw_absorbed_total_ccpp(i) = lw_absorbed_total
1132 if(present(temperature_bare_grd_ccpp )) temperature_bare_grd_ccpp(i) = temperature_bare_grd
1133 if(present(temperature_veg_grd_ccpp )) temperature_veg_grd_ccpp(i) = temperature_veg_grd
1134 if(present(temperature_veg_2m_ccpp )) temperature_veg_2m_ccpp(i) = temperature_veg_2m
1135 if(present(temperature_bare_2m_ccpp )) temperature_bare_2m_ccpp(i) = temperature_bare_2m
1136 if(present(spec_humidity_veg_2m_ccpp )) spec_humidity_veg_2m_ccpp(i) = spec_humidity_veg_2m
1137 if(present(spec_humidity_bare_2m_ccpp)) spec_humidity_bare_2m_ccpp(i) = spec_humidity_bare_2m
1138 if(present(sw_absorbed_veg_ccpp )) sw_absorbed_veg_ccpp(i) = sw_absorbed_veg
1139 if(present(sw_absorbed_ground_ccpp )) sw_absorbed_ground_ccpp(i) = sw_absorbed_ground
1140 if(present(snowmelt_out_ccpp )) snowmelt_out_ccpp(i) = snowmelt_out
1141 if(present(snowmelt_shallow_ccpp )) snowmelt_shallow_ccpp(i) = snowmelt_shallow
1142 if(present(albedo_direct_snow_ccpp )) albedo_direct_snow_ccpp(i,:) = albedo_direct_snow
1143 if(present(albedo_diffuse_snow_ccpp )) albedo_diffuse_snow_ccpp(i,:) = albedo_diffuse_snow
1144 if(present(ch_vegetated_ccpp )) ch_vegetated_ccpp(i) = ch_vegetated
1145 if(present(ch_bare_ground_ccpp )) ch_bare_ground_ccpp(i) = ch_bare_ground
1146 if(present(sensible_heat_grd_veg_ccpp)) sensible_heat_grd_veg_ccpp(i) = sensible_heat_grd_veg
1147 if(present(sensible_heat_leaf_ccpp )) sensible_heat_leaf_ccpp(i) = sensible_heat_leaf
1148 if(present(sensible_heat_grd_bar_ccpp)) sensible_heat_grd_bar_ccpp(i) = sensible_heat_grd_bar
1149 if(present(latent_heat_grd_veg_ccpp )) latent_heat_grd_veg_ccpp(i) = latent_heat_grd_veg
1150 if(present(latent_heat_grd_bare_ccpp )) latent_heat_grd_bare_ccpp(i) = latent_heat_grd_bare
1151 if(present(ground_heat_veg_ccpp )) ground_heat_veg_ccpp(i) = ground_heat_veg
1152 if(present(ground_heat_bare_ccpp )) ground_heat_bare_ccpp(i) = ground_heat_bare
1153 if(present(lw_absorbed_grd_veg_ccpp )) lw_absorbed_grd_veg_ccpp(i) = lw_absorbed_grd_veg
1154 if(present(lw_absorbed_leaf_ccpp )) lw_absorbed_leaf_ccpp(i) = lw_absorbed_leaf
1155 if(present(lw_absorbed_grd_bare_ccpp )) lw_absorbed_grd_bare_ccpp(i) = lw_absorbed_grd_bare
1156 if(present(latent_heat_trans_ccpp )) latent_heat_trans_ccpp(i) = latent_heat_trans
1157 if(present(latent_heat_leaf_ccpp )) latent_heat_leaf_ccpp(i) = latent_heat_leaf
1158 if(present(ch_leaf_ccpp )) ch_leaf_ccpp(i) = ch_leaf
1159 if(present(ch_below_canopy_ccpp )) ch_below_canopy_ccpp(i) = ch_below_canopy
1160 if(present(ch_vegetated_2m_ccpp )) ch_vegetated_2m_ccpp(i) = ch_vegetated_2m
1161 if(present(ch_bare_ground_2m_ccpp )) ch_bare_ground_2m_ccpp(i) = ch_bare_ground_2m
1162 if(present(precip_adv_heat_veg_ccpp )) precip_adv_heat_veg_ccpp(i) = precip_adv_heat_veg
1163 if(present(precip_adv_heat_grd_v_ccpp)) precip_adv_heat_grd_v_ccpp(i) = precip_adv_heat_grd_v
1164 if(present(precip_adv_heat_grd_b_ccpp)) precip_adv_heat_grd_b_ccpp(i) = precip_adv_heat_grd_b
1165 if(present(spec_humid_sfc_veg_ccpp )) spec_humid_sfc_veg_ccpp(i) = spec_humid_sfc_veg
1166 if(present(spec_humid_sfc_bare_ccpp )) spec_humid_sfc_bare_ccpp(i) = spec_humid_sfc_bare
1167
1168 wslakexy(i) = lake_water ! not active
1169 fwetxy(i) = canopy_wet_fraction
1170 taussxy(i) = snow_age
1171 alboldxy(i) = snow_albedo_old
1172 sneqvoxy(i) = snow_water_equiv_old
1173
1174 smcwtdxy(i) = soil_moisture_wtd ! only need for run=5
1175 deeprechxy(i) = deep_recharge ! only need for run=5
1176 rechxy(i) = recharge ! only need for run=5
1177 smoiseq(i,:) = eq_soil_water_vol ! only need for run=5; listed as in
1178
1179 stm(i) = (0.1*soil_moisture_vol(1) + &
1180 0.3*soil_moisture_vol(2) + &
1181 0.6*soil_moisture_vol(3) + & ! clean up and use depths above
1182 1.0*soil_moisture_vol(4))*1000.0 ! unit conversion from m to kg m-2
1183
1184 wet1(i) = soil_moisture_vol(1) / smcmax_table(soil_category(1))
1185 smcwlt2(i) = smcdry_table(soil_category(1)) !!!change to wilt?
1186 smcref2(i) = smcref_table(soil_category(1))
1187
1188 virtfac1 = 1.0 + con_fvirt * max(q1(i), 1.e-8) !from forcing
1189
1190 if(thsfc_loc) then ! Use local potential temperature
1191 vptemp =temperature_forcing * prslki(i)*virtfac1 !virtual potential temperature @zlvl 1
1192 else ! Use potential temperature reference to 1000 hPa
1193 vptemp =temperature_forcing /prslk1(i) * virtfac1
1194 endif
1195
1196 if(thsfc_loc) then ! Use local potential temperature
1197 tvs1 = tskin(i) * virtfac1
1198 else ! Use potential temperature referenced to 1000 hPa
1199 tvs1 = tskin(i)/prsik1(i) * virtfac1
1200 endif
1201
1202 z0_total = max(min(z0_total,forcing_height),1.0e-6)
1203 z0h_total = max(z0h_total,1.0e-6)
1204
1205
1206 tem1 = (z0_total - z0lo) / (z0up - z0lo)
1207 tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys)
1208 tem2 = max(vegetation_fraction, 0.1_kind_phys)
1209 zvfun(i) = sqrt(tem1 * tem2)
1210 gdx=sqrt(garea(i))
1211
1212! if ( .not. do_mynnsfclay) then !GFS sfcdiff
1213 if ( iopt_sfc .ne. 4 ) then !GFS sfcdiff
1214
1215 call gfs_stability &
1216 (zf(i), zvfun(i), gdx, virtual_temperature, vptemp,wind(i), z0_total, z0h_total, &
1217 tvs1, con_g, thsfc_loc, &
1218 rb1(i), fm1(i), fh1(i), fm101(i), fh21(i), cm(i), ch(i), stress1(i), ustar1(i))
1219
1220 rmol1(i) = undefined !not used in GFS sfcdif -> to satsify output
1221 flhc1(i) = undefined
1222 flqc1(i) = undefined
1223
1224 rah_total = max(1.0,1.0/( ch(i)*wind(i)) )
1225 cah_total = density * con_cp /rah_total
1226! tskin(i) = sensible_heat_total/cah_total + temperature_forcing ! test to use combined ch and SH to backout Ts
1227
1228! ch(i) = ch_vegetated * vegetation_frac + ch_bare_ground*(1.0-vegetation_frac)
1229
1230 else ! MYNN - note the GFS option is the same as sfcdif3; so removed.
1231
1232 qfx = evap(i) / con_hvap ! use flux from output
1233
1234 call sfcdif4(i_location ,j_location ,uwind_forcing ,vwind_forcing , &
1235 temperature_forcing, air_pressure_forcing ,air_pressure_surface , &
1236 pblhx,gdx,z0_total,con_fvirt,con_eps,con_cp,itime,snwdph(i),mnice, &
1237 psi_opt,surface_temperature, &
1238 spec_humidity_forcing,forcing_height,iz0tlnd,spec_humidity_surface,&
1239 sensible_heat_total,qfx,cm(i),ch(i),ch2,cq2,rmol1(i),ustar1(i), &
1240 rb1(i),fm1(i),fh1(i),stress1(i),fm101(i),fh21(i),wspd1,flhc1(i), &
1241 flqc1(i) )
1242
1243 ch(i)=ch(i)/wspd1
1244 cm(i)=cm(i)/wspd1
1245
1246 ch(i) = ch_vegetated * vegetation_fraction + ch_bare_ground*(1.0-vegetation_fraction)
1247
1248 rah_total = max(1.0,1.0/( ch(i)*wind(i)) )
1249 cah_total = density * con_cp /rah_total
1250
1251! tskin(i) = sensible_heat_total/cah_total + temperature_forcing !
1252
1253 endif
1254
1255
1256
1257 cmxy(i) = cm(i)
1258 chxy(i) = ch(i)
1259
1260 chh(i) = chxy(i) * wind(i) * density
1261 cmm(i) = cmxy(i) * wind(i)
1262
1263 snwdph(i) = snow_depth * 1000.0 ! convert from m to mm; wait after the stability call
1264! qsurf (i) = q1(i) + evap(i)/(con_hvap*density*ch(i)*wind(i))
1265
1266!
1267! --- change units for output
1268!
1269 hflx(i) = hflx(i) / density / con_cp
1270 evap(i) = evap(i) / density / con_hvap
1271
1272!
1273! --- calculate potential evaporation using noah code
1274!
1275 potential_temperature = temperature_forcing * prslki(i)
1276 virtual_temperature = temperature_forcing * (1.0 + 0.61*spec_humidity_forcing)
1277 penman_radiation = sw_absorbed_total + radiation_lw_forcing
1278 dqsdt = spec_humidity_sat * a23m4/(temperature_forcing-a4)**2
1279
1280 precip_freeze_frac_in = srflag(i)
1281 is_snowing = .false.
1282 is_freeze_rain = .false.
1283 if (precipitation_forcing > 0.0) then
1284 if (precip_freeze_frac_in > 0.0) then ! rain/snow flag, one condition is enough?
1285 is_snowing = .true.
1286 else
1287 if (temperature_forcing <= 275.15) is_freeze_rain = .true.
1288 end if
1289 end if
1290
1291!
1292! using new combined ch output to compute ep
1293!
1294 ch_noahmp = chxy(i) * wind(i)
1295
1296 call penman (temperature_forcing, air_pressure_forcing , ch_noahmp , &
1297 virtual_temperature, potential_temperature, precipitation_forcing, &
1298 penman_radiation , ground_heat_total , spec_humidity_forcing, &
1299 spec_humidity_sat , potential_evaporation, is_snowing , &
1300 is_freeze_rain , precip_freeze_frac_in, dqsdt , &
1301 emissivity_total , snow_cover_fraction )
1302
1303 ep(i) = potential_evaporation
1304
1305 end if ! flag_iter(i) .and. dry(i)
1306
1307 end do ! im loop
1308
1309 return
1310
1311 end subroutine noahmpdrv_run
1313!-----------------------------------
1314
1318 subroutine transfer_mp_parameters (vegtype,soiltype,slopetype, &
1319 soilcolor,croptype,parameters)
1320
1321 use noahmp_tables
1322 use module_sf_noahmplsm
1323
1324 implicit none
1325
1326 integer, intent(in) :: vegtype
1327 integer, intent(in) :: soiltype(4)
1328 integer, intent(in) :: slopetype
1329 integer, intent(in) :: soilcolor
1330 integer, intent(in) :: croptype
1331
1332 type (noahmp_parameters), intent(out) :: parameters
1333
1334 real :: refdk
1335 real :: refkdt
1336 real :: frzk
1337 real :: frzfact
1338 integer :: isoil
1339
1340 parameters%iswater = iswater_table
1341 parameters%isbarren = isbarren_table
1342 parameters%isice = isice_table
1343 parameters%iscrop = iscrop_table
1344 parameters%eblforest = eblforest_table
1345
1346!-----------------------------------------------------------------------&
1347 parameters%urban_flag = .false.
1348 if( vegtype == isurban_table .or. vegtype == 31 &
1349 & .or.vegtype == 32 .or. vegtype == 33) then
1350 parameters%urban_flag = .true.
1351 endif
1352
1353!------------------------------------------------------------------------------------------!
1354! transfer veg parameters
1355!------------------------------------------------------------------------------------------!
1356
1357 parameters%ch2op = ch2op_table(vegtype) !maximum intercepted h2o per unit lai+sai (mm)
1358 parameters%dleaf = dleaf_table(vegtype) !characteristic leaf dimension (m)
1359 parameters%z0mvt = z0mvt_table(vegtype) !momentum roughness length (m)
1360 parameters%hvt = hvt_table(vegtype) !top of canopy (m)
1361 parameters%hvb = hvb_table(vegtype) !bottom of canopy (m)
1362 parameters%z0mhvt = z0mhvt_table(vegtype) !momentum roughness length (m)
1363 parameters%den = den_table(vegtype) !tree density (no. of trunks per m2)
1364 parameters%rc = rc_table(vegtype) !tree crown radius (m)
1365 parameters%mfsno = mfsno_table(vegtype) !snowmelt m parameter ()
1366 parameters%scffac = scffac_table(vegtype) !snow cover factor
1367 parameters%cbiom = cbiom_table(vegtype) !canopy biomass heat capacity parameter (m)
1368 parameters%saim = saim_table(vegtype,:) !monthly stem area index, one-sided
1369 parameters%laim = laim_table(vegtype,:) !monthly leaf area index, one-sided
1370 parameters%sla = sla_table(vegtype) !single-side leaf area per kg [m2/kg]
1371 parameters%dilefc = dilefc_table(vegtype) !coeficient for leaf stress death [1/s]
1372 parameters%dilefw = dilefw_table(vegtype) !coeficient for leaf stress death [1/s]
1373 parameters%fragr = fragr_table(vegtype) !fraction of growth respiration !original was 0.3
1374 parameters%ltovrc = ltovrc_table(vegtype) !leaf turnover [1/s]
1375
1376 parameters%c3psn = c3psn_table(vegtype) !photosynthetic pathway: 0. = c4, 1. = c3
1377 parameters%kc25 = kc25_table(vegtype) !co2 michaelis-menten constant at 25c (pa)
1378 parameters%akc = akc_table(vegtype) !q10 for kc25
1379 parameters%ko25 = ko25_table(vegtype) !o2 michaelis-menten constant at 25c (pa)
1380 parameters%ako = ako_table(vegtype) !q10 for ko25
1381 parameters%vcmx25 = vcmx25_table(vegtype) !maximum rate of carboxylation at 25c (umol co2/m**2/s)
1382 parameters%avcmx = avcmx_table(vegtype) !q10 for vcmx25
1383 parameters%bp = bp_table(vegtype) !minimum leaf conductance (umol/m**2/s)
1384 parameters%mp = mp_table(vegtype) !slope of conductance-to-photosynthesis relationship
1385 parameters%qe25 = qe25_table(vegtype) !quantum efficiency at 25c (umol co2 / umol photon)
1386 parameters%aqe = aqe_table(vegtype) !q10 for qe25
1387 parameters%rmf25 = rmf25_table(vegtype) !leaf maintenance respiration at 25c (umol co2/m**2/s)
1388 parameters%rms25 = rms25_table(vegtype) !stem maintenance respiration at 25c (umol co2/kg bio/s)
1389 parameters%rmr25 = rmr25_table(vegtype) !root maintenance respiration at 25c (umol co2/kg bio/s)
1390 parameters%arm = arm_table(vegtype) !q10 for maintenance respiration
1391 parameters%folnmx = folnmx_table(vegtype) !foliage nitrogen concentration when f(n)=1 (%)
1392 parameters%tmin = tmin_table(vegtype) !minimum temperature for photosynthesis (k)
1393
1394 parameters%xl = xl_table(vegtype) !leaf/stem orientation index
1395 parameters%rhol = rhol_table(vegtype,:) !leaf reflectance: 1=vis, 2=nir
1396 parameters%rhos = rhos_table(vegtype,:) !stem reflectance: 1=vis, 2=nir
1397 parameters%taul = taul_table(vegtype,:) !leaf transmittance: 1=vis, 2=nir
1398 parameters%taus = taus_table(vegtype,:) !stem transmittance: 1=vis, 2=nir
1399
1400 parameters%mrp = mrp_table(vegtype) !microbial respiration parameter (umol co2 /kg c/ s)
1401 parameters%cwpvt = cwpvt_table(vegtype) !empirical canopy wind parameter
1402
1403 parameters%wrrat = wrrat_table(vegtype) !wood to non-wood ratio
1404 parameters%wdpool = wdpool_table(vegtype) !wood pool (switch 1 or 0) depending on woody or not [-]
1405 parameters%tdlef = tdlef_table(vegtype) !characteristic t for leaf freezing [k]
1406
1407 parameters%nroot = nroot_table(vegtype) !number of soil layers with root present
1408 parameters%rgl = rgl_table(vegtype) !parameter used in radiation stress function
1409 parameters%rsmin = rs_table(vegtype) !minimum stomatal resistance [s m-1]
1410 parameters%hs = hs_table(vegtype) !parameter used in vapor pressure deficit function
1411 parameters%topt = topt_table(vegtype) !optimum transpiration air temperature [k]
1412 parameters%rsmax = rsmax_table(vegtype) !maximal stomatal resistance [s m-1]
1413
1414!------------------------------------------------------------------------------------------!
1415! transfer rad parameters
1416!------------------------------------------------------------------------------------------!
1417
1418 parameters%albsat = albsat_table(soilcolor,:)
1419 parameters%albdry = albdry_table(soilcolor,:)
1420 parameters%albice = albice_table
1421 parameters%alblak = alblak_table
1422 parameters%omegas = omegas_table
1423 parameters%betads = betads_table
1424 parameters%betais = betais_table
1425 parameters%eg = eg_table
1426
1427!------------------------------------------------------------------------------------------!
1428! Transfer crop parameters
1429!------------------------------------------------------------------------------------------!
1430
1431 if(croptype > 0) then
1432 parameters%pltday = pltday_table(croptype) ! planting date
1433 parameters%hsday = hsday_table(croptype) ! harvest date
1434 parameters%plantpop = plantpop_table(croptype) ! plant density [per ha] - used?
1435 parameters%irri = irri_table(croptype) ! irrigation strategy 0= non-irrigation 1=irrigation (no water-stress)
1436 parameters%gddtbase = gddtbase_table(croptype) ! base temperature for gdd accumulation [c]
1437 parameters%gddtcut = gddtcut_table(croptype) ! upper temperature for gdd accumulation [c]
1438 parameters%gdds1 = gdds1_table(croptype) ! gdd from seeding to emergence
1439 parameters%gdds2 = gdds2_table(croptype) ! gdd from seeding to initial vegetative
1440 parameters%gdds3 = gdds3_table(croptype) ! gdd from seeding to post vegetative
1441 parameters%gdds4 = gdds4_table(croptype) ! gdd from seeding to intial reproductive
1442 parameters%gdds5 = gdds5_table(croptype) ! gdd from seeding to pysical maturity
1443 parameters%c3c4 = c3c4_table(croptype) ! photosynthetic pathway: 1. = c3 2. = c4
1444 parameters%aref = aref_table(croptype) ! reference maximum co2 assimulation rate
1445 parameters%psnrf = psnrf_table(croptype) ! co2 assimulation reduction factor(0-1) (e.g.pests, weeds)
1446 parameters%i2par = i2par_table(croptype) ! fraction of incoming solar radiation to photosynthetically active radiation
1447 parameters%tassim0 = tassim0_table(croptype) ! minimum temperature for co2 assimulation [c]
1448 parameters%tassim1 = tassim1_table(croptype) ! co2 assimulation linearly increasing until temperature reaches t1 [c]
1449 parameters%tassim2 = tassim2_table(croptype) ! co2 assmilation rate remain at aref until temperature reaches t2 [c]
1450 parameters%k = k_table(croptype) ! light extinction coefficient
1451 parameters%epsi = epsi_table(croptype) ! initial light use efficiency
1452 parameters%q10mr = q10mr_table(croptype) ! q10 for maintainance respiration
1453 parameters%foln_mx = foln_mx_table(croptype) ! foliage nitrogen concentration when f(n)=1 (%)
1454 parameters%lefreez = lefreez_table(croptype) ! characteristic t for leaf freezing [k]
1455 parameters%dile_fc = dile_fc_table(croptype,:) ! coeficient for temperature leaf stress death [1/s]
1456 parameters%dile_fw = dile_fw_table(croptype,:) ! coeficient for water leaf stress death [1/s]
1457 parameters%fra_gr = fra_gr_table(croptype) ! fraction of growth respiration
1458 parameters%lf_ovrc = lf_ovrc_table(croptype,:) ! fraction of leaf turnover [1/s]
1459 parameters%st_ovrc = st_ovrc_table(croptype,:) ! fraction of stem turnover [1/s]
1460 parameters%rt_ovrc = rt_ovrc_table(croptype,:) ! fraction of root tunrover [1/s]
1461 parameters%lfmr25 = lfmr25_table(croptype) ! leaf maintenance respiration at 25c [umol co2/m**2 /s]
1462 parameters%stmr25 = stmr25_table(croptype) ! stem maintenance respiration at 25c [umol co2/kg bio/s]
1463 parameters%rtmr25 = rtmr25_table(croptype) ! root maintenance respiration at 25c [umol co2/kg bio/s]
1464 parameters%grainmr25 = grainmr25_table(croptype) ! grain maintenance respiration at 25c [umol co2/kg bio/s]
1465 parameters%lfpt = lfpt_table(croptype,:) ! fraction of carbohydrate flux to leaf
1466 parameters%stpt = stpt_table(croptype,:) ! fraction of carbohydrate flux to stem
1467 parameters%rtpt = rtpt_table(croptype,:) ! fraction of carbohydrate flux to root
1468 parameters%grainpt = grainpt_table(croptype,:) ! fraction of carbohydrate flux to grain
1469 parameters%bio2lai = bio2lai_table(croptype) ! leaf are per living leaf biomass [m^2/kg]
1470 end if
1471
1472!------------------------------------------------------------------------------------------!
1473! transfer global parameters
1474!------------------------------------------------------------------------------------------!
1475
1476 parameters%co2 = co2_table
1477 parameters%o2 = o2_table
1478 parameters%timean = timean_table
1479 parameters%fsatmx = fsatmx_table
1480 parameters%z0sno = z0sno_table
1481 parameters%ssi = ssi_table
1482 parameters%snow_ret_fac = snow_ret_fac_table
1483 parameters%swemx = swemx_table
1484 parameters%tau0 = tau0_table
1485 parameters%grain_growth = grain_growth_table
1486 parameters%extra_growth = extra_growth_table
1487 parameters%dirt_soot = dirt_soot_table
1488 parameters%bats_cosz = bats_cosz_table
1489 parameters%bats_vis_new = bats_vis_new_table
1490 parameters%bats_nir_new = bats_nir_new_table
1491 parameters%bats_vis_age = bats_vis_age_table
1492 parameters%bats_nir_age = bats_nir_age_table
1493 parameters%bats_vis_dir = bats_vis_dir_table
1494 parameters%bats_nir_dir = bats_nir_dir_table
1495 parameters%rsurf_snow = rsurf_snow_table
1496 parameters%rsurf_exp = rsurf_exp_table
1497 parameters%snow_emis = snow_emis_table
1498
1499! ----------------------------------------------------------------------
1500! transfer soil parameters
1501! ----------------------------------------------------------------------
1502
1503 do isoil = 1, size(soiltype)
1504 parameters%bexp(isoil) = bexp_table(soiltype(isoil))
1505 parameters%dksat(isoil) = dksat_table(soiltype(isoil))
1506 parameters%dwsat(isoil) = dwsat_table(soiltype(isoil))
1507 parameters%psisat(isoil) = psisat_table(soiltype(isoil))
1508 parameters%quartz(isoil) = quartz_table(soiltype(isoil))
1509 parameters%smcdry(isoil) = smcdry_table(soiltype(isoil))
1510 parameters%smcmax(isoil) = smcmax_table(soiltype(isoil))
1511 parameters%smcref(isoil) = smcref_table(soiltype(isoil))
1512 parameters%smcwlt(isoil) = smcwlt_table(soiltype(isoil))
1513 end do
1514
1515 parameters%f1 = f1_table(soiltype(1))
1516 parameters%refdk = refdk_table
1517 parameters%refkdt = refkdt_table
1518
1519! ----------------------------------------------------------------------
1520! transfer genparm parameters
1521! ----------------------------------------------------------------------
1522 parameters%csoil = csoil_table
1523 parameters%zbot = zbot_table
1524 parameters%czil = czil_table
1525
1526 frzk = frzk_table
1527 parameters%kdt = parameters%refkdt * parameters%dksat(1) / parameters%refdk
1528 parameters%slope = slope_table(slopetype)
1529
1530 if(parameters%urban_flag)then ! hardcoding some urban parameters for soil
1531 parameters%smcmax = 0.45
1532 parameters%smcref = 0.42
1533 parameters%smcwlt = 0.40
1534 parameters%smcdry = 0.40
1535 parameters%csoil = 3.e6
1536 endif
1537
1538 ! adjust frzk parameter to actual soil type: frzk * frzfact
1539
1540!-----------------------------------------------------------------------&
1541 if(soiltype(1) /= 14) then
1542 frzfact = (parameters%smcmax(1) / parameters%smcref(1)) * (0.412 / 0.468)
1543 parameters%frzx = frzk * frzfact
1544 end if
1545
1546 end subroutine transfer_mp_parameters
1547
1550SUBROUTINE pedotransfer_sr2006(nsoil,sand,clay,orgm,parameters)
1551
1552 use module_sf_noahmplsm
1553 use noahmp_tables
1554
1555 implicit none
1556
1557 integer, intent(in ) :: nsoil ! number of soil layers
1558 real, dimension( 1:nsoil ), intent(inout) :: sand
1559 real, dimension( 1:nsoil ), intent(inout) :: clay
1560 real, dimension( 1:nsoil ), intent(inout) :: orgm
1561
1562 real, dimension( 1:nsoil ) :: theta_1500t
1563 real, dimension( 1:nsoil ) :: theta_1500
1564 real, dimension( 1:nsoil ) :: theta_33t
1565 real, dimension( 1:nsoil ) :: theta_33
1566 real, dimension( 1:nsoil ) :: theta_s33t
1567 real, dimension( 1:nsoil ) :: theta_s33
1568 real, dimension( 1:nsoil ) :: psi_et
1569 real, dimension( 1:nsoil ) :: psi_e
1570
1571 type(noahmp_parameters), intent(inout) :: parameters
1572 integer :: k
1573
1574 do k = 1,4
1575 if(sand(k) <= 0 .or. clay(k) <= 0) then
1576 sand(k) = 0.41
1577 clay(k) = 0.18
1578 end if
1579 if(orgm(k) <= 0 ) orgm(k) = 0.0
1580 end do
1581
1582 theta_1500t = sr2006_theta_1500t_a*sand &
1583 + sr2006_theta_1500t_b*clay &
1584 + sr2006_theta_1500t_c*orgm &
1585 + sr2006_theta_1500t_d*sand*orgm &
1586 + sr2006_theta_1500t_e*clay*orgm &
1587 + sr2006_theta_1500t_f*sand*clay &
1588 + sr2006_theta_1500t_g
1589
1590 theta_1500 = theta_1500t &
1591 + sr2006_theta_1500_a*theta_1500t &
1592 + sr2006_theta_1500_b
1593
1594 theta_33t = sr2006_theta_33t_a*sand &
1595 + sr2006_theta_33t_b*clay &
1596 + sr2006_theta_33t_c*orgm &
1597 + sr2006_theta_33t_d*sand*orgm &
1598 + sr2006_theta_33t_e*clay*orgm &
1599 + sr2006_theta_33t_f*sand*clay &
1600 + sr2006_theta_33t_g
1601
1602 theta_33 = theta_33t &
1603 + sr2006_theta_33_a*theta_33t*theta_33t &
1604 + sr2006_theta_33_b*theta_33t &
1605 + sr2006_theta_33_c
1606
1607 theta_s33t = sr2006_theta_s33t_a*sand &
1608 + sr2006_theta_s33t_b*clay &
1609 + sr2006_theta_s33t_c*orgm &
1610 + sr2006_theta_s33t_d*sand*orgm &
1611 + sr2006_theta_s33t_e*clay*orgm &
1612 + sr2006_theta_s33t_f*sand*clay &
1613 + sr2006_theta_s33t_g
1614
1615 theta_s33 = theta_s33t &
1616 + sr2006_theta_s33_a*theta_s33t &
1617 + sr2006_theta_s33_b
1618
1619 psi_et = sr2006_psi_et_a*sand &
1620 + sr2006_psi_et_b*clay &
1621 + sr2006_psi_et_c*theta_s33 &
1622 + sr2006_psi_et_d*sand*theta_s33 &
1623 + sr2006_psi_et_e*clay*theta_s33 &
1624 + sr2006_psi_et_f*sand*clay &
1625 + sr2006_psi_et_g
1626
1627 psi_e = psi_et &
1628 + sr2006_psi_e_a*psi_et*psi_et &
1629 + sr2006_psi_e_b*psi_et &
1630 + sr2006_psi_e_c
1631
1632 parameters%smcwlt = theta_1500
1633 parameters%smcref = theta_33
1634 parameters%smcmax = theta_33 &
1635 + theta_s33 &
1636 + sr2006_smcmax_a*sand &
1637 + sr2006_smcmax_b
1638
1639 parameters%bexp = 3.816712826 / (log(theta_33) - log(theta_1500) )
1640 parameters%psisat = psi_e
1641 parameters%dksat = 1930.0 * (parameters%smcmax - theta_33) ** (3.0 - 1.0/parameters%bexp)
1642 parameters%quartz = sand
1643
1644! Units conversion
1645
1646 parameters%psisat = max(0.1,parameters%psisat) ! arbitrarily impose a limit of 0.1kpa
1647 parameters%psisat = 0.101997 * parameters%psisat ! convert kpa to m
1648 parameters%dksat = parameters%dksat / 3600000.0 ! convert mm/h to m/s
1649 parameters%dwsat = parameters%dksat * parameters%psisat *parameters%bexp / parameters%smcmax ! units should be m*m/s
1650 parameters%smcdry = parameters%smcwlt
1651
1652! Introducing somewhat arbitrary limits (based on SOILPARM) to prevent bad things
1653
1654 parameters%smcmax = max(0.32 ,min(parameters%smcmax, 0.50 ))
1655 parameters%smcref = max(0.17 ,min(parameters%smcref,parameters%smcmax ))
1656 parameters%smcwlt = max(0.01 ,min(parameters%smcwlt,parameters%smcref ))
1657 parameters%smcdry = max(0.01 ,min(parameters%smcdry,parameters%smcref ))
1658 parameters%bexp = max(2.50 ,min(parameters%bexp, 12.0 ))
1659 parameters%psisat = max(0.03 ,min(parameters%psisat, 1.00 ))
1660 parameters%dksat = max(5.e-7,min(parameters%dksat, 1.e-5))
1661 parameters%dwsat = max(1.e-6,min(parameters%dwsat, 3.e-5))
1662 parameters%quartz = max(0.05 ,min(parameters%quartz, 0.95 ))
1663
1664 END SUBROUTINE pedotransfer_sr2006
1665
1666!-----------------------------------------------------------------------&
1667
1672 subroutine penman (sfctmp,sfcprs,ch,t2v,th2,prcp,fdown,ssoil, &
1673 & q2,q2sat,etp,snowng,frzgra,ffrozp, &
1674 & dqsdt2,emissi_in,sncovr)
1675
1676! etp is calcuated right after ssoil
1677
1678! ----------------------------------------------------------------------
1679! subroutine penman
1680! ----------------------------------------------------------------------
1681 use machine, only: kind_phys
1682 implicit none
1683 logical, intent(in) :: snowng, frzgra
1684 real(kind=kind_phys), intent(in) :: ch, dqsdt2,fdown,prcp,ffrozp, &
1685 & q2, q2sat,ssoil, sfcprs, sfctmp, &
1686 & t2v, th2,emissi_in,sncovr
1687 real(kind=kind_phys), intent(out) :: etp
1688 real(kind=kind_phys) :: epsca,flx2,rch,rr,t24
1689 real(kind=kind_phys) :: a, delta, fnet,rad,rho,emissi,elcp1,lvs
1690
1691 real(kind=kind_phys), parameter :: elcp = 2.4888e+3, lsubc = 2.501000e+6,cp = 1004.6
1692 real(kind=kind_phys), parameter :: lsubs = 2.83e+6, rd = 287.05, cph2o = 4.1855e+3
1693 real(kind=kind_phys), parameter :: cpice = 2.106e+3, lsubf = 3.335e5
1694 real(kind=kind_phys), parameter :: sigma = 5.6704e-8
1695
1696! ----------------------------------------------------------------------
1697! executable code begins here:
1698! ----------------------------------------------------------------------
1699! ----------------------------------------------------------------------
1700! prepare partial quantities for penman equation.
1701! ----------------------------------------------------------------------
1702 emissi=emissi_in
1703! elcp1 = (1.0-sncovr)*elcp + sncovr*elcp*lsubs/lsubc
1704 lvs = (1.0-sncovr)*lsubc + sncovr*lsubs
1705
1706 flx2 = 0.0
1707 delta = elcp * dqsdt2
1708! delta = elcp1 * dqsdt2
1709 t24 = sfctmp * sfctmp * sfctmp * sfctmp
1710 rr = t24 * 6.48e-8 / (sfcprs * ch) + 1.0
1711! rr = emissi*t24 * 6.48e-8 / (sfcprs * ch) + 1.0
1712 rho = sfcprs / (rd * t2v)
1713
1714! ----------------------------------------------------------------------
1715! adjust the partial sums / products with the latent heat
1716! effects caused by falling precipitation.
1717! ----------------------------------------------------------------------
1718 rch = rho * cp * ch
1719 if (.not. snowng) then
1720 if (prcp > 0.0) rr = rr + cph2o * prcp / rch
1721 else
1722! ---- ... fractional snowfall/rainfall
1723 rr = rr + (cpice*ffrozp+cph2o*(1.-ffrozp)) &
1724 & *prcp/rch
1725 end if
1726
1727! ----------------------------------------------------------------------
1728! include the latent heat effects of frzng rain converting to ice on
1729! impact in the calculation of flx2 and fnet.
1730! ----------------------------------------------------------------------
1731! fnet = fdown - sigma * t24- ssoil
1732 fnet = fdown - emissi*sigma * t24- ssoil
1733 if (frzgra) then
1734 flx2 = - lsubf * prcp
1735 fnet = fnet - flx2
1736! ----------------------------------------------------------------------
1737! finish penman equation calculations.
1738! ----------------------------------------------------------------------
1739 end if
1740 rad = fnet / rch + th2- sfctmp
1741 a = elcp * (q2sat - q2)
1742! a = elcp1 * (q2sat - q2)
1743 epsca = (a * rr + rad * delta) / (delta + rr)
1744 etp = epsca * rch / lsubc
1745! etp = epsca * rch / lvs
1746
1747! ----------------------------------------------------------------------
1748 end subroutine penman
1749
1750 end module noahmpdrv
subroutine penman
This subroutine calculates potential evaporation for the current point. various partial sums/products...
Definition sflx.f:1574
subroutine, public set_soilveg(me, isot, ivet, nlunit, errmsg, errflg)
This subroutine initializes soil and vegetation.
Definition set_soilveg.f:17
subroutine noahmpdrv_run(im, km, lsnowl, itime, ps, u1, v1, t1, q1, soiltyp, soilcol, vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, prsl1, prslk1, prslki, prsik1, zf, pblh, dry, wind, slopetyp, shdmin, shdmax, snoalb, sfalb, flag_iter, con_g, idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_trs, iopt_diag, xlatin, xcoszin, iyrlen, julian, garea, rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, rhonewsn1, con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, con_fvirt, con_rd, con_hfus, thsfc_loc, cpllnd, cpllnd2atm, weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, canopy, trans, tsurf, zorl, rb1, fm1, fh1, ustar1, stress1, fm101, fh21, rmol1, flhc1, flqc1, do_mynnsfclay, snowxy, tvxy, tgxy, canicexy, canliqxy, eahxy, tahxy, cmxy, chxy, fwetxy, sneqvoxy, alboldxy, qsnowxy, wslakexy, zwtxy, waxy, wtxy, tsnoxy, zsnsoxy, snicexy, snliqxy, lfmassxy, rtmassxy, stmassxy, woodxy, stblcpxy, fastcpxy, xlaixy, xsaixy, taussxy, smoiseq, smcwtdxy, deeprechxy, rechxy, albdvis, albdnir, albivis, albinir, emiss, sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc, stm, snohf, smcwlt2, smcref2, wet1, t2mmp, q2mp, zvfun, ztmax, rca, errmsg, errflg, canopy_heat_storage_ccpp, rainfall_ccpp, sw_absorbed_total_ccpp, sw_reflected_total_ccpp, lw_absorbed_total_ccpp, temperature_bare_grd_ccpp, temperature_veg_grd_ccpp, temperature_veg_2m_ccpp, temperature_bare_2m_ccpp, spec_humidity_veg_2m_ccpp, spec_humidity_bare_2m_ccpp, sw_absorbed_veg_ccpp, sw_absorbed_ground_ccpp, snowmelt_out_ccpp, snowmelt_shallow_ccpp, albedo_direct_snow_ccpp, albedo_diffuse_snow_ccpp, ch_vegetated_ccpp, ch_bare_ground_ccpp, sensible_heat_grd_veg_ccpp, sensible_heat_leaf_ccpp, sensible_heat_grd_bar_ccpp, latent_heat_grd_veg_ccpp, latent_heat_grd_bare_ccpp, ground_heat_veg_ccpp, ground_heat_bare_ccpp, lw_absorbed_grd_veg_ccpp, lw_absorbed_leaf_ccpp, lw_absorbed_grd_bare_ccpp, latent_heat_trans_ccpp, latent_heat_leaf_ccpp, ch_leaf_ccpp, ch_below_canopy_ccpp, ch_vegetated_2m_ccpp, ch_bare_ground_2m_ccpp, precip_adv_heat_veg_ccpp, precip_adv_heat_grd_v_ccpp, precip_adv_heat_grd_b_ccpp, spec_humid_sfc_veg_ccpp, spec_humid_sfc_bare_ccpp)
This subroutine is the main CCPP entry point for the NoahMP LSM.
subroutine snowfall(parameters, nsoil, nsnow, dt, qsnow, snowhin, sfctmp, iloc, jloc, isnow, snowh, dzsnso, stc, snice, snliq, sneqv)
snow depth and density to account for the new snowfall. new values of snow depth & density returned.
subroutine noahmp_options(idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs, iopt_diag, iopt_z0m)
subroutine psi_init(psi_opt, errmsg, errflg)
subroutine transfer_mp_parameters(vegtype, soiltype, slopetype, soilcolor, croptype, parameters)
This subroutine fills in a derived data type of type noahmp_parameters with data from the module noah...
subroutine sfcdif4(iloc, jloc, ux, vx, t1d, p1d, psfcpa, pblhx, dx, znt, ep_1, ep_2, cp, itime, snwh, isice, psi_opt, tsk, qx, zlvl, iz0tlnd, qsfc, hfx, qfx, cm, chs, chs2, cqs2, rmolx, ust, rbx, fmx, fhx, stressx, fm10x, fh2x, wspdx, flhcx, flqcx)
subroutine pedotransfer_sr2006(nsoil, sand, clay, orgm, parameters)
This subroutine uses a pedotransfer method to calculate soil properties.
subroutine snow_age(parameters, dt, tg, sneqvo, sneqv, tauss, fage)
subroutine noahmp_sflx(parameters, iloc, jloc, lat, yearlen, julian, cosz, dt, dx, dz8w, nsoil, zsoil, nsnow, shdfac, shdmax, vegtyp, ice, ist, croptype, smceq, sfctmp, sfcprs, psfc, uu, vv, q2, garea1, qc, soldn, lwdn, thsfc_loc, prslkix, prsik1x, prslk1x, pblhx, iz0tlnd, itime,psi_opt, prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, tbot, co2air, o2air, foln, ficeold, zlvl, ep_1, ep_2, epsm1, cp, albold, sneqvo, stc, sh2o, smc, tah, eah, fwet, canliq, canice, tv, tg, qsfc, qsnow, qrain, isnow, zsnso, snowh, sneqv, snice, snliq, zwt, wa, wt, wslake, lfmass, rtmass, stmass, wood, stblcp, fastcp, lai, sai, cm, ch, tauss, grain, gdd, pgs, smcwtd,deeprech, rech, ustarx, z0wrf, z0hwrf, ts, fsa, fsr, fira, fsh, ssoil, fcev, fgev, fctr, ecan, etran, edir, trad, tgb, tgv, t2mv, t2mb, q2v, q2b, runsrf, runsub, apar, psn, sav, sag, fsno, nee, gpp, npp, fveg, albedo, qsnbot, ponding, ponding1, ponding2, rssun, rssha, albd, albi, albsnd, albsni, bgap, wgap, chv, chb, emissi, shg, shc, shb, evg, evb, ghv, ghb, irg, irc, irb, tr, evc, chleaf, chuc, chv2, chb2, fpice, pahv, pahg, pahb, pah, esnow, canhs, laisun, laisha, rb, qsfcveg, qsfcbare ifdef ccpp
subroutine noahmpdrv_init(lsm, lsm_noahmp, me, isot, ivegsrc, nlunit, pores, resid, do_mynnsfclay, do_mynnedmf, errmsg, errflg)
This subroutine is called during the CCPP initialization phase and calls set_soilveg() to initialize ...
Definition noahmpdrv.F90:36
This module contains the interface of noahmp_glacier_routines and noahmp_glacier_globals.
This module contains namelist options for Noah LSM.
brief Data from MPTABLE.TBL, SOILPARM.TBL, GENPARM.TBL for NoahMP
This module contains set_soilveg subroutine.
Definition set_soilveg.f:4