5.13.2-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
mo_common_run_variables.f90
Go to the documentation of this file.
1!> \file mo_common_run_variables.f90
2!> \brief \copybrief mo_common_run_variables
3!> \details \copydetails mo_common_run_variables
4
5!> \brief Provides structures needed by mhm_eval to store current run config.
6!> \author Sebastian Mueller
7!> \date Jan 2022
8!> \version 0.1
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_common
13
14 use mo_kind, only : i4, dp
16 use mo_nc_output, only : outputdataset
17
18 implicit none
19
20 !> \class run_cfg_t
21 !> \brief This is a container to hold all information while running mHM.
23 !> time step counter
24 integer(i4) :: time_step
25 !> currently selected domain
26 integer(i4) :: selected_domain
27 !> number of domains simulated in this mhm_eval run. Depends on opti_function
28 integer(i4) :: ndomains
29 !> output runoff
30 logical :: output_runoff = .false.
31 !> output BFI
32 logical :: output_bfi = .false.
33 !> currently used parameter set
34 real(dp), dimension(:), allocatable :: parameterset
35 !> selected domains
36 integer(i4), dimension(:), allocatable :: domain_indices
37 !> fraction of NOT sealed area
38 real(dp), dimension(:, :, :), allocatable :: l1_fnotsealed
39 !> output mHM NetCDF object
40 type(outputdataset) :: nc_mhm
41 !> output mRM NetCDF object
42 type(outputdataset) :: nc_mrm
43 !> output groundwater NetCDF object
44 type(outputdataset) :: nc_gw
45 !> No. of cells at level 1 for current Domain
46 integer(i4) :: ncells
47 !> start and end index at level 1 for current Domain
48 integer(i4) :: s1, e1
49 !> meteorological time step for process 5 (PET)
50 integer(i4), dimension(6) :: imeteo_p5
51 !> process 5: start and end index of vectors
52 !! index 1: pet
53 !! index 2: tmin
54 !! index 3: tmax
55 !! index 4: netrad
56 !! index 5: absolute vapour pressure
57 !! index 6: windspeed
58 integer(i4), dimension(6) :: s_p5, e_p5
59 !> start and end index of meteo variables
60 integer(i4) :: s_meteo, e_meteo
61 !> pointer to current domain L1 mask
62 logical, dimension(:, :), pointer :: mask1
63 !> index of meteo time-step
64 integer(i4) :: imeteots
65 !> datetimeinfo variable for everything that has to do with time dependend calculations
66 type(datetimeinfo) :: domaindatetime
67 !> discharge timestep
68 integer(i4) :: idischargets
69 !> start and end index at L11
70 integer(i4) :: s11, e11
71 !> factor between routing and hydrological modelling resolution
72 real(dp) :: tsroutfactor
73 !> factor between routing and hydrological modelling resolution (dummy)
74 real(dp) :: tsroutfactorin
75 !> timestep of runoff to rout [h]
76 !! - identical to timestep of input if tsRoutFactor is less than 1
77 !! - tsRoutFactor * timestep if tsRoutFactor is greater than 1
78 integer(i4) :: timestep_rout
79 !> Runoff that is input for routing
80 real(dp), allocatable, dimension(:) :: runtorout
81 !> inflowing discharge
82 real(dp), allocatable, dimension(:) :: inflowdischarge
83 !> pointer to current domain L11 mask
84 logical, pointer, dimension(:, :) :: mask11
85 !> flag for performing routing
86 logical :: doroute
87 contains
88 !> \copydoc mo_common_run_variables::get_domain_index
89 procedure :: get_domain_index!< \see mo_common_run_variables::get_domain_index
90 !> \copydoc mo_common_run_variables::clean_up
91 procedure :: clean_up!< \see mo_common_run_variables::clean_up
92 end type run_cfg_t
93
94 !> This is a container to hold all information while running mHM
95 type(run_cfg_t), public :: run_cfg
96
97contains
98
99 !> \brief get domain index from domain loop counter
100 !> \return index
101 integer(i4) function get_domain_index(self, i) result(idx)
102 implicit none
103 class(run_cfg_t), intent(in) :: self
104 integer(i4), intent(in) :: i !< domain loop counter
105 idx = self%domain_indices(i)
106 end function get_domain_index
107
108 !> \brief clean up run variables
109 subroutine clean_up(self)
110 implicit none
111 class(run_cfg_t), intent(inout) :: self
112 if ( allocated(self%parameterset) ) deallocate(self%parameterset)
113 if ( allocated(self%domain_indices) ) deallocate(self%domain_indices)
114 if ( allocated(self%L1_fNotSealed) ) deallocate(self%L1_fNotSealed)
115 if ( allocated(self%RunToRout) ) deallocate(self%RunToRout)
116 if ( allocated(self%InflowDischarge) ) deallocate(self%InflowDischarge)
117 end subroutine clean_up
118
type for date time information with an increment subroutine
Provides structures needed by mhm_eval to store current run config.
type(run_cfg_t), public run_cfg
This is a container to hold all information while running mHM.
integer(i4) function get_domain_index(self, i)
get domain index from domain loop counter
subroutine clean_up(self)
clean up run variables
Creates NetCDF output for different fluxes and state variables of mHM.
This is a container to hold all information while running mHM.