5.13.2-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
mo_mrm_riv_temp_class Module Reference

Class for the river temperature calculations. More...

Data Types

module  riv_temp_type
 This is a container to define the river temperature routing in the current time step. More...
 

Functions/Subroutines

subroutine clean_up (self)
 clean up
 
subroutine config (self, file_namelist, unamelist, file_namelist_param, unamelist_param)
 configure the riv_temp_type class from the mhm namelist
 
subroutine init (self, ncells)
 initalize the riv_temp_type class for the current domain
 
subroutine init_area (self, idomain, l11_netperm, l11_fromn, l11_length, nlinks, ncells, nrows, ncols, l11_mask)
 initialize the river area of riv_temp_type class for the current domain
 
subroutine init_riv_temp (self, temp_air, efecarea, l1_l11_id, l11_areacell, l11_l1_id, map_flag)
 initialize the river temperature of riv_temp_type class for the current domain
 
subroutine reset_timestep (self)
 reset riv_temp_type class for next timestep
 
subroutine alloc_lateral (self, ncells)
 allocate lateral temp components of riv_temp_type class for current domain
 
subroutine dealloc_lateral (self)
 deallocate lateral temp components of riv_temp_type
 
subroutine acc_source_e (self, fsealed_area_fraction, fast_interflow, slow_interflow, baseflow, direct_runoff, temp_air)
 accumulate energy sources of riv_temp_type
 
subroutine finalize_source_e (self, efecarea, l1_l11_id, l11_areacell, l11_l1_id, timestep, map_flag)
 finalize energy sources of riv_temp_type
 
real(dp) function get_lrad_out (self, riv_temp)
 get outgoing longwave radiation of riv_temp_type
 
real(dp) function get_lat_heat (self, air_temp, netrad)
 latent heat flux of riv_temp_type
 
real(dp) function get_sens_heat (self, air_temp, riv_temp)
 sensible heat flux of riv_temp_type
 
real(dp) function get_e_io (self, riv_temp, cell)
 get complete energy source of riv_temp_type at given cell
 
subroutine l11_routing_e (self, nlinks, netperm, netlink_fromn, netlink_ton, netlink_c1, netlink_c2, ninflowgauges, inflowheadwater, inflownodelist, l11_qtr, l11_qmod)
 execute the temperature routing of riv_temp_type
 
subroutine init_iter (self)
 initialize iterative solver of riv_temp_type
 
subroutine next_iter (self, t_est, t_rout)
 execute next iteration with iterative solver of riv_temp_type
 

Detailed Description

Class for the river temperature calculations.

River temperature routing on top of mRM.

Warning
This feature is still experimental! River freezing is still missing.
Version
0.1
Authors
Sebastian Mueller
Date
Sep 2020

Function/Subroutine Documentation

◆ acc_source_e()

subroutine mo_mrm_riv_temp_class::acc_source_e ( class(riv_temp_type), intent(inout)  self,
real(dp), dimension(:), intent(in)  fsealed_area_fraction,
real(dp), dimension(:), intent(in)  fast_interflow,
real(dp), dimension(:), intent(in)  slow_interflow,
real(dp), dimension(:), intent(in)  baseflow,
real(dp), dimension(:), intent(in)  direct_runoff,
real(dp), dimension(:), intent(in)  temp_air 
)
private

accumulate energy sources of riv_temp_type

Parameters
[in]fsealed_area_fractionsealed area fraction [1]
[in]fast_interflow\( q_0 \) Fast runoff component [mm TS-1]
[in]slow_interflow\( q_1 \) Slow runoff component [mm TS-1]
[in]baseflow\( q_2 \) Baseflow [mm TS-1]
[in]direct_runoff\( q_D \) Direct runoff from impervious areas [mm TS-1]
[in]temp_airair temperature [K]

Definition at line 449 of file mo_mrm_riv_temp_class.f90.

References mo_mrm_pre_routing::calc_l1_runoff_e().

Here is the call graph for this function:

◆ alloc_lateral()

subroutine mo_mrm_riv_temp_class::alloc_lateral ( class(riv_temp_type), intent(inout)  self,
integer(i4), intent(in)  ncells 
)
private

allocate lateral temp components of riv_temp_type class for current domain

Parameters
[in]ncellsnumber of level-1 cells for the current domain

Definition at line 408 of file mo_mrm_riv_temp_class.f90.

◆ clean_up()

subroutine mo_mrm_riv_temp_class::clean_up ( class(riv_temp_type), intent(inout)  self)

clean up

Definition at line 128 of file mo_mrm_riv_temp_class.f90.

◆ config()

subroutine mo_mrm_riv_temp_class::config ( class(riv_temp_type), intent(inout)  self,
character(*), intent(in)  file_namelist,
integer, intent(in)  unamelist,
character(*), intent(in)  file_namelist_param,
integer, intent(in)  unamelist_param 
)
private

configure the riv_temp_type class from the mhm namelist

Parameters
[in]file_namelistmhm namelist file
[in]file_namelist_parammhm parameter namelist file

Definition at line 158 of file mo_mrm_riv_temp_class.f90.

References mo_check::check_dir(), mo_common_variables::domainmeta, mo_common_constants::maxnodomains, and mo_common_constants::nodata_i4.

Here is the call graph for this function:

◆ dealloc_lateral()

subroutine mo_mrm_riv_temp_class::dealloc_lateral ( class(riv_temp_type), intent(inout)  self)
private

deallocate lateral temp components of riv_temp_type

Definition at line 431 of file mo_mrm_riv_temp_class.f90.

◆ finalize_source_e()

subroutine mo_mrm_riv_temp_class::finalize_source_e ( class(riv_temp_type), intent(inout)  self,
real(dp), dimension(:), intent(in)  efecarea,
integer(i4), dimension(:), intent(in)  l1_l11_id,
real(dp), dimension(:), intent(in)  l11_areacell,
integer(i4), dimension(:), intent(in)  l11_l1_id,
integer(i4), intent(in)  timestep,
logical, intent(in)  map_flag 
)
private

finalize energy sources of riv_temp_type

Parameters
[in]efecareaeffective area in [km2] at Level 1
[in]l1_l11_idL11 Ids mapped on L1
[in]l11_areacelleffective area in [km2] at Level 11
[in]l11_l1_idL1 Ids mapped on L11
[in]timestepsimulation timestep in [h]
[in]map_flagFlag indicating whether routing resolution is higher than hydrologic one

Definition at line 490 of file mo_mrm_riv_temp_class.f90.

References mo_mrm_pre_routing::l11_meteo_acc(), and mo_mrm_pre_routing::l11_runoff_acc().

Here is the call graph for this function:

◆ get_e_io()

real(dp) function mo_mrm_riv_temp_class::get_e_io ( class(riv_temp_type), intent(in)  self,
real(dp), intent(in)  riv_temp,
integer(i4), intent(in)  cell 
)
private

get complete energy source of riv_temp_type at given cell

Returns
energy IO
Parameters
[in]riv_tempgiven river temperature in K to calculate heat fluxes
[in]cellcell index in the current domain

net radiation calc from short and longwave radiation in/out

Definition at line 610 of file mo_mrm_riv_temp_class.f90.

References mo_mhm_constants::h2odens.

◆ get_lat_heat()

real(dp) function mo_mrm_riv_temp_class::get_lat_heat ( class(riv_temp_type), intent(in)  self,
real(dp), intent(in)  air_temp,
real(dp), intent(in)  netrad 
)
private

latent heat flux of riv_temp_type

Returns
latent heat flux
Parameters
[in]air_tempair temperature in deg C
[in]netradnet radiation in W * m-2

Definition at line 571 of file mo_mrm_riv_temp_class.f90.

References mo_pet::slope_satpressure().

Here is the call graph for this function:

◆ get_lrad_out()

real(dp) function mo_mrm_riv_temp_class::get_lrad_out ( class(riv_temp_type), intent(in)  self,
real(dp), intent(in)  riv_temp 
)
private

get outgoing longwave radiation of riv_temp_type

Returns
outgoing longwave radiation
Parameters
[in]riv_tempriver temperature in K

Definition at line 554 of file mo_mrm_riv_temp_class.f90.

◆ get_sens_heat()

real(dp) function mo_mrm_riv_temp_class::get_sens_heat ( class(riv_temp_type), intent(in)  self,
real(dp), intent(in)  air_temp,
real(dp), intent(in)  riv_temp 
)
private

sensible heat flux of riv_temp_type

Returns
sensible heat flux
Parameters
[in]air_tempair temperature in [deg C]
[in]riv_tempriver temperature in [deg C]

Definition at line 595 of file mo_mrm_riv_temp_class.f90.

◆ init()

subroutine mo_mrm_riv_temp_class::init ( class(riv_temp_type), intent(inout)  self,
integer(i4), intent(in)  ncells 
)
private

initalize the riv_temp_type class for the current domain

Parameters
[in]ncellsnumber of level-11 cells for the current domain

Definition at line 256 of file mo_mrm_riv_temp_class.f90.

References mo_mrm_constants::nroutingstates.

◆ init_area()

subroutine mo_mrm_riv_temp_class::init_area ( class(riv_temp_type), intent(inout)  self,
integer(i4), intent(in)  idomain,
integer(i4), dimension(:), intent(in)  l11_netperm,
integer(i4), dimension(:), intent(in)  l11_fromn,
real(dp), dimension(:), intent(in)  l11_length,
integer(i4), intent(in)  nlinks,
integer(i4), intent(in)  ncells,
integer(i4), intent(in)  nrows,
integer(i4), intent(in)  ncols,
logical, dimension(:, :), intent(in)  l11_mask 
)
private

initialize the river area of riv_temp_type class for the current domain

Parameters
[in]idomainDomain ID
[in]l11_netpermL11 routing order
[in]l11_fromnL11 source grid cell order
[in]l11_lengthL11 link length
[in]nlinksnumber of L11 links in the current domain
[in]ncellsnumber of L11 cells of the current domain
[in]ncolsNumber of columns
[in]nrowsNumber of rows
[in]l11_maskthe mask for valid cells in the original grid (nrows, ncols)

Definition at line 296 of file mo_mrm_riv_temp_class.f90.

References mo_read_nc::read_const_nc().

Here is the call graph for this function:

◆ init_iter()

subroutine mo_mrm_riv_temp_class::init_iter ( class(riv_temp_type), intent(inout)  self)
private

initialize iterative solver of riv_temp_type

Definition at line 755 of file mo_mrm_riv_temp_class.f90.

◆ init_riv_temp()

subroutine mo_mrm_riv_temp_class::init_riv_temp ( class(riv_temp_type), intent(inout)  self,
real(dp), dimension(:), intent(in)  temp_air,
real(dp), dimension(:), intent(in)  efecarea,
integer(i4), dimension(:), intent(in)  l1_l11_id,
real(dp), dimension(:), intent(in)  l11_areacell,
integer(i4), dimension(:), intent(in)  l11_l1_id,
logical, intent(in)  map_flag 
)
private

initialize the river temperature of riv_temp_type class for the current domain

Parameters
[in]temp_airair temperature [degC] for current timestep
[in]efecareaeffective area in [km2] at Level 1
[in]l1_l11_idL11 Ids mapped on L1
[in]l11_areacelleffective area in [km2] at Level 11
[in]l11_l1_idL1 Ids mapped on L11
[in]map_flagFlag indicating whether routing resolution is higher than hydrologic one

Definition at line 360 of file mo_mrm_riv_temp_class.f90.

References mo_mrm_pre_routing::l11_meteo_acc().

Here is the call graph for this function:

◆ l11_routing_e()

subroutine mo_mrm_riv_temp_class::l11_routing_e ( class(riv_temp_type), intent(inout)  self,
integer(i4), intent(in)  nlinks,
integer(i4), dimension(:), intent(in)  netperm,
integer(i4), dimension(:), intent(in)  netlink_fromn,
integer(i4), dimension(:), intent(in)  netlink_ton,
real(dp), dimension(:), intent(in)  netlink_c1,
real(dp), dimension(:), intent(in)  netlink_c2,
integer(i4), intent(in)  ninflowgauges,
logical, dimension(:), intent(in)  inflowheadwater,
integer(i4), dimension(:), intent(in)  inflownodelist,
real(dp), dimension(:), intent(in)  l11_qtr,
real(dp), dimension(:), intent(in)  l11_qmod 
)
private

execute the temperature routing of riv_temp_type

Parameters
[in]nlinksnumber of stream segment (reaches)
[in]netpermrouting order of a given domain (permutation)
[in]netlink_fromnfrom node
[in]netlink_tonto node
[in]netlink_c1routing parameter C1 ([7] p. 25-41)
[in]netlink_c2routing parameters C2 (id)
[in]ninflowgauges[-] number of inflow points
[in]inflowheadwater[-] if to consider headwater cells of inflow gauge
[in]inflownodelist[-] L11 ID of inflow points
[in]l11_qtr[m3 s-1] Transformed outflow leaving node I at current timestep(Muskingum)
[in]l11_qmod[m3 s-1] Simulated routed discharge

Definition at line 639 of file mo_mrm_riv_temp_class.f90.

◆ next_iter()

subroutine mo_mrm_riv_temp_class::next_iter ( class(riv_temp_type), intent(inout)  self,
real(dp), intent(inout)  t_est,
real(dp), intent(in)  t_rout 
)
private

execute next iteration with iterative solver of riv_temp_type

Parameters
[in,out]t_estestimated river temperature
[in]t_routcalculated (routed) river temperature

Definition at line 769 of file mo_mrm_riv_temp_class.f90.

◆ reset_timestep()

subroutine mo_mrm_riv_temp_class::reset_timestep ( class(riv_temp_type), intent(inout)  self)
private

reset riv_temp_type class for next timestep

Definition at line 392 of file mo_mrm_riv_temp_class.f90.