Line data Source code
1 : !> \file mhm_driver.f90 2 : !> \brief \copybrief mhm_driver 3 : !> \details \copydetails mhm_driver 4 : 5 : !> \brief Distributed precipitation-runoff model mHM 6 : !> \details This is the main driver of mHM, which calls 7 : !! one instance of mHM for a multiple domains and a given period. 8 : !! \image html mhm5-logo.png "Typical mHM cell" 9 : !! \image latex mhm5-logo.pdf "Typical mHM cell" width=10cm 10 : !> \changelog 11 : !! - Stephan Thober Nov 2013 12 : !! - added read in of latitude longitude fields 13 : !! - Matthias Zink Mar 2013 14 : !! - edited screen output for gauges added inflow gauges 15 : !! - Matthias Cuntz & Juliane Mai Mar 2014 16 : !! - Likelihood Kavetski uses 2 more parameters for the 17 : !! error model global_parameters -> local_parameters 18 : !! - Rohini Kumar Apr 2014 19 : !! - implementation of the mHM run on a single cell configuration also for the routing mode. 20 : !! - run mHM at the input data level i.e. L0 grid 21 : !! - Rohini Kumar May 2014 22 : !! - model run on a regular lat-lon grid or on a regular X-Y coordinate system 23 : !! - Stephan Thober May 2014 24 : !! - moved read meteo forcings to mo_mhm_eval 25 : !! - Matthias Cuntz & Juliane Mai Nov 2014 26 : !! - LAI input from daily, monthly or yearly files 27 : !! - Matthias Zink Mar 2015 28 : !! - added optional soil mositure read in for calibration 29 : !! - Luis Samaniego Jul 2015 30 : !! - added temporal directories for optimization 31 : !! - Stephan Thober Aug 2015 32 : !! - removed routing related variables 33 : !! - Stephan Thober Oct 2015 34 : !! - reorganized optimization (now compatible with mRM) 35 : !! - Oldrich Rakovec, Rohini Kumar Oct 2015 36 : !! - added reading of domain averaged TWS and objective function 15 37 : !! for simultaneous calibration based on runoff and TWS 38 : !! - Rohini Kumar Mar 2016 39 : !! - options to handle different soil databases modified MPR to included soil horizon specific properties/parameters 40 : !! - Stephan Thober Nov 2016 41 : !! - implemented adaptive timestep for routing 42 : !! - Rohini Kumar Dec 2016 43 : !! - options to read (monthly mean) LAI fields 44 : !! - Robert Schweppe Jun 2018 45 : !! - refactoring and reformatting 46 : !! - Maren Kaluza Oct 2019 47 : !! - TWS to data structure 48 : !! - M.C. Demirel, Simon Stisen Jun 2020 49 : !! - New Soil Moisture Process: Feddes and FC dependency on root fraction coefficient processCase(3) = 4 50 : !! - Sebastian Müller Nov 2021 51 : !! - refactoring driver to use provided interfaces 52 : !> \authors Luis Samaniego & Rohini Kumar (UFZ) 53 : !> \date Jun 2018 54 : !> \version \htmlinclude version.txt \latexinclude version.txt 55 : !> \copyright Copyright 2005-\today, the mHM Developers, Luis Samaniego, Sabine Attinger: All rights reserved. 56 : !! mHM is released under the LGPLv3+ license \license_note 57 : !> \ingroup f_mhm 58 14 : PROGRAM mhm_driver 59 14 : use mo_common_mHM_mRM_variables, only: optimize 60 : use mo_common_mpi_tools, only: & 61 : mpi_tools_init, & 62 : mpi_tools_finalize 63 : use mo_mhm_cli, only: parse_command_line 64 : use mo_mhm_interface, only: & 65 : mhm_interface_init, & 66 : mhm_interface_run, & 67 : mhm_interface_run_optimization, & 68 : mhm_interface_finalize 69 : 70 : IMPLICIT NONE 71 : 72 : ! setup MPI if wanted (does nothing if not compiled with MPI support) 73 14 : call mpi_tools_init() 74 : 75 : ! parse command line arguments 76 14 : call parse_command_line() 77 : 78 : ! initialize mhm 79 14 : call mhm_interface_init() 80 : 81 : ! RUN OR OPTIMIZE 82 14 : if (optimize) then 83 5 : call mhm_interface_run_optimization() 84 : else 85 : ! single mhm run with current settings 86 9 : call mhm_interface_run() 87 : end if 88 : 89 : ! WRITE RESTART files and RUNOFF and finish 90 14 : call mhm_interface_finalize() 91 : 92 : ! finalize MPI (does nothing if not compiled with MPI support) 93 14 : call mpi_tools_finalize() 94 : 95 14 : END PROGRAM mhm_driver