5.13.2-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
mo_init_states.f90
Go to the documentation of this file.
1!> \file mo_init_states.f90
2!> \brief \copybrief mo_init_states
3!> \details \copydetails mo_init_states
4
5!> \brief Initialization of all state variables of mHM.
6!> \details This module initializes all state variables required to run mHM.
7!!
8!! Two options are provided:
9!! - (1) default values
10!! - (2) from nc file
11!> \authors Luis Samaniego & Rohini Kumar
12!> \date Dec 2012
13!> \copyright Copyright 2005-\today, the mHM Developers, Luis Samaniego, Sabine Attinger: All rights reserved.
14!! mHM is released under the LGPLv3+ license \license_note
15!> \ingroup f_mhm
17
18 USE mo_kind, ONLY : i4, dp
19
20 IMPLICIT NONE
21
22 PRIVATE
23
24 PUBLIC :: variables_alloc ! allocation of space for state variables/fluxes/effective parameters
25 PUBLIC :: variables_default_init ! initialization for state variables/fluxes/effective parameters
26 PUBLIC :: fluxes_states_default_init ! initialization for state/fluxes variables
27
28CONTAINS
29
30
31 !> \brief Allocation of space for mHM related L1 and L11 variables.
32 !> \details Allocation of space for mHM related L1 and L11 variables (e.g., states,
33 !! fluxes, and parameters) for a given domain. Variables allocated here is
34 !! defined in them mo_global_variables.f90 file. After allocating any variable
35 !! in this routine, initalize them in the following variables_default_init subroutine.
36 !> \changelog
37 !! - R. Kumar Sep 2013
38 !! - documentation added according to the template
39 !! - S. Thober Aug 2015
40 !! - removed routing related variables
41 !! - Zink M. Demirel C. Mar 2017
42 !! - Init Jarvis soil water stress variable at SM process(3)
43 !! - Robert Schweppe Dec 2017
44 !! - restructured allocation in variables_alloc, expanded dimensions of effective parameters
45 !! - Robert Schweppe Jun 2018
46 !! - refactoring and reformatting
47 !> \authors Rohini Kumar
48 !> \date Jan 2013
49 subroutine variables_alloc(ncells1)
50
51 use mo_append, only : append
61
62 implicit none
63
64 integer(i4), intent(in) :: ncells1 !< number of level-1 cells
65
66 integer(i4) :: i
67
68 real(dp), dimension(:), allocatable :: dummy_1d
69
70 real(dp), dimension(:, :), allocatable :: dummy_2d
71
72
73 ! for appending and intialization
74 allocate(dummy_1d(ncells1))
75 allocate(dummy_2d(ncells1, nsoilhorizons_mhm))
76
77 dummy_1d = p1_initstatefluxes
78 dummy_2d = p1_initstatefluxes
79
80 !-------------------------------------------
81 ! FLUXES
82 !-------------------------------------------
83 ! calculated / corrected potential evapotranspiration
84 call append(l1_pet_calc, dummy_1d)
85 ! temperature for current time step
86 call append(l1_temp_calc, dummy_1d)
87 ! precipitation for current time step
88 call append(l1_prec_calc, dummy_1d)
89 ! soil actual ET
90 call append(l1_aetsoil, dummy_2d)
91 ! canopy actual ET
92 call append(l1_aetcanopy, dummy_1d)
93 ! sealed area actual ET
94 call append(l1_aetsealed, dummy_1d)
95 ! baseflow
96 call append(l1_baseflow, dummy_1d)
97 ! soil in-exfiltration
98 call append(l1_infilsoil, dummy_2d)
99 ! fast runoff
100 call append(l1_fastrunoff, dummy_1d)
101 ! snow melt
102 call append(l1_melt, dummy_1d)
103 ! percolation
104 call append(l1_percol, dummy_1d)
105 ! effective precip. depth (snow melt + rain)
106 call append(l1_preeffect, dummy_1d)
107 ! rain (liquid water)
108 call append(l1_rain, dummy_1d)
109 ! runoff from impervious area
110 call append(l1_runoffseal, dummy_1d)
111 ! slow runoff
112 call append(l1_slowrunoff, dummy_1d)
113 ! snow (solid water)
114 call append(l1_snow, dummy_1d)
115 ! throughfall
116 call append(l1_throughfall, dummy_1d)
117 ! throughfall
118 call append(l1_total_runoff, dummy_1d)
119
120 !-------------------------------------------
121 ! STATE VARIABLES
122 !-------------------------------------------
123 ! Interception
124 call append(l1_inter, dummy_1d)
125 !Retention storage of impervious areas
126 call append(l1_sealstw, dummy_1d)
127 ! ground albedo neutrons
128 call append(l1_neutrons, dummy_1d)
129 !Snowpack
130 dummy_1d = p2_initstatefluxes
131 call append(l1_snowpack, dummy_1d)
132 ! upper soil storage
133 dummy_1d = p3_initstatefluxes
134 call append(l1_unsatstw, dummy_1d)
135 ! groundwater storage
136 dummy_1d = p4_initstatefluxes
137 call append(l1_satstw, dummy_1d)
138 ! Soil moisture of each horizon
139 do i = 1, nsoilhorizons_mhm - 1
140 if (i == 1) then
141 dummy_2d(:, i) = horizondepth_mhm(i) * c1_initstatesm
142 else
143 dummy_2d(:, i) = (horizondepth_mhm(i) - horizondepth_mhm(i - 1)) * c1_initstatesm
144 end if
145 end do
146 dummy_2d(:, nsoilhorizons_mhm) = (p5_initstatefluxes - &
148 call append(l1_soilmoist, dummy_2d)
149
150 ! free space
151 if (allocated(dummy_1d)) deallocate(dummy_1d)
152 if (allocated(dummy_2d)) deallocate(dummy_2d)
153
154 end subroutine variables_alloc
155
156
157 !> \brief Default initalization mHM related L1 variables
158 !> \details Default initalization of mHM related L1 variables (e.g., states,
159 !! fluxes, and parameters) as per given constant values given in mo_mhm_constants.
160 !! Variables initalized here is defined in the mo_global_variables.f90 file.
161 !! Only Variables that are defined in the variables_alloc subroutine are
162 !! intialized here.
163 !! If a variable is added or removed here, then it also has to be added or removed
164 !! in the subroutine state_variables_set in the module mo_restart and in the
165 !! subroutine set_state in the module mo_set_netcdf_restart.
166 !> \changelog
167 !! - R. Kumar Sep 2013
168 !! - documentation added according to the template
169 !! - Stephan Thober Aug 2015
170 !! - moved routing variables to mRM
171 !! - Robert Schweppe Jun 2018
172 !! - refactoring and reformatting
173 !! - Sebastian Müller Mar 2023
174 !! - added separate fluxes_states_default_init
175 !> \authors R. Kumar & J. Mai
176 !> \date Sep 2013
178
187
188 implicit none
189
190 ! init fluxes and states
192
193 !-------------------------------------------
194 ! EFFECTIVE PARAMETERS
195 !-------------------------------------------
196
197 ! sealed fraction of LCover
199 ! exponent for the upper reservoir
201 ! increase of the Degree-day factor per mm of increase in precipitation
203 ! maximum degree-day factor
205 ! degree-day factor with no precipitation
207 ! degree-day factor
209 ! Karstic percolation loss
211 ! PET correction factor due to LAI
213 ! PET correction factor due to terrain aspect
215 ! PET Hargreaves Samani Coefficient
217 ! PET Priestley Taylor coefficient
219 ! PET aerodynamical resistance
221 ! PET bulk surface resistance
223 ! Fraction of roots in soil horizons
225 ! Maximum interception
227 ! fast interflow recession coefficient
229 ! slow interflow recession coefficient
231 ! baseflow recession coefficient
233 ! percolation coefficient
235 ! Soil moisture below which actual ET is reduced linearly till PWP
237 ! Saturation soil moisture for each horizon [mm]
239 ! Exponential parameter to how non-linear is the soil water retention
241 ! jarvis critical value for normalized soil water content
243 ! Threshold temperature for snow/rain
245 ! Threshhold water depth controlling fast interflow
247 ! Threshhold water depth for surface runoff in sealed surfaces
249 ! Permanent wilting point
251
252 end subroutine variables_default_init
253
254
255 !> \brief initialize fluxes and states with default values
256 !> \authors Sebastian Müller
257 !> \date Mar 2023
259
270
271 implicit none
272
273 integer(i4) :: i
274
275 !-------------------------------------------
276 ! STATE VARIABLES
277 !-------------------------------------------
278
279 ! Interception
281 !Snowpack
283 !Retention storage of impervious areas
285
286 ! Soil moisture of each horizon
287 do i = 1, nsoilhorizons_mhm - 1
288 if (i .eq. 1) then
290 else
292 end if
293 end do
296
297 ! upper soil storage
299 ! groundwater storage
301 ! ground albedo neutrons, initially zero
303
304 !-------------------------------------------
305 ! FLUXES
306 !-------------------------------------------
307
308 ! corrected / calculated potential ET
310 ! temperature for current time step
312 ! precipitation for current time step
314 ! soil actual ET
316 ! canopy actual ET
318 ! sealed area actual ET
320 ! baseflow
322 ! soil in-exfiltration
324 ! fast runoff
326 ! snow melt
328 ! percolation
330 ! effective precip. depth (snow melt + rain)
332 ! rain (liquid water)
334 ! runoff from impervious area
336 ! slow runoff
338 ! snow (solid water)
340 ! throughfall
342 ! total runoff
344
345 end subroutine fluxes_states_default_init
346
347END MODULE mo_init_states
Provides constants commonly used by mHM, mRM and MPR.
real(dp), parameter, public p1_initstatefluxes
Main global variables for mHM.
real(dp), dimension(:), allocatable, public l1_slowrunoff
[mm TS-1] Slow runoff component
real(dp), dimension(:, :), allocatable, public l1_aetsoil
[mm TS-1] Actual ET from soil layers
real(dp), dimension(:), allocatable, public l1_rain
[mm TS-1] Rain precipitation depth
real(dp), dimension(:), allocatable, public l1_aetsealed
[mm TS-1] Real evap.
real(dp), dimension(:), allocatable, public l1_satstw
[mm] groundwater storage
real(dp), dimension(:), allocatable, public l1_aetcanopy
[mm TS-1] Real evaporation intensity from canopy
real(dp), dimension(:), allocatable, public l1_snow
[mm TS-1] Snow precipitation depth
real(dp), dimension(:), allocatable, public l1_preeffect
[mm TS-1] Effective precip.
real(dp), dimension(:), allocatable, public l1_inter
[mm] Interception
real(dp), dimension(:), allocatable, public l1_sealstw
[mm] Retention storage of impervious areas
real(dp), dimension(:), allocatable, public l1_percol
[mm TS-1] Percolation.
real(dp), dimension(:, :), allocatable, public l1_soilmoist
[mm] Soil moisture of each horizon
real(dp), dimension(:), allocatable, public l1_pet_calc
[mm TS-1] estimated/corrected potential evapotranspiration
real(dp), dimension(:), allocatable, public l1_unsatstw
[mm] upper soil storage
real(dp), dimension(:), allocatable, public l1_melt
[mm TS-1] Melting snow depth.
real(dp), dimension(:), allocatable, public l1_fastrunoff
[mm TS-1] Fast runoff component
real(dp), dimension(:), allocatable, public l1_snowpack
[mm] Snowpack
real(dp), dimension(:), allocatable, public l1_neutrons
[mm] Ground Albedo Neutrons
real(dp), dimension(:), allocatable, public l1_prec_calc
[mm TS-1] precipitation for current time step
real(dp), dimension(:), allocatable, public l1_runoffseal
[mm TS-1] Direct runoff from impervious areas
real(dp), dimension(:, :), allocatable, public l1_infilsoil
[mm TS-1] Infiltration intensity each soil horizon
real(dp), dimension(:), allocatable, public l1_baseflow
[mm TS-1] Baseflow
real(dp), dimension(:), allocatable, public l1_throughfall
[mm TS-1] Throughfall.
real(dp), dimension(:), allocatable, public l1_temp_calc
[degC] temperature for current time step
real(dp), dimension(:), allocatable, public l1_total_runoff
[m3 TS-1] Generated runoff
Initialization of all state variables of mHM.
subroutine, public variables_default_init
Default initalization mHM related L1 variables.
subroutine, public variables_alloc(ncells1)
Allocation of space for mHM related L1 and L11 variables.
subroutine, public fluxes_states_default_init
initialize fluxes and states with default values
Provides MPR specific constants.
real(dp), parameter, public p2_initstatefluxes
real(dp), parameter, public p5_initstatefluxes
real(dp), parameter, public p4_initstatefluxes
real(dp), parameter, public c1_initstatesm
real(dp), parameter, public p3_initstatefluxes
Global variables for mpr only.
real(dp), dimension(:, :, :), allocatable, public l1_degday
real(dp), dimension(:, :, :), allocatable, public l1_degdaymax
real(dp), dimension(:, :, :), allocatable, public l1_soilmoistexp
real(dp), dimension(:, :, :), allocatable, public l1_harsamcoeff
real(dp), dimension(:, :, :), allocatable, public l1_karstloss
real(dp), dimension(:, :, :), allocatable, public l1_unsatthresh
real(dp), dimension(:, :, :), allocatable, public l1_kperco
real(dp), dimension(:, :, :), allocatable, public l1_alpha
real(dp), dimension(:, :, :), allocatable, public l1_surfresist
real(dp), dimension(:, :, :), allocatable, public l1_degdayinc
real(dp), dimension(:, :, :), allocatable, public l1_petlaicorfactor
real(dp), dimension(:, :, :), allocatable, public l1_fasp
real(dp), dimension(:, :, :), allocatable, public l1_kbaseflow
real(dp), dimension(:, :, :), allocatable, public l1_soilmoistfc
integer(i4), public nsoilhorizons_mhm
real(dp), dimension(:, :, :), allocatable, public l1_maxinter
real(dp), dimension(:, :, :), allocatable, public l1_degdaynopre
real(dp), dimension(:, :, :), allocatable, public l1_wiltingpoint
real(dp), dimension(:, :, :), allocatable, public l1_prietayalpha
real(dp), dimension(:, :, :), allocatable, public l1_fsealed
real(dp), dimension(:, :, :), allocatable, public l1_froots
real(dp), dimension(:, :, :), allocatable, public l1_jarvis_thresh_c1
real(dp), dimension(:, :, :), allocatable, public l1_tempthresh
real(dp), dimension(:), allocatable, public horizondepth_mhm
real(dp), dimension(:, :, :), allocatable, public l1_kfastflow
real(dp), dimension(:, :, :), allocatable, public l1_kslowflow
real(dp), dimension(:, :, :), allocatable, public l1_aeroresist
real(dp), dimension(:, :, :), allocatable, public l1_sealedthresh
real(dp), dimension(:, :, :), allocatable, public l1_soilmoistsat