5.13.3-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
mo_mpr_soilmoist.f90
Go to the documentation of this file.
1!> \file mo_mpr_soilmoist.f90
2!> \brief \copybrief mo_mpr_soilmoist
3!> \details \copydetails mo_mpr_soilmoist
4
5!> \brief Multiscale parameter regionalization (MPR) for soil moisture
6!> \details This module contains all routines required for parametrizing soil moisture processes.
7!> \authors Stephan Thober, Rohini Kumar
8!> \date Dec 2012
9!> \copyright Copyright 2005-\today, the mHM Developers, Luis Samaniego, Sabine Attinger: All rights reserved.
10!! mHM is released under the LGPLv3+ license \license_note
11!> \ingroup f_mpr
13
14 use mo_kind, only : i4, dp
15 use mo_message, only : message, error_message
16
17 implicit none
18
19 public :: mpr_sm
20
21 private
22
23contains
24 ! ----------------------------------------------------------------------------
25
26 ! NAME
27 ! mpr_sm
28
29 ! PURPOSE
30 !> \brief multiscale parameter regionalization for soil moisture
31
32 !> \details This subroutine is a wrapper around all soil moisture
33 !> parameter routines. This subroutine requires 13 parameters. These
34 !> parameters have to correspond to the parameters in the original
35 !> parameter array at the following locations: 10-12, 13-18, 27-30.
36 !> Global parameters needed (see mhm_parameter.nml):
37 !> - param( 1) = orgMatterContent_forest
38 !> - param( 2) = orgMatterContent_impervious
39 !> - param( 3) = orgMatterContent_pervious
40 !> - param( 4) = PTF_lower66_5_constant
41 !> - param( 5) = PTF_lower66_5_clay
42 !> - param( 6) = PTF_lower66_5_Db
43 !> - param( 7) = PTF_higher66_5_constant
44 !> - param( 8) = PTF_higher66_5_clay
45 !> - param( 9) = PTF_higher66_5_Db
46 !> - param(10) = PTF_Ks_constant
47 !> - param(11) = PTF_Ks_sand
48 !> - param(12) = PTF_Ks_clay
49 !> - param(13) = PTF_Ks_curveSlope
50
51 ! INTENT(IN)
52 !> \param[in] "real(dp), dimension(13) :: param" global parameters
53 !> \param[in] "integer(i4), dimension(:) :: is_present" indicates whether soiltype is present
54 !> \param[in] "integer(i4), dimension(:) :: nHorizons" Number of Horizons per soiltype
55 !> \param[in] "integer(i4), dimension(:) :: nTillHorizons" Number of Tillage Horizons
56 !> \param[in] "real(dp), dimension(:, :) :: sand" sand content
57 !> \param[in] "real(dp), dimension(:, :) :: clay" clay content
58 !> \param[in] "real(dp), dimension(:, :) :: DbM" mineral Bulk density
59 !> \param[in] "integer(i4), dimension(:) :: ID0" cell ids at level 0
60 !> \param[in] "integer(i4), dimension(:, :) :: soilId0" soil ids at level 0
61 !> \param[in] "integer(i4), dimension(:) :: LCOVER0" land cover ids at level 0
62
63 ! INTENT(OUT)
64 !> \param[out] "real(dp), dimension(:, :, :) :: thetaS_till" saturated soil moisture tillage layer
65 !> \param[out] "real(dp), dimension(:, :, :) :: thetaFC_till" field capacity tillage layer
66 !> \param[out] "real(dp), dimension(:, :, :) :: thetaPW_till" permanent wilting point tillage layer
67 !> \param[out] "real(dp), dimension(:, :) :: thetaS" saturated soil moisture
68 !> \param[out] "real(dp), dimension(:, :) :: thetaFC" field capacity
69 !> \param[out] "real(dp), dimension(:, :) :: thetaPW" permanent wilting point
70 !> \param[out] "real(dp), dimension(:, :, :) :: Ks" saturated hydraulic conductivity
71 !> \param[out] "real(dp), dimension(:, :, :) :: Db" Bulk density
72 !> \param[out] "real(dp), dimension(:) :: KsVar_H0" rel. var. of Ks for horizontal flow
73 !> \param[out] "real(dp), dimension(:) :: KsVar_V0" rel. var. of Ks for vertical flow
74 !> \param[out] "real(dp), dimension(:) :: SMs_FC0" soil mositure deficit from
75 !> field cap. w.r.t to saturation
76
77 ! HISTORY
78 !> \authors Stephan Thober, Rohini Kumar
79
80 !> \date Dec 2012
81
82 ! Modifications:
83 ! Juliane Mai Oct 2013 - OLD parametrization --> param(1) = orgMatterContent_forest
84 ! --> param(2) = orgMatterContent_impervious
85 ! --> param(3) = orgMatterContent_pervious
86 ! --> param(4:13) = ... orgMatterContent_forest = orgMatterContent_perv
87 ! + delta_1 NEW parametrization
88 ! --> param(1) = delta_1 --> param(2) = orgMatterContent_impervious
89 ! --> param(3) = orgMatterContent_pervious --> param(4:13) = ...
90 ! Matthias Zink Nov 2013 - documentation, inouts --> out moved constants to mhm_constants
91 ! Stephan Thober Mar 2014 - separated cell loop from soil loop for better scaling in parallelisation
92 ! David Schaefer Mar 2015 - Added dummy variable to avoid redundant computations
93 ! -> Total number of instruction is reduced by ~25%
94 ! (tested on packaged example/gnu48/{release,debug})
95 ! Rohini Kumar Mar 2016 - changes for handling multiple soil database options
96 ! Robert Schweppe Jun 2018 - refactoring and reformatting
97 ! M. Cuneyd Demirel, Simon Stisen Jun 2020 - added Feddes and FC dependency on root fraction coefficient processCase(3) = 4
98 ! Rohini Kumar Oct 2021 - Neutron count module to mHM integrate into develop branch (5.11.2)
99
100 subroutine mpr_sm(param, processMatrix, is_present, nHorizons, nTillHorizons, sand, clay, DbM, ID0, soilId0, LCover0, &
101 thetaS_till, thetaFC_till, thetaPW_till, thetaS, thetaFC, thetaPW, Ks, Db, KsVar_H0, KsVar_V0, SMs_FC0)
102
106 !$ use omp_lib
107
108 implicit none
109
110 ! global parameters
111 real(dp), dimension(13), intent(in) :: param
112
113 ! - matrix specifying user defined processes
114 integer(i4), dimension(:, :), intent(in) :: processmatrix
115
116
117 ! indicates whether soiltype is present
118 integer(i4), dimension(:), intent(in) :: is_present
119
120 ! Number of Horizons per soiltype
121 integer(i4), dimension(:), intent(in) :: nhorizons
122
123 ! Number of Tillage Horizons
124 integer(i4), dimension(:), intent(in) :: ntillhorizons
125
126 ! sand content
127 real(dp), dimension(:, :), intent(in) :: sand
128
129 ! clay content
130 real(dp), dimension(:, :), intent(in) :: clay
131
132 ! mineral Bulk density
133 real(dp), dimension(:, :), intent(in) :: dbm
134
135 ! cell ids at level 0
136 integer(i4), dimension(:), intent(in) :: id0
137
138 ! soil ids at level 0
139 integer(i4), dimension(:, :), intent(in) :: soilid0
140
141 ! land cover ids at level 0
142 integer(i4), dimension(:), intent(in) :: lcover0
143
144 ! saturated soil moisture tillage layer
145 real(dp), dimension(:, :, :), intent(out) :: thetas_till
146
147 ! field capacity tillage layer
148 real(dp), dimension(:, :, :), intent(out) :: thetafc_till
149
150 ! permanent wilting point tillage layer
151 real(dp), dimension(:, :, :), intent(out) :: thetapw_till
152
153 ! saturated soil moisture
154 real(dp), dimension(:, :), intent(out) :: thetas
155
156 ! field capacity
157 real(dp), dimension(:, :), intent(out) :: thetafc
158
159 ! permanent wilting point
160 real(dp), dimension(:, :), intent(out) :: thetapw
161
162 ! saturated hydraulic conductivity
163 real(dp), dimension(:, :, :), intent(out) :: ks
164
165 ! Bulk density
166 real(dp), dimension(:, :, :), intent(out) :: db
167
168 ! rel. var. of Ks for horizontal flow
169 real(dp), dimension(:), intent(out) :: ksvar_h0
170
171 ! rel. var. of Ks for vertical flow
172 real(dp), dimension(:), intent(out) :: ksvar_v0
173
174 ! soil mositure deficit from
175 ! field cap. w.r.t to saturation
176 real(dp), dimension(:), intent(out) :: sms_fc0
177
178 ! loop index
179 integer(i4) :: i
180
181 ! loop index
182 integer(i4) :: j
183
184 ! loop index
185 integer(i4) :: l
186
187 ! dummy variable for storing soil class
188 integer(i4) :: s
189
190 integer(i4) :: tmp_minsoilhorizon
191
192 real(dp) :: pm
193
194 real(dp) :: pom
195
196 ! temporal saturated hydr. cond
197 real(dp) :: ks_tmp
198
199 ! van Genuchten shape param
200 real(dp) :: genu_mual_n
201
202 ! van Genuchten shape param
203 real(dp) :: genu_mual_alpha
204
205 real(dp) :: tmp_orgmattercontent_forest
206
207 real(dp) :: tmp_orgmattercontent_pervious
208
209 real(dp) :: tmp_orgmattercontent_impervious
210
211 ! total saturated soil mositure content
212 real(dp), dimension(:), allocatable :: sms_tot0
213
214 ! maximum LCover class in L0
215 integer(i4) :: max_lcover
216
217 ! saturated hydraulic conductivity
218 real(dp), dimension(:, :), allocatable :: ks_non_till
219
220 ! Case 1 and 4 is based on Jarvis https://doi.org/10.1016/0022-1694(89)90050-4
221 ! Case 2 and 3 is based on Feddes https://doi.org/10.1016/0022-1694(76)90017-2
222 select case (processmatrix(3, 1))
223 case(1,2)
224 tmp_orgmattercontent_forest = param(3) + param(1)
225 case(3,4)
226 tmp_orgmattercontent_forest = param(1)
227 end select
228
229 tmp_orgmattercontent_impervious = param(2)
230 tmp_orgmattercontent_pervious = param(3)
231 !write(*,*) 'tmp_orgMatterContent_forest = ', tmp_orgMatterContent_forest
232 !write(*,*) 'tmp_orgMatterContent_impervious = ', tmp_orgMatterContent_impervious
233 !write(*,*) 'tmp_orgMatterContent_pervious = ', tmp_orgMatterContent_pervious
234
235 tmp_minsoilhorizon = minval(ntillhorizons(:))
236
237 ! allocatable local variables
238 ! total saturated soil moisture content
239 allocate(sms_tot0(size(id0, 1)))
240
241 ! some additional variables for iFlag_soil = 1
242 if(iflag_soildb .eq. 1) then
243 s = size(is_present, 1)
244 ! note: although second dimension is not required
245 ! we assign value 1 to be comparable to other assigned variables
246 allocate(ks_non_till(s, 1))
247 end if
248
249 ! initializing soil hydraulic properties related params
250 ksvar_h0 = merge(0.0_dp, nodata_dp, id0 .ne. nodata_i4)
251 ksvar_v0 = merge(0.0_dp, nodata_dp, id0 .ne. nodata_i4)
252 sms_tot0 = merge(0.0_dp, nodata_dp, id0 .ne. nodata_i4)
253 sms_fc0 = merge(0.0_dp, nodata_dp, id0 .ne. nodata_i4)
254
255 ! initialization
256 thetas_till = 0.0_dp
257 thetafc_till = 0.0_dp
258 thetapw_till = 0.0_dp
259 thetas = 0.0_dp
260 thetafc = 0.0_dp
261 thetapw = 0.0_dp
262 ks = 0.0_dp
263 db = 0.0_dp
264 if(allocated(ks_non_till)) ks_non_till = 0.0_dp
265 max_lcover = maxval(lcover0)
266 ! select case according to a given soil database flag
267 SELECT CASE(iflag_soildb)
268 ! classical mHM soil database format
269 CASE(0)
270 !$OMP PARALLEL default(shared)
271 !$OMP DO &
272 !$OMP PRIVATE( i, j, L, pOM, pM, Ks_tmp, Genu_Mual_alpha, Genu_Mual_n ) &
273 !$OMP SCHEDULE( STATIC )
274 do i = 1, size(is_present)
275 if (is_present(i) .lt. 1) cycle
276 horizon : do j = 1, nhorizons(i)
277 ! calculating vertical hydraulic conductivity
278 call hydro_cond(ks_tmp, param(10 : 13), sand(i, j), clay(i, j))
279 ks(i, j, :) = ks_tmp
280 ! calculating other soil hydraulic properties
281 ! tillage horizons
282 if (j .le. ntillhorizons(i)) then
283 ! LC class
284 do l = 1, max_lcover
285 select case (l)
286 case(1) ! forest
287 pom = tmp_orgmattercontent_forest
288 case(2) ! impervious
289 pom = tmp_orgmattercontent_impervious !param(2)
290 case(3) ! permeable
291 pom = tmp_orgmattercontent_pervious
292 case default
293 call error_message('Error mpr_sm: pOM used uninitialized.')
294 end select
295 pm = 100.0_dp - pom
296 ! bulk density acording to Rawl's (1982) paper
297 db(i, j, l) = 100.0_dp / ((pom / bulkdens_orgmatter) + (pm / dbm(i, j)))
298 ! Effect of organic matter content
299 ! This is taken into account in a simplified form by using
300 ! the ratio of(Bd / BdOM)
301 ks(i, j, l) = ks(i, j, l) * (dbm(i, j) / db(i, j, l))
302 ! estimated SMs_till & van Genuchten's shape parameter (n)
303 call genuchten(thetas_till(i, j, l), genu_mual_n, genu_mual_alpha, &
304 param(4 : 9), sand(i, j), clay(i, j), db(i, j, l))
305 ! estimating field capacity
306 call field_cap(thetafc_till(i, j, l), ks(i, j, l), thetas_till(i, j, l), genu_mual_n)
307 ! estimating permanent wilting point
308 call pwp(genu_mual_n, genu_mual_alpha, thetas_till(i, j, l), thetapw_till(i, j, l))
309 end do
310 ! deeper layers
311 else
312 ! estimate SMs & van Genuchten's shape parameter (n)
313 call genuchten(thetas(i, j - tmp_minsoilhorizon), genu_mual_n, genu_mual_alpha, &
314 param(4 : 9), sand(i, j), clay(i, j), dbm(i, j))
315 ! estimate field capacity
316 call field_cap(thetafc(i, j - tmp_minsoilhorizon), &
317 ks(i, j, 1), thetas(i, j - tmp_minsoilhorizon), genu_mual_n)
318 ! estimate permanent wilting point
319 call pwp(genu_mual_n, genu_mual_alpha, thetas(i, j - tmp_minsoilhorizon), &
320 thetapw(i, j - tmp_minsoilhorizon))
321 end if
322 end do horizon
323 end do
324 !$OMP END DO
325
326 ! calculate other soil properties at each location [L0] for regionalising model parameters
327 !$OMP DO PRIVATE( s, j ) SCHEDULE( STATIC )
328 cellloop : do i = 1, size(soilid0, 1) ! >> here = ncells0
329 s = soilid0(i, 1) ! >> in this case the second dimension of soilId0 = 1
330 do j = 1, nhorizons(s)
331 if (j .le. ntillhorizons(s)) then
332 ! Soil properties over the whole soil coloum depth
333 ksvar_h0(i) = ksvar_h0(i) + thetas_till(s, j, lcover0(i)) * ks(s, j, lcover0(i))
334 ksvar_v0(i) = ksvar_v0(i) + thetas_till(s, j, lcover0(i)) / ks(s, j, lcover0(i))
335 sms_fc0(i) = sms_fc0(i) + thetafc_till(s, j, lcover0(i))
336 sms_tot0(i) = sms_tot0(i) + thetas_till(s, j, lcover0(i))
337 else
338 ! soil_properties over the whole soil column
339 ksvar_h0(i) = ksvar_h0(i) + thetas(s, j - tmp_minsoilhorizon) * ks(s, j, 1)
340 ksvar_v0(i) = ksvar_v0(i) + thetas(s, j - tmp_minsoilhorizon) / ks(s, j, 1)
341 sms_fc0(i) = sms_fc0(i) + thetafc(s, j - tmp_minsoilhorizon)
342 sms_tot0(i) = sms_tot0(i) + thetas(s, j - tmp_minsoilhorizon)
343 end if
344 end do
345 ! ------------------------------------------------------------------
346 ! DETERMINE RELATIVE VARIABILITIES OF
347 ! Ks FOR HORIZONTAL FLOW (KsVar_H)
348 ! &
349 ! Ks FOR VERTICAL FLOW (KsVar_V)
350 ! ------------------------------------------------------------------
351 ! soil moisture saturation deficit relative to the field capacity soil moisture
352 sms_fc0(i) = (sms_tot0(i) - sms_fc0(i)) / sms_tot0(i)
353 ! Ks variability over the whole soil coloum depth for
354 ! both horizontal and vertical flows including relative variabilities
355 ksvar_h0(i) = ksvar_h0(i) / sms_tot0(i) / param(13)
356 ksvar_v0(i) = sms_tot0(i) / ksvar_v0(i) / param(13)
357 end do cellloop
358 !$OMP END DO
359 !$OMP END PARALLEL
360
361 ! to handle multiple soil horizons with unique soil class
362 CASE(1)
363 do i = 1, size(is_present)
364 if (is_present(i) .lt. 1) cycle
365 ! **** FOR THE TILLAGE TYPE OF SOIL *****
366 ! there is actually no soil horizons/soil type in this case
367 ! but we assign of j = 1 to use variables as defined in the classical option (iFlag_soil = 0)
368 do j = 1, 1
369 ! calculating vertical hydraulic conductivity
370 call hydro_cond(ks_tmp, param(10 : 13), sand(i, j), clay(i, j))
371 ks_non_till(i, j) = ks_tmp ! >> non-till
372 ks(i, j, :) = ks_tmp ! >> till layers
373 ! calculating other soil hydraulic properties
374 ! tillage horizons properties depending on the LC class
375 do l = 1, max_lcover
376 select case (l)
377 case(1) ! forest
378 pom = tmp_orgmattercontent_forest
379 case(2) ! impervious
380 pom = tmp_orgmattercontent_impervious !param(2)
381 case(3) ! permeable
382 pom = tmp_orgmattercontent_pervious
383 case default
384 call error_message('Error mpr_sm: pOM used is not initialized.')
385 end select
386 pm = 100.0_dp - pom
387 ! bulk density acording to Rawl's (1982) paper
388 db(i, j, l) = 100.0_dp / ((pom / bulkdens_orgmatter) + (pm / dbm(i, j)))
389 ! Effect of organic matter content on Ks estimates
390 ! This is taken into account in a simplified form by using
391 ! the ratio of (Bd/BdOM)
392 ks_tmp = ks_tmp * (dbm(i, j) / db(i, j, l))
393 ks(i, j, l) = ks_tmp
394 ! estimated SMs_till & van Genuchten's shape parameter (n)
395 call genuchten(thetas_till(i, j, l), genu_mual_n, genu_mual_alpha, &
396 param(4 : 9), sand(i, j), clay(i, j), db(i, j, l))
397 ! estimating field capacity
398 call field_cap(thetafc_till(i, j, l), ks_tmp, thetas_till(i, j, l), genu_mual_n)
399 ! estimating permanent wilting point
400 call pwp(genu_mual_n, genu_mual_alpha, thetas_till(i, j, l), thetapw_till(i, j, l))
401 end do
402
403 ! *** FOR NON-TILLAGE TYPE OF SOILS ***
404 ! note j = 1
405 ! since Ks_tmp has changed earlier ... get the original Ks once again
406 ks_tmp = ks_non_till(i, j)
407 ! estimate SMs & van Genuchten's shape parameter (n)
408 call genuchten(thetas(i, j), genu_mual_n, genu_mual_alpha, param(4 : 9), sand(i, j), clay(i, j), dbm(i, j))
409 ! estimate field capacity
410 call field_cap(thetafc(i, j), ks_tmp, thetas(i, j), genu_mual_n)
411 ! estimate permanent wilting point
412 call pwp(genu_mual_n, genu_mual_alpha, thetas(i, j), thetapw(i, j))
413
414 end do ! >> HORIZON
415 end do ! >> SOIL TYPE
416
417 ! calculate other soil properties at each location [L0] for regionalising model parameters
418 do i = 1, size(soilid0, 1) !! over all cells
419 do j = 1, size(soilid0, 2) !! over horizons
420 s = soilid0(i, j)
421 if (j .le. ntillhorizons(1)) then
422 ! soil properties over the whole soil coloum depth
423 ksvar_h0(i) = ksvar_h0(i) + thetas_till(s, 1, lcover0(i)) * ks(s, 1, lcover0(i))
424 ksvar_v0(i) = ksvar_v0(i) + thetas_till(s, 1, lcover0(i)) / ks(s, 1, lcover0(i))
425 sms_fc0(i) = sms_fc0(i) + thetafc_till(s, 1, lcover0(i))
426 sms_tot0(i) = sms_tot0(i) + thetas_till(s, 1, lcover0(i))
427 else
428 ! soil_properties over the whole soil column
429 ksvar_h0(i) = ksvar_h0(i) + thetas(s, 1) * ks_non_till(s, 1)
430 ksvar_v0(i) = ksvar_v0(i) + thetas(s, 1) / ks_non_till(s, 1)
431 sms_fc0(i) = sms_fc0(i) + thetafc(s, 1)
432 sms_tot0(i) = sms_tot0(i) + thetas(s, 1)
433 end if
434 end do
435 ! ------------------------------------------------------------------
436 ! DETERMINE RELATIVE VARIABILITIES OF
437 ! Ks FOR HORIZONTAL FLOW (KsVar_H) & Ks FOR VERTICAL FLOW (KsVar_V)
438 ! ------------------------------------------------------------------
439 ! soil moisture saturation deficit relative to the field capacity soil moisture
440 sms_fc0(i) = (sms_tot0(i) - sms_fc0(i)) / sms_tot0(i)
441 ! Ks variability over the whole soil coloum depth for
442 ! both horizontal and vertical flows including relative variabilities
443 ksvar_h0(i) = ksvar_h0(i) / sms_tot0(i) / param(13)
444 ksvar_v0(i) = sms_tot0(i) / ksvar_v0(i) / param(13)
445 end do
446
447 CASE DEFAULT
448 call error_message('***ERROR: iFlag_soilDB option given does not exist. Only 0 and 1 is taken at the moment.')
449 END SELECT
450
451 ! free space **
452 deallocate(sms_tot0)
453 if(allocated(ks_non_till)) deallocate(ks_non_till)
454
455 end subroutine mpr_sm
456
457 ! ------------------------------------------------------------------
458
459 ! NAME
460 ! PWP
461
462 ! PURPOSE
463 !> \brief Permanent Wilting point
464
465 !> \details This subroutine calculates the permanent wilting
466 !> point according to Zacharias et al. (2007, Soil Phy.) and
467 !> using van Genuchten 1980's equation. For the water retention curve at
468 !> a matrix potential of -1500 kPa, it is assumed that thetaR = 0.
469 !> ADDITIONAL INFORMATION
470 !> Zacharias et al. 2007, Soil Phy.
471
472 ! INTENT(IN)
473 !> \param[in] "real(dp) :: Genu_Mual_n" - Genuchten shape parameter
474 !> \param[in] "real(dp) :: Genu_Mual_alpha" - Genuchten shape parameter
475 !> \param[in] "real(dp) :: thetaS" - saturated water content
476
477 ! INTENT(OUT)
478 !> \param[out] "real(dp) :: thetaPWP" - Permanent Wilting point
479
480 ! HISTORY
481 !> \authors Stephan Thober, Rohini Kumar
482
483 !> \date Dec, 2012
484
485 ! Modifications:
486 ! Matthias Zink Nov 2013 - documentation, moved constants to mhm_constants
487 ! Robert Schweppe Jun 2018 - refactoring and reformatting
488
489 elemental pure subroutine pwp(Genu_Mual_n, Genu_Mual_alpha, thetaS, thetaPWP)
490
492
493 implicit none
494
495 ! - Genuchten shape parameter
496 real(dp), intent(in) :: genu_mual_n
497
498 ! - Genuchten shape parameter
499 real(dp), intent(in) :: genu_mual_alpha
500
501 ! - saturated water content
502 real(dp), intent(in) :: thetas
503
504 ! - Permanent Wilting point
505 real(dp), intent(out) :: thetapwp
506
507 real(dp) :: x
508
509 ! Genuchten shape parameter
510 real(dp) :: genu_mual_m
511
512
513 genu_mual_m = pwp_c - (pwp_c / genu_mual_n)
514 x = pwp_c + exp(genu_mual_n * log(genu_mual_alpha * pwp_matpot_thetar))
515 x = exp(genu_mual_m * log(x))
516 ! constrain
517 if (x < 1.0_dp) x = 1.0_dp
518 thetapwp = thetas / x
519
520 end subroutine pwp
521
522 ! ----------------------------------------------------------------------------
523
524 ! NAME
525 ! field_cap
526
527 ! PURPOSE
528 !> \brief calculates the field capacity
529
530 !> \details estimate Field capacity; FC -- Flux based
531 !> approach (Twarakavi, et. al. 2009, WRR)
532 !> According to the
533 !> above reference FC is defined as the soil water content at
534 !> which the drainage from a profile ceases under natural
535 !> conditions. Since drainage from a soil profile in a simulation
536 !> never becomes zero, we assume that drainage ceases when the
537 !> bottom flux from the soil reaches a value that is equivalent to
538 !> the minimum amount of precipitation that could be recorded
539 !> (i.e. 0.01 cm/d == 1 mm/d). It is assumed that ThetaR = 0.0_dp
540 !> ADDITIONAL INFORMATION
541 !> Twarakavi, et. al. 2009, WRR
542
543 ! INTENT(OUT)
544 !> \param[out] "real(dp) :: thetaFC" - Field capacity
545
546 ! INTENT(IN)
547 !> \param[in] "real(dp) :: Ks" - saturated hydraulic conductivity
548 !> \param[in] "real(dp) :: thetaS" - saturated water content
549 !> \param[in] "real(dp) :: Genu_Mual_n" - Genuchten shape parameter
550
551 ! HISTORY
552 !> \authors Stephan Thober, Rohini Kumar
553
554 !> \date Dec 2012
555
556 ! Modifications:
557 ! Matthias Zink Nov 2013 - documentation, moved constants to mhm_constants
558 ! Robert Schweppe Jun 2018 - refactoring and reformatting
559
560 elemental pure subroutine field_cap(thetaFC, Ks, thetaS, Genu_Mual_n)
561
563
564 implicit none
565
566 ! - saturated hydraulic conductivity
567 real(dp), intent(in) :: ks
568
569 ! - saturated water content
570 real(dp), intent(in) :: thetas
571
572 ! - Genuchten shape parameter
573 real(dp), intent(in) :: genu_mual_n
574
575 ! - Field capacity
576 real(dp), intent(out) :: thetafc
577
578 real(dp) :: x
579
580
581 x = (field_cap_c1) * (field_cap_c2 + log10(ks))
582 thetafc = thetas * exp(x * log(genu_mual_n))
583
584 end subroutine field_cap
585
586 ! ----------------------------------------------------------------------------
587
588 ! NAME
589 ! Genuchten
590
591 ! PURPOSE
592 !> \brief calculates the Genuchten shape parameter
593
594 !> \details estimate SMs_till & van Genuchten's shape parameter (n)
595 !> (Zacharias et al, 2007, soil Phy.)
596 !> Global parameters needed (see mhm_parameter.nml):
597 !> - param( 1) = PTF_lower66_5_constant
598 !> - param( 2) = PTF_lower66_5_clay
599 !> - param( 3) = PTF_lower66_5_Db
600 !> - param( 4) = PTF_higher66_5_constant
601 !> - param( 5) = PTF_higher66_5_clay
602 !> - param( 6) = PTF_higher66_5_Db
603 !> ADDITIONAL INFORMATION
604 !> Zacharias et al, 2007, soil Phy.
605
606 ! INTENT(OUT)
607 !> \param[out] "real(dp) :: thetaS" - saturated water content
608 !> \param[out] "real(dp) :: Genu_Mual_n" - van Genuchten shape parameter
609 !> \param[out] "real(dp) :: Genu_Mual_alpha" - van Genuchten shape parameter
610
611 ! INTENT(IN)
612 !> \param[in] "real(dp), dimension(6) :: param" parameters
613 !> \param[in] "real(dp) :: sand" - [%] sand content
614 !> \param[in] "real(dp) :: clay" - [%] clay content
615 !> \param[in] "real(dp) :: Db" - [10^3 kg/m3] bulk density
616
617 ! HISTORY
618 !> \authors Stephan Thober, Rohini Kumar
619
620 !> \date Dec 2012
621
622 ! Modifications:
623 ! Rohini Kumar Mar 2014 - ThetaS limit changed from 0 to 0.001
624 ! Robert Schweppe Jun 2018 - refactoring and reformatting
625
626 subroutine genuchten(thetaS, Genu_Mual_n, Genu_Mual_alpha, param, sand, clay, Db)
627
632
633 implicit none
634
635 ! parameters
636 real(dp), dimension(6), intent(in) :: param
637
638 ! - [%] sand content
639 real(dp), intent(in) :: sand
640
641 ! - [%] clay content
642 real(dp), intent(in) :: clay
643
644 ! - [10^3 kg/m3] bulk density
645 real(dp), intent(in) :: Db
646
647 ! - saturated water content
648 real(dp), intent(out) :: thetaS
649
650 ! - van Genuchten shape parameter
651 real(dp), intent(out) :: Genu_Mual_n
652
653 ! - van Genuchten shape parameter
654 real(dp), intent(out) :: Genu_Mual_alpha
655
656 ! temporal variable
657 real(dp) :: x
658
659
660 ! estimate SMs_till & van Genuchten's parameters (alpha and n)
661 if (sand < vgenuchten_sandtresh) then
662 thetas = param(1) + param(2) * clay + param(3) * db
663 genu_mual_n = vgenuchtenn_c1 - vgenuchtenn_c2 * (sand**(vgenuchtenn_c3)) + &
665 x = vgenuchtenn_c6 + vgenuchtenn_c7 * sand + vgenuchtenn_c8 * clay - &
666 vgenuchtenn_c9 * db
667 else
668 thetas = param(4) + param(5) * clay + param(6) * db
669 genu_mual_n = vgenuchtenn_c10 + vgenuchtenn_c11 * (sand**(vgenuchtenn_c12)) + &
671 x = vgenuchtenn_c15 + vgenuchtenn_c16 * sand + vgenuchtenn_c17 * clay - &
672 vgenuchtenn_c18 * db
673 end if
674
675 ! Mualem alpha
676 genu_mual_alpha = exp(x)
677
678 ! hard coded limits, according to (Zacharias et al, 2007, soil Phy.)
679 if (thetas < 0.01_dp) then
680 call message('thetaS below threshold limit 1e-2, reset.')
681 ! Put constrains on theta_S
682 thetas = 0.01_dp
683 end if
684 if (thetas > 1.0_dp) then
685 call message('thetaS above 1, reset.')
686 ! Put constrains on theta_S
687 thetas = 1.0_dp
688 end if
689 if (genu_mual_n < 1.01000_dp) then
690 call message('Genu_Mual_n below threshold limit 1.01, reset.')
691 genu_mual_n = 1.01000_dp
692 end if
693 if (genu_mual_alpha < 0.00001_dp) then
694 call message('Genu_Mual_alpha below threshold limit 1e-5, reset.')
695 genu_mual_alpha = 0.00001_dp
696 end if
697
698 end subroutine genuchten
699
700 ! ----------------------------------------------------------------------------
701
702 ! NAME
703 ! hydro_cond
704
705 ! PURPOSE
706 !> \brief calculates the hydraulic conductivity Ks
707
708 !> \details By default save this value of Ks, particularly for the
709 !> deeper layers where OM content plays relatively low or no role
710 !> Global parameters needed (see mhm_parameter.nml):
711 !> - param(1) = PTF_Ks_constant
712 !> - param(2) = PTF_Ks_sand
713 !> - param(3) = PTF_Ks_clay
714 !> - param(4) = PTF_Ks_curveSlope
715 !> ADDITIONAL INFORMATION
716 !> Written, Stephan Thober, Dec 2012
717
718 ! INTENT(OUT)
719 !> \param[out] "real(dp) :: KS"
720
721 ! INTENT(IN)
722 !> \param[in] "real(dp), dimension(4) :: param"
723 !> \param[in] "real(dp) :: sand" - [%] sand content
724 !> \param[in] "real(dp) :: clay" - [%] clay content
725
726 ! HISTORY
727 !> \authors Stephan Thober, Rohini Kumar
728
729 !> \date Dec 2012
730
731 ! Modifications:
732 ! Matthias Zink Nov 2013 - documentation, moved constants to mhm_constants
733 ! Matthias Cuntz Jun 2014 - suggested to fix param(4)
734 ! Robert Schweppe Jun 2018 - refactoring and reformatting
735
736 subroutine hydro_cond(KS, param, sand, clay)
737
738 use mo_mpr_constants, only : ks_c
739
740 implicit none
741
742 real(dp), dimension(4), intent(in) :: param
743
744 ! - [%] sand content
745 real(dp), intent(in) :: sand
746
747 ! - [%] clay content
748 real(dp), intent(in) :: clay
749
750 real(dp), intent(out) :: KS
751
752 ! temporal variable
753 real(dp) :: x
754
755
756 ! saturated vertical hydraulic conductivity, Ks (cm/d)
757 ! from Cosby et. al. (WRR 1984) Table 4
758 ! param(4) is the unit conversion from inch/h to cm/d and should be a constant.
759 ! Fix it in the namelist, i.e. in
760 ! mhm_parameter.nml set the 4th value (=FLAG) to 0 and the third value to 60.96
761 ! PTF_Ks_curveSlope = 60.96, 60.96, 60.96, 0, 1
762 x = param(1) + param(2) * sand - param(3) * clay
763 ks = param(4) * exp(x * log(ks_c))
764
765 if (ks < 1.10_dp) then
766 call message('JMJMJM-Ks-BAD')
767 end if
768
769 ! minimum value of Ks = 1.1cm/d
770 if (ks < 1.10_dp) ks = 1.10_dp
771
772 end subroutine hydro_cond
773
774end module mo_mpr_soilmoist
Provides constants commonly used by mHM, mRM and MPR.
real(dp), parameter, public nodata_dp
integer(i4), parameter, public nodata_i4
Provides MPR specific constants.
real(dp), parameter, public vgenuchtenn_c15
real(dp), parameter, public vgenuchtenn_c9
real(dp), parameter, public vgenuchtenn_c3
real(dp), parameter, public vgenuchtenn_c4
real(dp), parameter, public bulkdens_orgmatter
real(dp), parameter, public vgenuchtenn_c1
real(dp), parameter, public vgenuchtenn_c5
real(dp), parameter, public field_cap_c2
real(dp), parameter, public vgenuchtenn_c2
real(dp), parameter, public vgenuchtenn_c13
real(dp), parameter, public vgenuchten_sandtresh
real(dp), parameter, public vgenuchtenn_c17
real(dp), parameter, public vgenuchtenn_c10
real(dp), parameter, public pwp_c
real(dp), parameter, public vgenuchtenn_c18
real(dp), parameter, public vgenuchtenn_c11
real(dp), parameter, public field_cap_c1
real(dp), parameter, public vgenuchtenn_c12
real(dp), parameter, public vgenuchtenn_c7
real(dp), parameter, public vgenuchtenn_c14
real(dp), parameter, public vgenuchtenn_c8
real(dp), parameter, public pwp_matpot_thetar
real(dp), parameter, public vgenuchtenn_c16
real(dp), parameter, public ks_c
real(dp), parameter, public vgenuchtenn_c6
Global variables for mpr only.
Multiscale parameter regionalization (MPR) for soil moisture.
elemental pure subroutine pwp(genu_mual_n, genu_mual_alpha, thetas, thetapwp)
Permanent Wilting point.
subroutine hydro_cond(ks, param, sand, clay)
calculates the hydraulic conductivity Ks
subroutine, public mpr_sm(param, processmatrix, is_present, nhorizons, ntillhorizons, sand, clay, dbm, id0, soilid0, lcover0, thetas_till, thetafc_till, thetapw_till, thetas, thetafc, thetapw, ks, db, ksvar_h0, ksvar_v0, sms_fc0)
multiscale parameter regionalization for soil moisture
elemental pure subroutine field_cap(thetafc, ks, thetas, genu_mual_n)
calculates the field capacity
subroutine genuchten(thetas, genu_mual_n, genu_mual_alpha, param, sand, clay, db)
calculates the Genuchten shape parameter