5.13.2-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
mo_common_variables.F90
Go to the documentation of this file.
1!> \dir common
2!> \brief \copybrief f_common
3!> \details \copydetails f_common
4
5!> \defgroup f_common common - Fortran modules
6!> \brief Common modules used by mHM, mRM and MPR.
7!> \details This module provides different routines, constants and structures for all components of mHM.
8
9!> \file mo_common_variables.f90
10!> \brief \copybrief mo_common_variables
11!> \details \copydetails mo_common_variables
12
13!> \brief Provides structures needed by mHM, mRM and/or mpr.
14!> \details Provides the global structure period that is used by both mHM and mRM.
15!> \changelog
16!! - Stephan Thober Nov 2016
17!! - moved processdescription from mo_global_variables to here
18!! - Robert Schweppe Dec 2017
19!! - merged more duplicated variables from mhm and mrm global variables
20!! - Robert Schweppe Jun 2018
21!! - refactoring and reformatting
22!> \authors Stephan Thober
23!> \date Sep 2015
24!> \copyright Copyright 2005-\today, the mHM Developers, Luis Samaniego, Sabine Attinger: All rights reserved.
25!! mHM is released under the LGPLv3+ license \license_note
26!> \ingroup f_common
28
29 use mo_kind, only : i4, dp
31#ifdef MPI
32 USE mpi_f08
33#endif
34 implicit none
35
36 integer(i4) :: itimer ! Current timer number
37
38 ! -------------------------------------------------------------------
39 ! PROJECT DESCRIPTION for the NETCDF output file
40 ! -------------------------------------------------------------------
41 character(1024), public :: project_details ! project including funding instituion., PI, etc.
42 character(1024), public :: setup_description ! any specific description of simulation
43 character(1024), public :: simulation_type ! e.g. seasonal forecast, climate projection, ...
44 character(256), public :: conventions ! convention used for dataset
45 character(1024), public :: contact ! contact details, incl. PI name
46 character(1024), public :: mhm_details ! developing institution, specific mHM revision
47 character(1024), public :: history ! details on version/creation date
48
49 ! -------------------------------------------------------------------
50 ! INPUT variables for configuration of main part
51 ! -------------------------------------------------------------------
52 integer(i4), public :: iflag_cordinate_sys ! options model for the run cordinate system
53 real(dp), dimension(:), allocatable, public :: resolutionhydrology ! [m or degree] resolution of hydrology - Level 1
54 integer(i4), dimension(:), allocatable, public :: l0_domain
55 logical, public :: write_restart ! flag
56
57 ! ------------------------------------------------------------------
58 ! DIRECTORIES
59 ! ------------------------------------------------------------------
60 ! has the dimension of nDomains
61 character(256), dimension(:), allocatable, public :: mhmfilerestartout ! Directory where output of restart is written
62 character(256), dimension(:), allocatable, public :: mrmfilerestartout ! Directory where output of restart is written
63 character(256), public :: dirconfigout
64 character(256), public :: dircommonfiles ! directory where common input files should be located
65 character(256), dimension(:), allocatable, public :: dirmorpho ! Directory where morphological files are located
66 character(256), dimension(:), allocatable, public :: dirlcover ! Directory where land cover files are located
67 character(256), dimension(:), allocatable, public :: dirout ! Directory where output is written to
68 character(256), dimension(:), allocatable, public :: filelatlon ! Directory where the Lat Lon Files are located
69
70 ! -------------------------------------------------------------------
71 ! GRID description
72 ! -------------------------------------------------------------------
73 type(grid), dimension(:), target, allocatable, public :: level0 ! grid information at morphological level (e.g., dem, fDir)
74 type(grid), dimension(:), target, allocatable, public :: level1 ! grid information at hydrologic level
75
76 type(gridremapper), dimension(:), allocatable, public :: l0_l1_remap ! grid information at morphological level (e.g., dem, fDir)
77
78 ! -------------------------------------------------------------------
79 ! L0 DOMAIN description -> <only domain>
80 ! -------------------------------------------------------------------
81 ! dim1 = number grid cells
82 ! input data - morphological variables
83 real(dp), public, dimension(:), allocatable :: l0_elev ! [m] Elevation (sinks removed)
84 ! target variable for coupling to mRM
85 integer(i4), public, dimension(:, :), allocatable :: l0_lcover ! Classic mHM landcover class (upto 3 classes)
86 ! ! dim1=number grid cells, dim2=Number of land cover scenes
87 ! ! target variable for coupling to mRM
88
89#ifdef MPI
90 ! -------------------------------------------------------------------
91 ! MPI variables
92 type(mpi_comm) :: comm ! MPI communicator
93#endif
94 ! -------------------------------------------------------------------
95 !
96 ! -------------------------------------------------------------------
97 ! DOMAIN general description
98 ! -------------------------------------------------------------------
99 type(domain_meta), public :: domainmeta
100 integer(i4), public :: nuniquel0domains ! Number of unique domains for L0
101
102 ! -----------------------------------------------------------------
103 ! LAND COVER DATA
104 ! -----------------------------------------------------------------
105 ! Land cover information
106 integer(i4), public :: nlcoverscene ! Number of land cover scene (lcs)
107 character(256), dimension(:), allocatable, public :: lcfilename ! file names for the different lcs
108 integer(i4), dimension(:), allocatable, public :: lc_year_start ! vector of start years for lcs
109 integer(i4), dimension(:), allocatable, public :: lc_year_end ! vector of end years for lcs
110
111 ! -------------------------------------------------------------------
112 ! PROCESSES description
113 ! -------------------------------------------------------------------
114 integer(i4), parameter, public :: nprocesses = 11 ! Number of possible processes to consider
115 ! ! process 1 :: interception
116 ! ! process 2 :: snow
117 ! ! process 3 :: soilmoisture
118 ! ! process 4 :: sealed area direct runoff
119 ! ! process 5 :: potential evapotranspiration
120 ! ! process 6 :: interflow
121 ! ! process 7 :: percolation
122 ! ! process 8 :: routing
123 ! ! process 9 :: baseflow
124 ! ! process 10:: neutrons
125 ! ! process 11:: river temperature routing
126 integer(i4), dimension(nProcesses, 3), public :: processmatrix ! Info about which process runs in which option and
127 ! ! number of parameters necessary for this option
128 ! ! col1: process_switch
129 ! ! col2: no. of parameters
130 ! ! col3: cum. no. of parameters
131
132 ! -------------------------------------------------------------------
133 ! PARAMETERS
134 ! -------------------------------------------------------------------
135 real(dp), dimension(:, :), allocatable, public, target :: global_parameters
136 ! ! Matrix of global parameters (former: gamma)
137 ! ! col1: min, col2: max, col3: initial,
138 ! ! col4: flag, col5: scaling
139 character(256), dimension(:), allocatable, public :: global_parameters_name
140 ! ! Matrix of global parameters (former: gamma)
141 ! ! col1: names
142 ! -------------------------------------------------------------------
143 ! ALMA convention
144 ! -------------------------------------------------------------------
145 ! TODO: this is currently used only be mRM, but could be useful for MPR and mHM also, ...
146 ! so it is already in common_variables
147 logical :: alma_convention ! flag for ALMA convention
148 ! ! see http://www.lmd.jussieu.fr/~polcher/ALMA/convention_3.html
149 ! ! .True.: ALMA convention is used for Input/Output
150 ! ! .False.: default mHM units are used
151 ! ! CAUTION: only Qall is considered at the moment
152
153end module mo_common_variables
Provides common types needed by mHM, mRM and/or mpr.
Provides structures needed by mHM, mRM and/or mpr.
integer(i4), parameter, public nprocesses
character(256), dimension(:), allocatable, public filelatlon
character(256), dimension(:), allocatable, public mhmfilerestartout
character(1024), public history
character(1024), public setup_description
real(dp), dimension(:), allocatable, public resolutionhydrology
logical, public write_restart
real(dp), dimension(:, :), allocatable, target, public global_parameters
character(256), dimension(:), allocatable, public lcfilename
character(256), dimension(:), allocatable, public global_parameters_name
type(domain_meta), public domainmeta
character(1024), public project_details
character(1024), public contact
character(256), public dirconfigout
character(256), public conventions
character(1024), public simulation_type
integer(i4), public nuniquel0domains
integer(i4), public nlcoverscene
character(256), dimension(:), allocatable, public dirlcover
integer(i4), dimension(:), allocatable, public lc_year_end
character(256), dimension(:), allocatable, public dirout
real(dp), dimension(:), allocatable, public l0_elev
character(256), public dircommonfiles
character(256), dimension(:), allocatable, public dirmorpho
integer(i4), public iflag_cordinate_sys
integer(i4), dimension(:, :), allocatable, public l0_lcover
integer(i4), dimension(nprocesses, 3), public processmatrix
character(256), dimension(:), allocatable, public mrmfilerestartout
integer(i4), dimension(:), allocatable, public l0_domain
character(1024), public mhm_details
type(grid), dimension(:), allocatable, target, public level1
type(grid), dimension(:), allocatable, target, public level0
integer(i4), dimension(:), allocatable, public lc_year_start
type(gridremapper), dimension(:), allocatable, public l0_l1_remap
DOMAIN general description.