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

Module providing interfaces for running preconfigured mHM. More...

Functions/Subroutines

subroutine mhm_interface_run_prepare (parameterset, opti_domain_indices, runoff_present, bfi_present)
 prepare single run of mHM
 
subroutine mhm_interface_run_get_ndomains (ndomains)
 get number of domains for looping
 
subroutine mhm_interface_run_prepare_domain (domain, etoptisim, twsoptisim, neutronsoptisim, smoptisim)
 prepare single domain to run mHM on
 
subroutine mhm_interface_run_finished (time_loop_finished)
 check if current time loop is finished
 
subroutine mhm_interface_run_do_time_step ()
 do one time-step on current domain
 
subroutine mhm_interface_run_write_output ()
 write output after current time-step
 
subroutine mhm_interface_run_update_optisim (etoptisim, twsoptisim, neutronsoptisim, smoptisim)
 add simulation data to optimization data types
 
subroutine mhm_interface_run_finalize_domain ()
 finalize current domain after running
 
subroutine mhm_interface_run_finalize (runoff, bfi)
 finalize run
 

Detailed Description

Module providing interfaces for running preconfigured mHM.

Interfaces to control the mHM run from outside (prepare domain, do timestep, ...).

Authors
Sebastian Mueller, Matthias Kelbling
Version
0.1
Date
Jan 2022

Function/Subroutine Documentation

◆ mhm_interface_run_do_time_step()

subroutine mo_mhm_interface_run::mhm_interface_run_do_time_step

do one time-step on current domain

Definition at line 341 of file mo_mhm_interface_run.f90.

References mo_global_variables::bfi_qbf_sum, mo_global_variables::bfi_qt_sum, mo_common_mhm_mrm_variables::c2tstu, mo_mrm_river_head::calc_river_head(), mo_mrm_global_variables::domain_mrm, mo_common_variables::domainmeta, mo_global_variables::evap_coeff, mo_mrm_global_variables::gw_coupling, mo_mpr_global_variables::horizondepth_mhm, mo_mrm_global_variables::inflowgauge, mo_mrm_global_variables::l0_river_head_mon_sum, mo_mrm_global_variables::l11_areacell, mo_mrm_global_variables::l11_c1, mo_mrm_global_variables::l11_c2, mo_mrm_global_variables::l11_fromn, mo_mrm_global_variables::l11_l1_id, mo_mrm_global_variables::l11_length, mo_mrm_global_variables::l11_netperm, mo_mrm_global_variables::l11_nlinkfracfpimp, mo_mrm_global_variables::l11_noutlets, mo_mrm_global_variables::l11_qmod, mo_mrm_global_variables::l11_qout, mo_mrm_global_variables::l11_qtin, mo_mrm_global_variables::l11_qtr, mo_mrm_global_variables::l11_slope, mo_mrm_global_variables::l11_ton, mo_mrm_global_variables::l11_tsrout, mo_mpr_global_variables::l1_aeroresist, mo_global_variables::l1_aetcanopy, mo_global_variables::l1_aetsealed, mo_global_variables::l1_aetsoil, mo_mpr_global_variables::l1_alpha, mo_global_variables::l1_baseflow, mo_mpr_global_variables::l1_bulkdens, mo_mpr_global_variables::l1_cosmicl3, mo_mpr_global_variables::l1_degday, mo_mpr_global_variables::l1_degdayinc, mo_mpr_global_variables::l1_degdaymax, mo_mpr_global_variables::l1_degdaynopre, mo_mpr_global_variables::l1_fasp, mo_global_variables::l1_fastrunoff, mo_mpr_global_variables::l1_froots, mo_mpr_global_variables::l1_fsealed, mo_mpr_global_variables::l1_harsamcoeff, mo_global_variables::l1_infilsoil, mo_global_variables::l1_inter, mo_mpr_global_variables::l1_jarvis_thresh_c1, mo_mpr_global_variables::l1_karstloss, mo_mpr_global_variables::l1_kbaseflow, mo_mpr_global_variables::l1_kfastflow, mo_mpr_global_variables::l1_kperco, mo_mpr_global_variables::l1_kslowflow, mo_mrm_global_variables::l1_l11_id, mo_mpr_global_variables::l1_latticewater, mo_mpr_global_variables::l1_maxinter, mo_global_variables::l1_melt, mo_global_variables::l1_neutrons, mo_mpr_global_variables::l1_no_count, mo_global_variables::l1_percol, mo_global_variables::l1_pet_calc, mo_mpr_global_variables::l1_petlaicorfactor, mo_global_variables::l1_prec_calc, mo_global_variables::l1_preeffect, mo_mpr_global_variables::l1_prietayalpha, mo_global_variables::l1_rain, mo_global_variables::l1_runoffseal, mo_global_variables::l1_satstw, mo_mpr_global_variables::l1_sealedthresh, mo_global_variables::l1_sealstw, mo_global_variables::l1_slowrunoff, mo_global_variables::l1_snow, mo_global_variables::l1_snowpack, mo_global_variables::l1_soilmoist, mo_mpr_global_variables::l1_soilmoistexp, mo_mpr_global_variables::l1_soilmoistfc, mo_mpr_global_variables::l1_soilmoistsat, mo_mpr_global_variables::l1_surfresist, mo_global_variables::l1_temp_calc, mo_mpr_global_variables::l1_tempthresh, mo_global_variables::l1_throughfall, mo_global_variables::l1_total_runoff, mo_global_variables::l1_unsatstw, mo_mpr_global_variables::l1_unsatthresh, mo_mpr_global_variables::l1_wiltingpoint, mo_common_mhm_mrm_variables::lcyearid, mo_common_variables::level1, mo_mrm_global_variables::level11, mo_global_variables::meteo_handler, mo_mrm_routing::mrm_routing(), mo_mrm_global_variables::mrm_runoff, mo_global_variables::neutron_integral_afast, mo_mpr_global_variables::nsoilhorizons_mhm, mo_common_mhm_mrm_variables::ntstepday, mo_common_variables::processmatrix, mo_common_mhm_mrm_variables::read_restart, mo_common_variables::resolutionhydrology, mo_common_mhm_mrm_variables::resolutionrouting, mo_mrm_global_variables::riv_temp_pcs, mo_common_run_variables::run_cfg, mo_common_mhm_mrm_variables::simper, mo_common_mhm_mrm_variables::timestep, and mo_common_mhm_mrm_variables::warmingdays.

Referenced by run::do_time_step(), and mo_mhm_eval::mhm_eval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mhm_interface_run_finalize()

subroutine mo_mhm_interface_run::mhm_interface_run_finalize ( real(dp), dimension(:, :), intent(out), optional, allocatable  runoff,
real(dp), dimension(:), intent(out), optional, allocatable  bfi 
)

finalize run

Parameters
[out]runoffreturns runoff time series, DIMENSION [nTimeSteps, nGaugesTotal]
[out]bfibaseflow index, dim1=domainID

Definition at line 882 of file mo_mhm_interface_run.f90.

References mo_global_variables::bfi_qbf_sum, mo_global_variables::bfi_qt_sum, mo_mrm_global_variables::mrm_runoff, mo_common_variables::processmatrix, and mo_common_run_variables::run_cfg.

Referenced by run::finalize(), and mo_mhm_eval::mhm_eval().

Here is the caller graph for this function:

◆ mhm_interface_run_finalize_domain()

subroutine mo_mhm_interface_run::mhm_interface_run_finalize_domain

finalize current domain after running

Definition at line 864 of file mo_mhm_interface_run.f90.

References mo_common_variables::domainmeta, mo_mrm_global_variables::riv_temp_pcs, and mo_common_run_variables::run_cfg.

Referenced by run::finalize_domain(), and mo_mhm_eval::mhm_eval().

Here is the caller graph for this function:

◆ mhm_interface_run_finished()

subroutine mo_mhm_interface_run::mhm_interface_run_finished ( logical, intent(inout)  time_loop_finished)

check if current time loop is finished

Parameters
[in,out]time_loop_finishedflag to indicate end of timeloop

Definition at line 334 of file mo_mhm_interface_run.f90.

References mo_common_run_variables::run_cfg.

Referenced by run::finished(), and mo_mhm_eval::mhm_eval().

Here is the caller graph for this function:

◆ mhm_interface_run_get_ndomains()

subroutine mo_mhm_interface_run::mhm_interface_run_get_ndomains ( integer(i4), intent(inout)  ndomains)

get number of domains for looping

Parameters
[in,out]ndomainsnumber of domains

Definition at line 244 of file mo_mhm_interface_run.f90.

References mo_common_run_variables::run_cfg.

Referenced by run::get_ndomains(), and mo_mhm_eval::mhm_eval().

Here is the caller graph for this function:

◆ mhm_interface_run_prepare()

subroutine mo_mhm_interface_run::mhm_interface_run_prepare ( real(dp), dimension(:), intent(in), optional  parameterset,
integer(i4), dimension(:), intent(in), optional  opti_domain_indices,
logical, intent(in), optional  runoff_present,
logical, intent(in), optional  bfi_present 
)

prepare single run of mHM

Parameters
[in]parameterseta set of global parameter (gamma) to run mHM, DIMENSION [no. of global_Parameters]
[in]opti_domain_indicesselected domains for optimization
[in]runoff_presentwhether runoff is present
[in]bfi_presentwhether BFI is present

Definition at line 160 of file mo_mhm_interface_run.f90.

References mo_global_variables::bfi_qbf_sum, mo_global_variables::bfi_qt_sum, mo_common_variables::domainmeta, mo_init_states::fluxes_states_default_init(), mo_common_variables::global_parameters, mo_mpr_global_variables::l1_fsealed, mo_common_mhm_mrm_variables::mhmfilerestartin, mo_mpr_eval::mpr_eval(), mo_common_mhm_mrm_variables::optimize, mo_common_variables::processmatrix, mo_common_mhm_mrm_variables::read_restart, mo_restart::read_restart_states(), mo_common_mhm_mrm_variables::restart_reset_fluxes_states, mo_common_run_variables::run_cfg, mo_init_states::variables_default_init(), and mo_mrm_init::variables_default_init_routing().

Referenced by mo_mhm_eval::mhm_eval(), and run::prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mhm_interface_run_prepare_domain()

subroutine mo_mhm_interface_run::mhm_interface_run_prepare_domain ( integer(i4), intent(in), optional  domain,
type(optidata_sim), dimension(:), intent(inout), optional  etoptisim,
type(optidata_sim), dimension(:), intent(inout), optional  twsoptisim,
type(optidata_sim), dimension(:), intent(inout), optional  neutronsoptisim,
type(optidata_sim), dimension(:), intent(inout), optional  smoptisim 
)

prepare single domain to run mHM on

Parameters
[in]domaindomain loop counter
[in,out]smoptisimreturns soil moisture time series for all grid cells (of multiple Domains concatenated),DIMENSION [nCells, nTimeSteps]
[in,out]neutronsoptisimdim1=ncells, dim2=time
[in,out]etoptisimreturns evapotranspiration time series for all grid cells (of multiple Domains concatenated),DIMENSION [nCells, nTimeSteps]
[in,out]twsoptisimreturns tws time series for all grid cells (of multiple Domains concatenated),DIMENSION [nCells, nTimeSteps]

Definition at line 251 of file mo_mhm_interface_run.f90.

References mo_common_variables::domainmeta, mo_mrm_init::fluxes_states_default_init_routing(), mo_mrm_global_variables::inflowgauge, mo_global_variables::l1_etobs, mo_global_variables::l1_neutronsobs, mo_global_variables::l1_smobs, mo_global_variables::l1_twsaobs, mo_common_variables::level1, mo_mrm_global_variables::level11, mo_mrm_restart::mrm_read_restart_states(), mo_mrm_mpr::mrm_update_param(), mo_common_mhm_mrm_variables::mrmfilerestartin, mo_common_variables::processmatrix, mo_common_mhm_mrm_variables::read_restart, mo_common_mhm_mrm_variables::restart_reset_fluxes_states, mo_mrm_global_variables::riv_temp_pcs, and mo_common_run_variables::run_cfg.

Referenced by mo_mhm_eval::mhm_eval(), and run::prepare_domain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mhm_interface_run_update_optisim()

subroutine mo_mhm_interface_run::mhm_interface_run_update_optisim ( type(optidata_sim), dimension(:), intent(inout), optional  etoptisim,
type(optidata_sim), dimension(:), intent(inout), optional  twsoptisim,
type(optidata_sim), dimension(:), intent(inout), optional  neutronsoptisim,
type(optidata_sim), dimension(:), intent(inout), optional  smoptisim 
)

add simulation data to optimization data types

Parameters
[in,out]smoptisimreturns soil moisture time series for all grid cells (of multiple Domains concatenated),DIMENSION [nCells, nTimeSteps]
[in,out]neutronsoptisimdim1=ncells, dim2=time
[in,out]etoptisimreturns evapotranspiration time series for all grid cells (of multiple Domains concatenated),DIMENSION [nCells, nTimeSteps]
[in,out]twsoptisimreturns tws time series for all grid cells (of multiple Domains concatenated),DIMENSION [nCells, nTimeSteps]

Definition at line 745 of file mo_mhm_interface_run.f90.

References mo_global_variables::l1_aetcanopy, mo_global_variables::l1_aetsealed, mo_global_variables::l1_aetsoil, mo_global_variables::l1_etobs, mo_mpr_global_variables::l1_fsealed, mo_global_variables::l1_inter, mo_global_variables::l1_neutrons, mo_global_variables::l1_satstw, mo_global_variables::l1_sealstw, mo_global_variables::l1_smobs, mo_global_variables::l1_snowpack, mo_global_variables::l1_soilmoist, mo_mpr_global_variables::l1_soilmoistsat, mo_global_variables::l1_twsaobs, mo_global_variables::l1_unsatstw, mo_mpr_global_variables::nsoilhorizons_mhm, mo_global_variables::nsoilhorizons_sm_input, mo_common_mhm_mrm_variables::ntstepday, mo_common_run_variables::run_cfg, and mo_common_mhm_mrm_variables::warmingdays.

Referenced by mo_mhm_eval::mhm_eval().

Here is the caller graph for this function:

◆ mhm_interface_run_write_output()

subroutine mo_mhm_interface_run::mhm_interface_run_write_output

write output after current time-step

Definition at line 641 of file mo_mhm_interface_run.f90.

References mo_common_variables::domainmeta, mo_mrm_global_variables::gw_coupling, mo_mrm_write_fluxes_states::gw_outputdataset(), mo_mrm_write_fluxes_states::gw_updatedataset(), mo_mrm_global_variables::l0_river_head_mon_sum, mo_mrm_global_variables::l11_qmod, mo_global_variables::l1_aetcanopy, mo_global_variables::l1_aetsealed, mo_global_variables::l1_aetsoil, mo_global_variables::l1_baseflow, mo_global_variables::l1_fastrunoff, mo_mpr_global_variables::l1_fsealed, mo_global_variables::l1_infilsoil, mo_global_variables::l1_inter, mo_global_variables::l1_melt, mo_global_variables::l1_neutrons, mo_global_variables::l1_percol, mo_global_variables::l1_pet_calc, mo_global_variables::l1_preeffect, mo_global_variables::l1_runoffseal, mo_global_variables::l1_satstw, mo_global_variables::l1_sealstw, mo_global_variables::l1_slowrunoff, mo_global_variables::l1_snowpack, mo_global_variables::l1_soilmoist, mo_mpr_global_variables::l1_soilmoistsat, mo_global_variables::l1_total_runoff, mo_global_variables::l1_unsatstw, mo_common_variables::level0, mo_write_fluxes_states::mhm_outputdataset(), mo_write_fluxes_states::mhm_updatedataset(), mo_mrm_write_fluxes_states::mrm_outputdataset(), mo_mrm_write_fluxes_states::mrm_updatedataset(), mo_common_mhm_mrm_variables::optimize, mo_global_variables::outputflxstate, mo_mrm_global_variables::outputflxstate_mrm, mo_mrm_global_variables::riv_temp_pcs, mo_common_run_variables::run_cfg, mo_common_mhm_mrm_variables::timestep, mo_global_variables::timestep_model_outputs, and mo_mrm_global_variables::timestep_model_outputs_mrm.

Referenced by mo_mhm_eval::mhm_eval(), and run::write_output().

Here is the call graph for this function:
Here is the caller graph for this function: