From 5c5056562b6e6d6e23b4c4687b389b2030e288ef Mon Sep 17 00:00:00 2001 From: Stephan Thober Date: Thu, 5 Mar 2020 10:39:14 +0100 Subject: [PATCH 1/7] created mrm_read_river_network flag The mrm_read_river_network flag is optional in mainconfig_mhm_mrm namelist. It allows to only read the river network for mRM. No states are read. It is automatically set to .true. if read_restart is set .true. The default value is .false. --- mhm.nml | 8 ++++++-- .../mo_common_mHM_mRM_read_config.f90 | 15 +++++++++++++-- .../mo_common_mHM_mRM_variables.f90 | 1 + src/mRM/mo_mrm_init.f90 | 10 +++++----- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/mhm.nml b/mhm.nml index 8a8f7bbe..73bd9225 100644 --- a/mhm.nml +++ b/mhm.nml @@ -96,7 +96,7 @@ L0Domain(2) = 2 !----------------------------------------------------------------------------- !> flag for writing restart output !----------------------------------------------------------------------------- -write_restart = .TRUE. +write_restart = .False. !----------------------------------------------------------------------------- !> read domain specific optional data !----------------------------------------------------------------------------- @@ -137,8 +137,12 @@ resolution_Routing(2) = 24000 timestep = 1 !----------------------------------------------------------------------------- !> flags for reading restart output +!> mrm_read_restart is an optional flag +!> mrm_read_restart = .True. allows to read the restart for mRM, but not mHM +!> read_restart = .True. forces mrm_read_restart = .True. !----------------------------------------------------------------------------- -read_restart = .FALSE. +read_restart = .True. +mrm_read_restart = .False. !----------------------------------------------------------------------------- !> flag for optimization: .TRUE.: optimization !> or .FALSE.: no optimazition diff --git a/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 b/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 index 0e23f38a..eb30dd08 100644 --- a/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 +++ b/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 @@ -51,7 +51,8 @@ subroutine common_mHM_mRM_read_config(file_namelist, unamelist) use mo_common_constants, only : maxNoDomains use mo_common_mHM_mRM_variables, only : LCyearId, dds_r, dirRestartIn, evalPer, mcmc_error_params, mcmc_opti, nIterations, & nTStepDay, opti_function, opti_method, optimize, optimize_restart, & - read_restart, resolutionRouting, sa_temp, sce_ngs, sce_npg, sce_nps, seed, & + read_restart, mrm_read_river_network, resolutionRouting, sa_temp, & + sce_ngs, sce_npg, sce_nps, seed, & simPer, timestep, warmPer, warmingDays use mo_common_read_config, only : set_land_cover_scenes_id use mo_common_variables, only : LCfilename, domainMeta, period, processMatrix @@ -82,13 +83,16 @@ subroutine common_mHM_mRM_read_config(file_namelist, unamelist) ! namelist spatial & temporal resolution, otmization information namelist /mainconfig_mhm_mrm/ timestep, resolution_Routing, optimize, & optimize_restart, opti_method, opti_function, & - read_restart, dir_RestartIn + read_restart, mrm_read_river_network, dir_RestartIn ! namelist for optimization settings namelist /Optimization/ nIterations, seed, dds_r, sa_temp, sce_ngs, & sce_npg, sce_nps, mcmc_opti, mcmc_error_params ! namelist for time settings namelist /time_periods/ warming_Days, eval_Per + ! set default values for optional arguments + mrm_read_river_network = .false. + !=============================================================== ! Read namelist main directories !=============================================================== @@ -99,6 +103,13 @@ subroutine common_mHM_mRM_read_config(file_namelist, unamelist) !=============================================================== call position_nml('mainconfig_mhm_mrm', unamelist) read(unamelist, nml = mainconfig_mhm_mrm) + ! consistency between read_restart and mrm_read_river_network + if (read_restart) then + if (.not. mrm_read_river_network) then + call message('***WARNING: mrm_read_river_network is set to .true. because read_restart is .true.') + end if + mrm_read_river_network = .true. + end if allocate(resolutionRouting(domainMeta%nDomains)) allocate(dirRestartIn(domainMeta%nDomains)) diff --git a/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 b/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 index cc746a43..aafbff14 100644 --- a/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 +++ b/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 @@ -32,6 +32,7 @@ module mo_common_mHM_mRM_variables real(dp), public :: c2TSTu ! Unit transformation = timeStep/24 real(dp), dimension(:), allocatable, public :: resolutionRouting ! [m or degree] resolution of routing - Level 11 logical, public :: read_restart ! flag + logical, public :: mrm_read_river_network ! flag type(period), dimension(:), allocatable, public :: warmPer ! time period for warming type(period), dimension(:), allocatable, public :: evalPer ! time period for model evaluation diff --git a/src/mRM/mo_mrm_init.f90 b/src/mRM/mo_mrm_init.f90 index 350c2351..a239583d 100644 --- a/src/mRM/mo_mrm_init.f90 +++ b/src/mRM/mo_mrm_init.f90 @@ -103,7 +103,7 @@ end subroutine mrm_configuration subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_param, ReadLatLon) use mo_common_constants, only : nodata_dp, nodata_i4 - use mo_common_mHM_mRM_variables, only : dirRestartIn, mrm_coupling_mode, read_restart, & + use mo_common_mHM_mRM_variables, only : dirRestartIn, mrm_coupling_mode, mrm_read_river_network, & resolutionRouting use mo_common_restart, only : read_grid_info use mo_common_variables, only : domainMeta, global_parameters, l0_l1_remap, level0, level1, domainMeta, & @@ -150,7 +150,7 @@ subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_par allocate(l0_l11_remap(domainMeta%nDomains)) allocate(l1_l11_remap(domainMeta%nDomains)) - if (.not. read_restart) then + if (.not. mrm_read_river_network) then ! read all (still) necessary level 0 data if (processMatrix(8, 1) .eq. 1_i4) call mrm_read_L0_data(mrm_coupling_mode .eq. 0_i4, ReadLatLon, .true.) if (processMatrix(8, 1) .eq. 2_i4) call mrm_read_L0_data(mrm_coupling_mode .eq. 0_i4, ReadLatLon, .false.) @@ -159,7 +159,7 @@ subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_par do iDomain = 1, domainMeta%nDomains domainID = domainMeta%indices(iDomain) - if (read_restart) then + if (mrm_read_river_network) then ! this reads the domain properties if (.not. allocated(level0)) allocate(level0(domainMeta%nDomains)) ! ToDo: L0_Domain, parallel @@ -222,7 +222,7 @@ subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_par ! INITIALIZE STREAM NETWORK ! ---------------------------------------------------------- do iDomain = 1, domainMeta%nDomains - if (.not. read_restart) then + if (.not. mrm_read_river_network) then call L11_flow_direction(iDomain) call L11_flow_accumulation(iDomain) call L11_set_network_topology(iDomain) @@ -257,7 +257,7 @@ subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_par end if end if ! mpr-like definiton of sealed floodplain fraction - if ((processMatrix(8, 1) .eq. 1_i4) .and. (.not. read_restart)) then + if ((processMatrix(8, 1) .eq. 1_i4) .and. (.not. mrm_read_river_network)) then call L11_fraction_sealed_floodplain(2_i4, .true.) else ! dummy initialization From 1511253a81c173c85a3e90552855fa3d2e05de91 Mon Sep 17 00:00:00 2001 From: Stephan Thober Date: Thu, 5 Mar 2020 10:49:04 +0100 Subject: [PATCH 2/7] BUGFIX: domainID not set correctly for mRM if restart is activated --- src/mHM/mo_mhm_eval.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mHM/mo_mhm_eval.f90 b/src/mHM/mo_mhm_eval.f90 index 91814894..554c1007 100644 --- a/src/mHM/mo_mhm_eval.f90 +++ b/src/mHM/mo_mhm_eval.f90 @@ -318,6 +318,7 @@ SUBROUTINE mhm_eval(parameterset, opti_domain_indices, runoff, smOptiSim, neutro else iDomain = ii end if + domainID = domainMeta%indices(iDomain) !-------------------------- ! evapotranspiration optimization From 26519b74b148afb7273e9e720e7f9c488fc2da7a Mon Sep 17 00:00:00 2001 From: Stephan Thober Date: Thu, 5 Mar 2020 10:51:17 +0100 Subject: [PATCH 3/7] updated mhm.nml: mrm_read_river_network is now correctly named --- mhm.nml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mhm.nml b/mhm.nml index 73bd9225..9dfee4cf 100644 --- a/mhm.nml +++ b/mhm.nml @@ -137,12 +137,12 @@ resolution_Routing(2) = 24000 timestep = 1 !----------------------------------------------------------------------------- !> flags for reading restart output -!> mrm_read_restart is an optional flag -!> mrm_read_restart = .True. allows to read the restart for mRM, but not mHM -!> read_restart = .True. forces mrm_read_restart = .True. +!> mrm_read_river_network is an optional flag +!> mrm_read_river_network = .True. allows to read the river network for mRM +!> read_restart = .True. forces mrm_read_river_network = .True. !----------------------------------------------------------------------------- read_restart = .True. -mrm_read_restart = .False. +mrm_read_river_network = .False. !----------------------------------------------------------------------------- !> flag for optimization: .TRUE.: optimization !> or .FALSE.: no optimazition From 28d11d85f56d599d48811dd948163be76c988569 Mon Sep 17 00:00:00 2001 From: kaluza Date: Thu, 5 Mar 2020 14:00:11 +0100 Subject: [PATCH 4/7] BUGFIX: on reading the restart config file for mrm now the correct domainID is set for the parallel case --- src/mRM/mo_mrm_init.f90 | 2 +- src/mRM/mo_mrm_restart.f90 | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mRM/mo_mrm_init.f90 b/src/mRM/mo_mrm_init.f90 index a239583d..fdc703f4 100644 --- a/src/mRM/mo_mrm_init.f90 +++ b/src/mRM/mo_mrm_init.f90 @@ -169,7 +169,7 @@ subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_par call read_grid_info(domainID, dirRestartIn(iDomain), "1", "mRM", level1(iDomain)) end if call read_grid_info(domainID, dirRestartIn(iDomain), "11", "mRM", level11(iDomain)) - call mrm_read_restart_config(iDomain, dirRestartIn(iDomain)) + call mrm_read_restart_config(iDomain, domainID, dirRestartIn(iDomain)) else if (iDomain .eq. 1) then call L0_check_input_routing(domainMeta%L0DataFrom(iDomain)) diff --git a/src/mRM/mo_mrm_restart.f90 b/src/mRM/mo_mrm_restart.f90 index d16114a9..651e27d9 100644 --- a/src/mRM/mo_mrm_restart.f90 +++ b/src/mRM/mo_mrm_restart.f90 @@ -599,7 +599,7 @@ end subroutine mrm_read_restart_states ! Robert Schweppe Jun 2018 - refactoring and reformatting ! Stephan Thober May 2019 - added L0 info required for Process 3 - subroutine mrm_read_restart_config(iDomain, InPath) + subroutine mrm_read_restart_config(iDomain, domainID, InPath) use mo_append, only : append use mo_common_constants, only : nodata_dp @@ -620,6 +620,9 @@ subroutine mrm_read_restart_config(iDomain, InPath) ! number of Domain integer(i4), intent(in) :: iDomain + ! domain + integer(i4), intent(in) :: domainID + ! Input Path including trailing slash character(256), intent(in) :: InPath @@ -650,7 +653,7 @@ subroutine mrm_read_restart_config(iDomain, InPath) ! set file name - fname = trim(InPath) // 'mRM_restart_' // trim(num2str(iDomain, '(i3.3)')) // '.nc' + fname = trim(InPath) // 'mRM_restart_' // trim(num2str(domainID, '(i3.3)')) // '.nc' call message(' Reading mRM restart file: ', trim(adjustl(Fname)), ' ...') ! get Domain info at L11 mask From faba8846d42e040403689f14be8159a6ed6adaeb Mon Sep 17 00:00:00 2001 From: Maren Kaluza Date: Mon, 30 Mar 2020 15:06:31 +0200 Subject: [PATCH 5/7] changed to reading seperate files instead of constructing it with dirs for restart also, grid_info neaded the specification for mHM or mRM before. This is not neccessary anymore. --- src/common/mo_common_restart.f90 | 11 ++++------- .../mo_common_mHM_mRM_read_config.f90 | 14 +++++++++----- .../mo_common_mHM_mRM_variables.f90 | 3 ++- src/mHM/mo_mhm_eval.f90 | 7 ++++--- src/mHM/mo_restart.f90 | 8 ++++---- src/mHM/mo_startup.f90 | 4 ++-- src/mRM/mo_mrm_eval.f90 | 5 +++-- src/mRM/mo_mrm_init.f90 | 12 ++++++------ src/mRM/mo_mrm_restart.f90 | 16 ++++++++-------- 9 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/common/mo_common_restart.f90 b/src/common/mo_common_restart.f90 index fc53868e..5f13318b 100644 --- a/src/common/mo_common_restart.f90 +++ b/src/common/mo_common_restart.f90 @@ -141,7 +141,7 @@ end subroutine write_grid_info ! INTENT(IN) !> \param[in] "integer(i4) :: iDomain" number of domain - !> \param[in] "character(256) :: InPath" Input Path including trailing slash + !> \param[in] "character(256) :: InFile" Input Path including trailing slash !> \param[in] "character(*) :: level_name" level_name (id) !> \param[in] "character(*) :: fname_part" filename part (either "mHM" or "mRM") @@ -160,7 +160,7 @@ end subroutine write_grid_info ! Robert Schweppe Jun 2018 - refactoring and reformatting ! Stephan Thober May 2019 - added allocation check for mask and cellArea because cellArea needs to be read by mRM, but mask is created before by mHM - subroutine read_grid_info(domainID, InPath, level_name, fname_part, new_grid) + subroutine read_grid_info(domainID, InFile, level_name, new_grid) use mo_common_variables, only : Grid use mo_kind, only : dp, i4 @@ -174,14 +174,11 @@ subroutine read_grid_info(domainID, InPath, level_name, fname_part, new_grid) integer(i4), intent(in) :: domainID ! Input Path including trailing slash - character(256), intent(in) :: InPath + character(256), intent(in) :: InFile ! level_name (id) character(*), intent(in) :: level_name - ! filename part (either "mHM" or "mRM") - character(*), intent(in) :: fname_part - ! grid to save information to type(Grid), intent(inout) :: new_grid @@ -201,7 +198,7 @@ subroutine read_grid_info(domainID, InPath, level_name, fname_part, new_grid) ! read config - fname = trim(InPath) // trim(fname_part) // '_restart_' // trim(num2str(domainID, '(i3.3)')) // '.nc' ! '_restart.nc' + fname = trim(InFile) call message(' Reading config from ', trim(adjustl(Fname)), ' ...') nc = NcDataset(fname, "r") diff --git a/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 b/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 index eb30dd08..93f4b5dc 100644 --- a/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 +++ b/src/common_mHM_mRM/mo_common_mHM_mRM_read_config.f90 @@ -49,7 +49,8 @@ MODULE mo_common_mHM_mRM_read_config subroutine common_mHM_mRM_read_config(file_namelist, unamelist) use mo_common_constants, only : maxNoDomains - use mo_common_mHM_mRM_variables, only : LCyearId, dds_r, dirRestartIn, evalPer, mcmc_error_params, mcmc_opti, nIterations, & + use mo_common_mHM_mRM_variables, only : LCyearId, dds_r, mhmFileRestartIn, mrmFileRestartIn, evalPer,& + mcmc_error_params, mcmc_opti, nIterations, & nTStepDay, opti_function, opti_method, optimize, optimize_restart, & read_restart, mrm_read_river_network, resolutionRouting, sa_temp, & sce_ngs, sce_npg, sce_nps, seed, & @@ -77,13 +78,14 @@ subroutine common_mHM_mRM_read_config(file_namelist, unamelist) real(dp), dimension(maxNoDomains) :: resolution_Routing - character(256), dimension(maxNoDomains) :: dir_RestartIn + character(256), dimension(maxNoDomains) :: mhm_file_RestartIn + character(256), dimension(maxNoDomains) :: mrm_file_RestartIn ! namelist spatial & temporal resolution, otmization information namelist /mainconfig_mhm_mrm/ timestep, resolution_Routing, optimize, & optimize_restart, opti_method, opti_function, & - read_restart, mrm_read_river_network, dir_RestartIn + read_restart, mrm_read_river_network, mhm_file_RestartIn, mrm_file_RestartIn ! namelist for optimization settings namelist /Optimization/ nIterations, seed, dds_r, sa_temp, sce_ngs, & sce_npg, sce_nps, mcmc_opti, mcmc_error_params @@ -112,10 +114,12 @@ subroutine common_mHM_mRM_read_config(file_namelist, unamelist) end if allocate(resolutionRouting(domainMeta%nDomains)) - allocate(dirRestartIn(domainMeta%nDomains)) + allocate(mhmFileRestartIn(domainMeta%nDomains)) + allocate(mrmFileRestartIn(domainMeta%nDomains)) do iDomain = 1, domainMeta%nDomains domainID = domainMeta%indices(iDomain) - dirRestartIn(iDomain) = dir_RestartIn(domainID) + mhmFileRestartIn(iDomain) = mhm_file_RestartIn(domainID) + mrmFileRestartIn(iDomain) = mrm_file_RestartIn(domainID) resolutionRouting(iDomain) = resolution_Routing(domainID) end do diff --git a/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 b/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 index aafbff14..b0e71227 100644 --- a/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 +++ b/src/common_mHM_mRM/mo_common_mHM_mRM_variables.f90 @@ -50,7 +50,8 @@ module mo_common_mHM_mRM_variables ! DIRECTORIES ! ------------------------------------------------------------------ ! has the dimension of nDomains - character(256), dimension(:), allocatable, public :: dirRestartIn! Directory where input of restart is read from + character(256), dimension(:), allocatable, public :: mhmFileRestartIn! Directory where input of restart is read from + character(256), dimension(:), allocatable, public :: mrmFileRestartIn! Directory where input of restart is read from ! ------------------------------------------------------------------- ! OPTIMIZATION diff --git a/src/mHM/mo_mhm_eval.f90 b/src/mHM/mo_mhm_eval.f90 index 554c1007..e7078331 100644 --- a/src/mHM/mo_mhm_eval.f90 +++ b/src/mHM/mo_mhm_eval.f90 @@ -84,7 +84,8 @@ SUBROUTINE mhm_eval(parameterset, opti_domain_indices, runoff, smOptiSim, neutro use mo_common_constants, only : nodata_dp use mo_optimization_types, only : optidata_sim - use mo_common_mHM_mRM_variables, only : LCyearId, dirRestartIn, nTstepDay, optimize, readPer, read_restart, simPer, timeStep, & + use mo_common_mHM_mRM_variables, only : LCyearId, mhmFileRestartIn, mrmFileRestartIn, nTstepDay,& + optimize, readPer, read_restart, simPer, timeStep, & warmingDays, c2TSTu use mo_common_variables, only : level1, domainMeta, processMatrix use mo_global_variables, only : L1_Throughfall, L1_aETCanopy, L1_aETSealed, L1_aETSoil, & @@ -303,7 +304,7 @@ SUBROUTINE mhm_eval(parameterset, opti_domain_indices, runoff, smOptiSim, neutro end if domainID = domainMeta%indices(iDomain) ! this reads the eff. parameters and optionally the states and fluxes - call read_restart_states(iDomain, domainID, dirRestartIn(iDomain)) + call read_restart_states(iDomain, domainID, mhmFileRestartIn(iDomain)) end do end if @@ -364,7 +365,7 @@ SUBROUTINE mhm_eval(parameterset, opti_domain_indices, runoff, smOptiSim, neutro #ifdef MRM2MHM if (domainMeta%doRouting(iDomain)) then ! read states from restart - if (read_restart) call mrm_read_restart_states(iDomain, domainID, dirRestartIn(iDomain)) + if (read_restart) call mrm_read_restart_states(iDomain, domainID, mrmFileRestartIn(iDomain)) ! ! get Domain information at L11 and L110 if routing is activated s11 = level11(iDomain)%iStart diff --git a/src/mHM/mo_restart.f90 b/src/mHM/mo_restart.f90 index 422d1a6a..9840cf9e 100644 --- a/src/mHM/mo_restart.f90 +++ b/src/mHM/mo_restart.f90 @@ -328,7 +328,7 @@ end subroutine write_restart_files ! INTENT(IN) !> \param[in] "integer(i4) :: iDomain" number of domains - !> \param[in] "character(256) :: InPath" Input Path including trailing slash + !> \param[in] "character(256) :: InFile" Input Path including trailing slash ! HISTORY !> \authors Stephan Thober @@ -341,7 +341,7 @@ end subroutine write_restart_files ! Stephan Thober Nov 2016 - moved processMatrix to common variables ! Robert Schweppe Jun 2018 - refactoring and reformatting - subroutine read_restart_states(iDomain, domainID, InPath) + subroutine read_restart_states(iDomain, domainID, InFile) use mo_common_variables, only : LC_year_end, LC_year_start, level1, nLCoverScene, processMatrix use mo_global_variables, only : L1_Inter, L1_Throughfall, L1_aETCanopy, & @@ -368,7 +368,7 @@ subroutine read_restart_states(iDomain, domainID, InPath) integer(i4), intent(in) :: domainID ! Input Path including trailing slash - character(256), intent(in) :: InPath + character(256), intent(in) :: InFile character(256) :: Fname @@ -404,7 +404,7 @@ subroutine read_restart_states(iDomain, domainID, InPath) LAIBoundaries_temp - Fname = trim(InPath) // 'mHM_restart_' // trim(num2str(domainID, '(i3.3)')) // '.nc' + Fname = trim(InFile) ! call message(' Reading states from ', trim(adjustl(Fname)),' ...') ! get domain information at level 1 diff --git a/src/mHM/mo_startup.f90 b/src/mHM/mo_startup.f90 index 4b0e4882..2219279e 100644 --- a/src/mHM/mo_startup.f90 +++ b/src/mHM/mo_startup.f90 @@ -69,7 +69,7 @@ MODULE mo_startup subroutine mhm_initialize - use mo_common_mHM_mRM_variables, only : dirRestartIn, read_restart + use mo_common_mHM_mRM_variables, only : mhmFileRestartIn, read_restart use mo_common_restart, only : read_grid_info use mo_common_variables, only : level0, level1, domainMeta use mo_global_variables, only : level2 @@ -98,7 +98,7 @@ subroutine mhm_initialize if (read_restart) then ! this reads only the domain properties - call read_grid_info(domainID, dirRestartIn(iDomain), "1", "mHM", level1(iDomain)) + call read_grid_info(domainID, mhmFileRestartIn(iDomain), "1", level1(iDomain)) ! Parameter fields have to be allocated in any case call init_eff_params(level1(iDomain)%nCells) end if diff --git a/src/mRM/mo_mrm_eval.f90 b/src/mRM/mo_mrm_eval.f90 index b7ba705a..a75b1b32 100644 --- a/src/mRM/mo_mrm_eval.f90 +++ b/src/mRM/mo_mrm_eval.f90 @@ -53,7 +53,8 @@ subroutine mrm_eval(parameterset, opti_domain_indices, runoff, smOptiSim, neutro use mo_optimization_types, only : optidata_sim use mo_common_constants, only : HourSecs - use mo_common_mHM_mRM_variables, only : LCYearId, dirRestartIn, nTStepDay, optimize, read_restart, resolutionRouting, simPer, & + use mo_common_mHM_mRM_variables, only : LCYearId, mrmFileRestartIn, nTStepDay, optimize,& + read_restart, resolutionRouting, simPer, & timestep, warmingDays use mo_common_variables, only : level1, domainMeta, processMatrix, resolutionHydrology use mo_julian, only : caldat, julday @@ -188,7 +189,7 @@ subroutine mrm_eval(parameterset, opti_domain_indices, runoff, smOptiSim, neutro end if domainID = domainMeta%indices(iDomain) ! read states from restart - if (read_restart) call mrm_read_restart_states(iDomain, domainID, dirRestartIn(iDomain)) + if (read_restart) call mrm_read_restart_states(iDomain, domainID, mrmFileRestartIn(iDomain)) ! ! get domain information at L11 and L1 if routing is activated s1 = level1(iDomain)%iStart diff --git a/src/mRM/mo_mrm_init.f90 b/src/mRM/mo_mrm_init.f90 index fdc703f4..87232e43 100644 --- a/src/mRM/mo_mrm_init.f90 +++ b/src/mRM/mo_mrm_init.f90 @@ -103,7 +103,7 @@ end subroutine mrm_configuration subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_param, ReadLatLon) use mo_common_constants, only : nodata_dp, nodata_i4 - use mo_common_mHM_mRM_variables, only : dirRestartIn, mrm_coupling_mode, mrm_read_river_network, & + use mo_common_mHM_mRM_variables, only : mrmFileRestartIn, mrm_coupling_mode, mrm_read_river_network, & resolutionRouting use mo_common_restart, only : read_grid_info use mo_common_variables, only : domainMeta, global_parameters, l0_l1_remap, level0, level1, domainMeta, & @@ -163,13 +163,13 @@ subroutine mrm_init(file_namelist, unamelist, file_namelist_param, unamelist_par ! this reads the domain properties if (.not. allocated(level0)) allocate(level0(domainMeta%nDomains)) ! ToDo: L0_Domain, parallel - call read_grid_info(domainMeta%indices(domainMeta%L0DataFrom(iDomain)), dirRestartIn(iDomain), & - "0", "mRM", level0(domainMeta%L0DataFrom(iDomain))) + call read_grid_info(domainMeta%indices(domainMeta%L0DataFrom(iDomain)), mrmFileRestartIn(iDomain), & + "0", level0(domainMeta%L0DataFrom(iDomain))) if (mrm_coupling_mode .eq. 0_i4) then - call read_grid_info(domainID, dirRestartIn(iDomain), "1", "mRM", level1(iDomain)) + call read_grid_info(domainID, mrmFileRestartIn(iDomain), "1", level1(iDomain)) end if - call read_grid_info(domainID, dirRestartIn(iDomain), "11", "mRM", level11(iDomain)) - call mrm_read_restart_config(iDomain, domainID, dirRestartIn(iDomain)) + call read_grid_info(domainID, mrmFileRestartIn(iDomain), "11", level11(iDomain)) + call mrm_read_restart_config(iDomain, domainID, mrmFileRestartIn(iDomain)) else if (iDomain .eq. 1) then call L0_check_input_routing(domainMeta%L0DataFrom(iDomain)) diff --git a/src/mRM/mo_mrm_restart.f90 b/src/mRM/mo_mrm_restart.f90 index 651e27d9..43efd890 100644 --- a/src/mRM/mo_mrm_restart.f90 +++ b/src/mRM/mo_mrm_restart.f90 @@ -445,7 +445,7 @@ end subroutine mrm_write_restart ! INTENT(IN) !> \param[in] "integer(i4) :: iDomain" number of domains - !> \param[in] "character(256) :: InPath" Input Path including trailing slash + !> \param[in] "character(256) :: InFile" Input Path including trailing slash ! HISTORY !> \authors Stephan Thober @@ -457,7 +457,7 @@ end subroutine mrm_write_restart ! Stephan Thober May 2016 - split L0_OutletCoord into L0_rowOutlet & L0_colOutlet because multiple outlets could exist ! Robert Schweppe Jun 2018 - refactoring and reformatting - subroutine mrm_read_restart_states(iDomain, domainID, InPath) + subroutine mrm_read_restart_states(iDomain, domainID, InFile) use mo_common_variables, only : nLCoverScene use mo_mrm_constants, only : nRoutingStates @@ -474,7 +474,7 @@ subroutine mrm_read_restart_states(iDomain, domainID, InPath) integer(i4), intent(in) :: domainID ! Input Path including trailing slash - character(256), intent(in) :: InPath + character(256), intent(in) :: InFile integer(i4) :: ii @@ -501,7 +501,7 @@ subroutine mrm_read_restart_states(iDomain, domainID, InPath) ! set file name - fname = trim(InPath) // 'mRM_restart_' // trim(num2str(domainID, '(i3.3)')) // '.nc' + fname = trim(InFile) ! get Domain info at L11 including ncells, start, end, and mask s11 = level11(iDomain)%iStart @@ -582,7 +582,7 @@ end subroutine mrm_read_restart_states ! INTENT(IN) !> \param[in] "integer(i4) :: iDomain" number of Domain - !> \param[in] "character(256) :: InPath" Input Path including trailing slash + !> \param[in] "character(256) :: InFile" Input Path including trailing slash ! HISTORY !> \authors Stephan Thober @@ -599,7 +599,7 @@ end subroutine mrm_read_restart_states ! Robert Schweppe Jun 2018 - refactoring and reformatting ! Stephan Thober May 2019 - added L0 info required for Process 3 - subroutine mrm_read_restart_config(iDomain, domainID, InPath) + subroutine mrm_read_restart_config(iDomain, domainID, InFile) use mo_append, only : append use mo_common_constants, only : nodata_dp @@ -624,7 +624,7 @@ subroutine mrm_read_restart_config(iDomain, domainID, InPath) integer(i4), intent(in) :: domainID ! Input Path including trailing slash - character(256), intent(in) :: InPath + character(256), intent(in) :: InFile character(256) :: fname @@ -653,7 +653,7 @@ subroutine mrm_read_restart_config(iDomain, domainID, InPath) ! set file name - fname = trim(InPath) // 'mRM_restart_' // trim(num2str(domainID, '(i3.3)')) // '.nc' + fname = trim(InFile) call message(' Reading mRM restart file: ', trim(adjustl(Fname)), ' ...') ! get Domain info at L11 mask From 35ef8d37b36e543518c9feac9a16d969f35f5316 Mon Sep 17 00:00:00 2001 From: Maren Kaluza Date: Mon, 30 Mar 2020 16:00:18 +0200 Subject: [PATCH 6/7] second part: write out restartfiles now also uses filename --- src/MPR/mo_mpr_restart.f90 | 8 ++++---- src/MPR/mpr_driver.f90 | 4 ++-- src/common/mo_common_read_config.f90 | 15 ++++++++++----- src/common/mo_common_restart.f90 | 1 - src/common/mo_common_variables.f90 | 3 ++- src/mHM/mhm_driver.f90 | 4 ++-- src/mHM/mo_restart.f90 | 8 ++++---- src/mHM/mo_write_ascii.f90 | 4 ++-- src/mRM/mo_mrm_restart.f90 | 8 ++++---- src/mRM/mo_mrm_write.f90 | 8 ++++---- 10 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/MPR/mo_mpr_restart.f90 b/src/MPR/mo_mpr_restart.f90 index 8ef96e44..34a6de4d 100644 --- a/src/MPR/mo_mpr_restart.f90 +++ b/src/MPR/mo_mpr_restart.f90 @@ -82,7 +82,7 @@ MODULE mo_mpr_restart !> write_restart ! INTENT(IN) - !> \param[in] "character(256), dimension(:) :: OutPath" Output Path for each domain + !> \param[in] "character(256), dimension(:) :: OutFile" Output Path for each domain ! HISTORY !> \authors Stephan Thober @@ -95,7 +95,7 @@ MODULE mo_mpr_restart ! Stephan Thober Nov 2016 - moved processMatrix to common variables ! Zink M. Demirel C. Mar 2017 - Added Jarvis soil water stress function at SM process(3) - subroutine write_mpr_restart_files(OutPath) + subroutine write_mpr_restart_files(OutFile) use mo_common_restart, only : write_grid_info use mo_common_variables, only : level1, nLCoverScene, domainMeta, LC_year_start, LC_year_end @@ -111,7 +111,7 @@ subroutine write_mpr_restart_files(OutPath) character(256) :: Fname ! Output Path for each domain - character(256), dimension(:), intent(in) :: OutPath + character(256), dimension(:), intent(in) :: OutFile integer(i4) :: iDomain, domainID @@ -135,7 +135,7 @@ subroutine write_mpr_restart_files(OutPath) domainID = domainMeta%indices(iDomain) ! write restart file for iDomain - Fname = trim(OutPath(iDomain)) // "mHM_restart_" // trim(num2str(domainID, "(i3.3)")) // ".nc" + Fname = trim(OutFile(iDomain)) ! print a message call message(" Writing Restart-file: ", trim(adjustl(Fname)), " ...") diff --git a/src/MPR/mpr_driver.f90 b/src/MPR/mpr_driver.f90 index 2bfa9f0f..331b5847 100644 --- a/src/MPR/mpr_driver.f90 +++ b/src/MPR/mpr_driver.f90 @@ -63,7 +63,7 @@ program mpr_driver use mo_read_wrapper, only : read_data use mo_mpr_read_config, only : mpr_read_config USE mo_common_read_config, ONLY : common_read_config ! Read main configuration files - use mo_common_variables, only : dirRestartOut, write_restart + use mo_common_variables, only : mhmFileRestartOut, write_restart use mo_timer, only : timers_init use mo_mpr_startup, only : mpr_initialize use mo_mpr_restart, only : write_mpr_restart_files @@ -96,7 +96,7 @@ program mpr_driver ! WRITE OUTPUT ! -------------------------------------------------------------------------- if (write_restart) then - call write_mpr_restart_files(dirRestartOut) + call write_mpr_restart_files(mhmFileRestartOut) end if ! -------------------------------------------------------------------------- ! FINISH UP diff --git a/src/common/mo_common_read_config.f90 b/src/common/mo_common_read_config.f90 index 5c34f8e2..d9bea510 100644 --- a/src/common/mo_common_read_config.f90 +++ b/src/common/mo_common_read_config.f90 @@ -51,7 +51,8 @@ subroutine common_read_config(file_namelist, unamelist) use mo_common_constants, only : maxNLcovers, maxNoDomains use mo_common_variables, only : Conventions, LC_year_end, LC_year_start, LCfilename, contact, & - dirCommonFiles, dirConfigOut, dirLCover, dirMorpho, dirOut, dirRestartOut, & + dirCommonFiles, dirConfigOut, dirLCover, dirMorpho, dirOut, & + mhmFileRestartOut, mrmFileRestartOut, & fileLatLon, history, iFlag_cordinate_sys, mHM_details, domainMeta, nLcoverScene, & nProcesses, nuniqueL0Domains, processMatrix, project_details, resolutionHydrology, & setup_description, simulation_type, write_restart @@ -72,7 +73,9 @@ subroutine common_read_config(file_namelist, unamelist) character(256), dimension(maxNoDomains) :: dir_Morpho - character(256), dimension(maxNoDomains) :: dir_RestartOut + character(256), dimension(maxNoDomains) :: mhm_file_RestartOut + + character(256), dimension(maxNoDomains) :: mrm_file_RestartOut character(256), dimension(maxNoDomains) :: dir_LCover @@ -107,7 +110,7 @@ subroutine common_read_config(file_namelist, unamelist) Conventions, contact, mHM_details, history namelist /directories_general/ dirConfigOut, dirCommonFiles, & dir_Morpho, dir_LCover, & - dir_Out, dir_RestartOut, & + dir_Out, mhm_file_RestartOut, mrm_file_RestartOut, & file_LatLon ! namelist spatial & temporal resolution, optimization information namelist /mainconfig/ iFlag_cordinate_sys, resolution_Hydrology, nDomains, L0Domain, write_restart, & @@ -146,7 +149,8 @@ subroutine common_read_config(file_namelist, unamelist) ! allocate patharray sizes allocate(resolutionHydrology(domainMeta%nDomains)) allocate(dirMorpho(domainMeta%nDomains)) - allocate(dirRestartOut(domainMeta%nDomains)) + allocate(mhmFileRestartOut(domainMeta%nDomains)) + allocate(mrmFileRestartOut(domainMeta%nDomains)) allocate(dirLCover(domainMeta%nDomains)) allocate(dirOut(domainMeta%nDomains)) allocate(fileLatLon(domainMeta%nDomains)) @@ -205,7 +209,8 @@ subroutine common_read_config(file_namelist, unamelist) domainID = domainMeta%indices(iDomain) domainMeta%optidata(iDomain) = read_opt_domain_data(domainID) dirMorpho(iDomain) = dir_Morpho(domainID) - dirRestartOut(iDomain) = dir_RestartOut(domainID) + mhmFileRestartOut(iDomain) = mhm_file_RestartOut(domainID) + mrmFileRestartOut(iDomain) = mrm_file_RestartOut(domainID) dirLCover(iDomain) = dir_LCover(domainID) dirOut(iDomain) = dir_Out(domainID) fileLatLon(iDomain) = file_LatLon(domainID) diff --git a/src/common/mo_common_restart.f90 b/src/common/mo_common_restart.f90 index 5f13318b..17c1112f 100644 --- a/src/common/mo_common_restart.f90 +++ b/src/common/mo_common_restart.f90 @@ -143,7 +143,6 @@ end subroutine write_grid_info !> \param[in] "integer(i4) :: iDomain" number of domain !> \param[in] "character(256) :: InFile" Input Path including trailing slash !> \param[in] "character(*) :: level_name" level_name (id) - !> \param[in] "character(*) :: fname_part" filename part (either "mHM" or "mRM") ! INTENT(INOUT) !> \param[inout] "type(Grid) :: new_grid" grid to save information to diff --git a/src/common/mo_common_variables.f90 b/src/common/mo_common_variables.f90 index d5123dd2..b8bf36fb 100644 --- a/src/common/mo_common_variables.f90 +++ b/src/common/mo_common_variables.f90 @@ -46,7 +46,8 @@ module mo_common_variables ! DIRECTORIES ! ------------------------------------------------------------------ ! has the dimension of nDomains - character(256), dimension(:), allocatable, public :: dirRestartOut ! Directory where output of restart is written + character(256), dimension(:), allocatable, public :: mhmFileRestartOut ! Directory where output of restart is written + character(256), dimension(:), allocatable, public :: mrmFileRestartOut ! Directory where output of restart is written character(256), public :: dirConfigOut character(256), public :: dirCommonFiles ! directory where common input files should be located character(256), dimension(:), allocatable, public :: dirMorpho ! Directory where morphological files are located diff --git a/src/mHM/mhm_driver.f90 b/src/mHM/mhm_driver.f90 index e91f8c50..d75f89a0 100644 --- a/src/mHM/mhm_driver.f90 +++ b/src/mHM/mhm_driver.f90 @@ -105,7 +105,7 @@ PROGRAM mhm_driver mrm_coupling_mode USE mo_common_variables, ONLY : & write_restart, & ! restart writing flags - dirRestartOut, & + mhmFileRestartOut, & dirConfigOut, & dirMorpho, dirLCover, & ! directories dirOut, & ! directories @@ -459,7 +459,7 @@ PROGRAM mhm_driver call message() call message(' Write restart file') call timer_start(itimer) - call write_restart_files(dirRestartOut) + call write_restart_files(mhmFileRestartOut) call timer_stop(itimer) call message(' in ', trim(num2str(timer_get(itimer), '(F9.3)')), ' seconds.') end if diff --git a/src/mHM/mo_restart.f90 b/src/mHM/mo_restart.f90 index 9840cf9e..f59b0799 100644 --- a/src/mHM/mo_restart.f90 +++ b/src/mHM/mo_restart.f90 @@ -81,7 +81,7 @@ MODULE mo_restart !> in the read restart routines below. ! INTENT(IN) - !> \param[in] "character(256), dimension(:) :: OutPath" Output Path for each domain + !> \param[in] "character(256), dimension(:) :: OutFile" Output Path for each domain ! HISTORY !> \authors Stephan Thober @@ -96,7 +96,7 @@ MODULE mo_restart ! Robert Schweppe Feb 2018 - Removed all L0 references ! Robert Schweppe Jun 2018 - refactoring and reformatting - subroutine write_restart_files(OutPath) + subroutine write_restart_files(OutFile) use mo_common_constants, only : nodata_dp use mo_common_restart, only : write_grid_info @@ -117,7 +117,7 @@ subroutine write_restart_files(OutPath) character(256) :: Fname ! Output Path for each domain - character(256), dimension(:), intent(in) :: OutPath + character(256), dimension(:), intent(in) :: OutFile integer(i4) :: iDomain, domainID @@ -152,7 +152,7 @@ subroutine write_restart_files(OutPath) domainID = domainMeta%indices(iDomain) ! write restart file for iDomain - Fname = trim(OutPath(iDomain)) // "mHM_restart_" // trim(num2str(domainID, "(i3.3)")) // ".nc" + Fname = trim(OutFile(iDomain)) ! print a message call message(" Writing Restart-file: ", trim(adjustl(Fname)), " ...") diff --git a/src/mHM/mo_write_ascii.f90 b/src/mHM/mo_write_ascii.f90 index a2a94c22..fb6bc82b 100644 --- a/src/mHM/mo_write_ascii.f90 +++ b/src/mHM/mo_write_ascii.f90 @@ -87,7 +87,7 @@ Subroutine write_configfile use mo_common_file, only : file_config, uconfig use mo_common_mHM_mRM_variables, only : LCyearId, SimPer, evalPer, read_restart, timeStep, warmPer use mo_common_variables, only : LC_year_end, & - LC_year_start, LCfilename, dirConfigOut, dirLCover, dirMorpho, dirOut, dirRestartOut, & + LC_year_start, LCfilename, dirConfigOut, dirLCover, dirMorpho, dirOut, mhmFileRestartOut, & global_parameters, global_parameters_name, iFlag_cordinate_sys, level0, level1, & domainMeta, nLCoverScene, resolutionHydrology, write_restart use mo_file, only : version @@ -271,7 +271,7 @@ Subroutine write_configfile write(uconfig, 224) 'Directory to temperature input ', dirTemperature(iDomain) write(uconfig, 224) 'Directory to reference ET input ', dirReferenceET(iDomain) write(uconfig, 224) 'Directory to write output by default ', dirOut(iDomain) - write(uconfig, 224) 'Directory to write output when restarted ', dirRestartOut(iDomain) + write(uconfig, 224) 'File to write mHM output when restarted ', mhmFileRestartOut(iDomain) #ifdef MRM2MHM if (domainMeta%doRouting(iDomain)) then diff --git a/src/mRM/mo_mrm_restart.f90 b/src/mRM/mo_mrm_restart.f90 index 43efd890..5f04f472 100644 --- a/src/mRM/mo_mrm_restart.f90 +++ b/src/mRM/mo_mrm_restart.f90 @@ -32,7 +32,7 @@ module mo_mrm_restart ! INTENT(IN) !> \param[in] "integer(i4) :: iDomain" number of domain - !> \param[in] "character(256), dimension(:) :: OutPath" list of Output paths per Domain + !> \param[in] "character(256), dimension(:) :: OutFile" list of Output paths per Domain ! HISTORY !> \authors Stephan Thober @@ -52,7 +52,7 @@ module mo_mrm_restart ! Stephan Thober Jun 2018 - including varying celerity functionality ! Stephan Thober May 2019 - added L0 info required for Process 3 - subroutine mrm_write_restart(iDomain, domainID, OutPath) + subroutine mrm_write_restart(iDomain, domainID, OutFile) use mo_common_constants, only : nodata_dp, nodata_i4 use mo_common_restart, only : write_grid_info @@ -82,7 +82,7 @@ subroutine mrm_write_restart(iDomain, domainID, OutPath) integer(i4), intent(in) :: domainID ! list of Output paths per Domain - character(256), dimension(:), intent(in) :: OutPath + character(256), dimension(:), intent(in) :: OutFile character(256) :: Fname @@ -156,7 +156,7 @@ subroutine mrm_write_restart(iDomain, domainID, OutPath) allocate(dummy_d3(nrows11, ncols11, nRoutingStates)) ! set restart file name - Fname = trim(OutPath(iDomain)) // 'mRM_restart_' // trim(num2str(domainID, '(i3.3)')) // '.nc' + Fname = trim(OutFile(iDomain)) call message(' Writing mRM restart file to ' // trim(Fname) // ' ...') diff --git a/src/mRM/mo_mrm_write.f90 b/src/mRM/mo_mrm_write.f90 index d6863533..ce8f84c4 100644 --- a/src/mRM/mo_mrm_write.f90 +++ b/src/mRM/mo_mrm_write.f90 @@ -59,7 +59,7 @@ module mo_mrm_write subroutine mrm_write use mo_common_mhm_mrm_variables, only : evalPer, mrm_coupling_mode, nTstepDay, simPer, warmingDays - use mo_common_variables, only : dirRestartOut, domainMeta, write_restart + use mo_common_variables, only : mrmFileRestartOut, domainMeta, write_restart use mo_mrm_global_variables, only : domain_mrm, & gauge, mRM_runoff, nGaugesTotal use mo_mrm_restart, only : mrm_write_restart @@ -92,7 +92,7 @@ subroutine mrm_write if (write_restart) then do iDomain = 1, domainMeta%nDomains domainID = domainMeta%indices(iDomain) - if (domainMeta%doRouting(iDomain)) call mrm_write_restart(iDomain, domainID, dirRestartOut) + if (domainMeta%doRouting(iDomain)) call mrm_write_restart(iDomain, domainID, mrmFileRestartOut) end do end if @@ -165,7 +165,7 @@ Subroutine write_configfile use mo_common_mHM_mRM_variables, only : LCyearId, SimPer, evalPer, mrm_coupling_mode, read_restart, & resolutionRouting, timeStep, warmPer use mo_common_variables, only : LC_year_end, LC_year_start, LCfilename, & - dirConfigOut, dirLCover, dirMorpho, dirOut, dirRestartOut, global_parameters, & + dirConfigOut, dirLCover, dirMorpho, dirOut, mrmFileRestartOut, global_parameters, & global_parameters_name, level0, level1, domainMeta, nLCoverScene, processMatrix, & resolutionHydrology, write_restart use mo_kind, only : dp, i4 @@ -313,7 +313,7 @@ Subroutine write_configfile write(uconfig, 224) 'Directory to simulated runoff input ', dirTotalRunoff(iDomain) end if write(uconfig, 224) 'Directory to write output by default ', dirOut(iDomain) - write(uconfig, 224) 'Directory to write output when restarted ', dirRestartOut(iDomain) + write(uconfig, 224) 'File to write mRM output when restarted ', mrmFileRestartOut(iDomain) write(uconfig, 102) 'River Network (Routing level)' write(uconfig, 100) 'Label 0 = intermediate draining cell ' From 9f5056ddf1c7184775c1d6a7c8214038f607f8dd Mon Sep 17 00:00:00 2001 From: Maren Kaluza Date: Tue, 31 Mar 2020 11:12:06 +0200 Subject: [PATCH 7/7] adopted checkcases to new restart file names --- check/case_00/mhm.nml | 6 ++++-- check/case_01/mhm.nml | 6 ++++-- check/case_02/mhm.nml | 6 ++++-- check/case_03/mhm.nml | 6 ++++-- check/case_04/mhm.nml | 17 ++++++++++++----- check/case_05/mhm.nml | 5 ++--- check/case_06/mhm.nml | 6 ++++-- check/case_07/mhm.nml | 6 ++++-- check/case_08/mhm.nml | 6 ++++-- check/case_09/mhm.nml | 6 ++++-- check/case_10/mhm.nml | 6 ++++-- check/case_11/mhm.nml | 11 ++++++----- check/case_mrm_01/mrm.nml | 10 ++++++---- mhm.nml | 14 +++++++++----- .../restart/{restart => }/mHM_restart_002.nc | Bin .../restart/{restart => }/mRM_restart_002.nc | Bin 16 files changed, 71 insertions(+), 40 deletions(-) rename test_domain_2/restart/{restart => }/mHM_restart_002.nc (100%) rename test_domain_2/restart/{restart => }/mRM_restart_002.nc (100%) diff --git a/check/case_00/mhm.nml b/check/case_00/mhm.nml index a93b413e..7f768f69 100755 --- a/check/case_00/mhm.nml +++ b/check/case_00/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 3 opti_method = 1 optimize = .false. diff --git a/check/case_01/mhm.nml b/check/case_01/mhm.nml index 6c569107..516145e1 100755 --- a/check/case_01/mhm.nml +++ b/check/case_01/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 3 opti_method = 1 optimize = .false. diff --git a/check/case_02/mhm.nml b/check/case_02/mhm.nml index 6cb9c98b..eda3dbe0 100755 --- a/check/case_02/mhm.nml +++ b/check/case_02/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 3 opti_method = 1 optimize = .false. diff --git a/check/case_03/mhm.nml b/check/case_03/mhm.nml index e97bf2cd..afbc5205 100755 --- a/check/case_03/mhm.nml +++ b/check/case_03/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 3 opti_method = 1 optimize = .true. diff --git a/check/case_04/mhm.nml b/check/case_04/mhm.nml index 8302b58a..518b3012 100755 --- a/check/case_04/mhm.nml +++ b/check/case_04/mhm.nml @@ -7,8 +7,12 @@ '../../test_domain/input/morph/', '../../test_domain_2/input/morph/' dir_out(1:6) = 'output_b1/b1_', 'output_b1/b2_', 'output_b1/b3_', 'output_b1/b4_', 'output_b1/b5_', 'output_b1/b6_' - dir_restartout(1:6) = 'output_b1/b1_', 'output_b1/b2_', 'output_b1/b3_', - 'output_b1/b4_', 'output_b1/b5_', 'output_b1/b6_' + mhm_file_restartout(1:6) = 'output_b1/b1_mHM_restart_001.nc', 'output_b1/b2_mHM_restart_002.nc', + 'output_b1/b3_mHM_restart_003.nc', 'output_b1/b4_mHM_restart_004.nc', + 'output_b1/b5_mHM_restart_005.nc', 'output_b1/b6_mHM_restart_006.nc' + mrm_file_restartout(1:6) = 'output_b1/b1_mRM_restart_001.nc', 'output_b1/b2_mRM_restart_002.nc', + 'output_b1/b3_mRM_restart_003.nc', 'output_b1/b4_mRM_restart_004.nc', + 'output_b1/b5_mRM_restart_005.nc', 'output_b1/b6_mRM_restart_006.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1:6) = '../../test_domain/input/latlon/latlon_1.nc', '../../test_domain/input/latlon/latlon_2.nc', @@ -95,9 +99,12 @@ / &mainconfig_mhm_mrm - dir_restartin(1:6) = '../../test_domain/restart/', '../../test_domain/restart/', - '../../test_domain_2/restart/', '../../test_domain/restart/', - '../../test_domain/restart/', '../../test_domain_2/restart/' + mhm_file_restartin(1:6) = 'output_b1/b1_mHM_restart_001.nc', 'output_b1/b2_mHM_restart_002.nc', + 'output_b1/b3_mHM_restart_003.nc', 'output_b1/b4_mHM_restart_004.nc', + 'output_b1/b5_mHM_restart_005.nc', 'output_b1/b6_mHM_restart_006.nc' + mrm_file_restartin(1:6) = 'output_b1/b1_mRM_restart_001.nc', 'output_b1/b2_mRM_restart_002.nc', + 'output_b1/b3_mRM_restart_003.nc', 'output_b1/b4_mRM_restart_004.nc', + 'output_b1/b5_mRM_restart_005.nc', 'output_b1/b6_mRM_restart_006.nc' opti_function = 3 opti_method = 1 optimize = .false. diff --git a/check/case_05/mhm.nml b/check/case_05/mhm.nml index f95940b5..37171d14 100755 --- a/check/case_05/mhm.nml +++ b/check/case_05/mhm.nml @@ -4,7 +4,8 @@ dir_morpho(1:3) = '../../test_domain/input/morph/', '../../test_domain/input/morph/', '../../test_domain/input/morph/' dir_out(1:3) = 'output_b1/b1_', 'output_b1/b2_', 'output_b1/b3_' - dir_restartout(1:3) = 'output_b1/b1_', 'output_b1/b2_', 'output_b1/b3_' + mhm_file_restartout(1:3) = 'output_b1/b1_mHM_restart_001.nc', 'output_b1/b2_mHM_restart_002.nc', 'output_b1/b3_mHM_restart_003.nc' + mrm_file_restartout(1:3) = 'output_b1/b1_mRM_restart_001.nc', 'output_b1/b2_mRM_restart_002.nc', 'output_b1/b3_mRM_restart_003.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1:3) = '../../test_domain/input/latlon/latlon_1.nc', '../../test_domain/input/latlon/latlon_1.nc', @@ -92,8 +93,6 @@ / &mainconfig_mhm_mrm - dir_restartin(1:3) = '../../test_domain/restart/', '../../test_domain/restart/', - '../../test_domain/restart/' opti_function = 3 opti_method = 1 optimize = .false. diff --git a/check/case_06/mhm.nml b/check/case_06/mhm.nml index 2067e9dd..c670fc94 100755 --- a/check/case_06/mhm.nml +++ b/check/case_06/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 28 opti_method = 1 optimize = .true. diff --git a/check/case_07/mhm.nml b/check/case_07/mhm.nml index 8b26e8f0..a0bf03ad 100755 --- a/check/case_07/mhm.nml +++ b/check/case_07/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 15 opti_method = 1 optimize = .true. diff --git a/check/case_08/mhm.nml b/check/case_08/mhm.nml index d32ddf97..a85c36d9 100755 --- a/check/case_08/mhm.nml +++ b/check/case_08/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_2.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 17 opti_method = 1 optimize = .true. diff --git a/check/case_09/mhm.nml b/check/case_09/mhm.nml index ed5920e7..1a6d69e2 100755 --- a/check/case_09/mhm.nml +++ b/check/case_09/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart.nc' opti_function = 3 opti_method = 1 optimize = .false. diff --git a/check/case_10/mhm.nml b/check/case_10/mhm.nml index f9ee2d72..004e9e97 100755 --- a/check/case_10/mhm.nml +++ b/check/case_10/mhm.nml @@ -2,7 +2,8 @@ dir_lcover(1) = '../../test_domain/input/luse/' dir_morpho(1) = '../../test_domain/input/morph/' dir_out(1) = 'output_b1/b1_' - dir_restartout(1) = 'output_b1/b1_' + mhm_file_restartout(1) = 'output_b1/b1_mHM_restart_001.nc' + mrm_file_restartout(1) = 'output_b1/b1_mRM_restart_001.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1) = '../../test_domain/input/latlon/latlon_1.nc' @@ -67,7 +68,8 @@ / &mainconfig_mhm_mrm - dir_restartin(1) = 'restart/b1_' + mhm_file_restartin(1) = 'restart/b1_mHM_restart_001.nc' + mrm_file_restartin(1) = 'restart/b1_mRM_restart_001.nc' opti_function = 3 opti_method = 1 optimize = .false. diff --git a/check/case_11/mhm.nml b/check/case_11/mhm.nml index 904409fc..fb9603f5 100755 --- a/check/case_11/mhm.nml +++ b/check/case_11/mhm.nml @@ -7,8 +7,12 @@ '../../test_domain/input/morph/', '../../test_domain/input/morph/' dir_out(1:6) = 'output_b1/b1_', 'output_b1/b2_', 'output_b1/b3_', 'output_b1/b4_', 'output_b1/b5_', 'output_b1/b6_' - dir_restartout(1:6) = 'output_b1/b1_', 'output_b1/b2_', 'output_b1/b3_', - 'output_b1/b4_', 'output_b1/b5_', 'output_b1/b6_' + mhm_file_restartout(1:6) = 'output_b1/b1_mHM_restart_001.nc', 'output_b1/b2_mHM_restart_002.nc', + 'output_b1/b3_mHM_restart_003.nc', 'output_b1/b4_mHM_restart_004.nc', + 'output_b1/b5_mHM_restart_005.nc', 'output_b1/b6_mHM_restart_006.nc' + mrm_file_restartout(1:6) = 'output_b1/b1_mRM_restart_001.nc', 'output_b1/b2_mRM_restart_002.nc', + 'output_b1/b3_mRM_restart_003.nc', 'output_b1/b4_mRM_restart_004.nc', + 'output_b1/b5_mRM_restart_005.nc', 'output_b1/b6_mRM_restart_006.nc' dircommonfiles = '../../test_domain/input/morph/' dirconfigout = 'output_b1/' file_latlon(1:6) = '../../test_domain/input/latlon/latlon_1.nc', '../../test_domain/input/latlon/latlon_1.nc', @@ -113,9 +117,6 @@ / &mainconfig_mhm_mrm - dir_restartin(1:6) = '../../test_domain/restart/', '../../test_domain/restart/', - '../../test_domain/restart/', '../../test_domain/restart/', - '../../test_domain/restart/', '../../test_domain/restart/' opti_function = 33 opti_method = 1 optimize = .true. diff --git a/check/case_mrm_01/mrm.nml b/check/case_mrm_01/mrm.nml index d7f4755d..c8b3bae9 100644 --- a/check/case_mrm_01/mrm.nml +++ b/check/case_mrm_01/mrm.nml @@ -116,9 +116,9 @@ read_opt_domain_data(2) = 0 !----------------------------------------------------------------------------- !> Number in brackets indicates domain number. !> directory where restart input is located -dir_RestartIn(1) = "../../test_domain/restart/" +mrm_file_restartin(1) = "../../test_domain/restart/" !> directory where restart input is located -dir_RestartIn(2) = "../../test_domain_2/restart/" +mrm_file_restartin(2) = "../../test_domain_2/restart/" !----------------------------------------------------------------------------- !> resolution of Level-11 discharge routing [m or degree] per domain !> this level-11 discharge routing resolution must be >= and multiple of the @@ -243,7 +243,8 @@ dir_Morpho(1) = "../../test_domain/input/morph/" !> directory where land cover files are located dir_LCover(1) = "../../test_domain/input/luse/" !> directory where restart output should be written -dir_RestartOut(1) = "output_b1/b1_" +mhm_file_restartout(1) = "output_b1/b1_mHM_restart_001.nc" +mrm_file_restartout(1) = "output_b1/b1_mRM_restart_001.nc" !> directory where output should be written dir_Out(1) = "output_b1/b1_" !> file containing latitude and longitude on the resolution_Hydrology @@ -255,7 +256,8 @@ dir_Morpho(2) = "../../test_domain_2/input/morph/" !> directory where land cover files are located dir_LCover(2) = "../../test_domain_2/input/luse/" !> directory where restart output should be written -dir_RestartOut(2) = "output_b1/b2_" +mhm_file_restartout(2) = "output_b1/b2_mHM_restart_002.nc" +mrm_file_restartout(2) = "output_b1/b2_mRM_restart_002.nc" !> directory where output should be written dir_Out(2) = "output_b1/b2_" !> file containing latitude and longitude on the resolution_Hydrology diff --git a/mhm.nml b/mhm.nml index 9dfee4cf..80c97627 100644 --- a/mhm.nml +++ b/mhm.nml @@ -119,9 +119,11 @@ read_opt_domain_data(2) = 0 !----------------------------------------------------------------------------- !> Number in brackets indicates domain number. !> directory where restart input is located -dir_RestartIn(1) = "test_domain/restart/" +mhm_file_RestartIn(1) = "test_domain/restart/mHM_restart_001.nc" +mrm_file_RestartIn(1) = "test_domain/restart/mRM_restart_001.nc" !> directory where restart input is located -dir_RestartIn(2) = "test_domain_2/restart/" +mhm_file_RestartIn(2) = "test_domain_2/restart/mHM_restart_002.nc" +mrm_file_RestartIn(2) = "test_domain_2/restart/mRM_restart_002.nc" !----------------------------------------------------------------------------- !> resolution of Level-11 discharge routing [m or degree] per domain !> this level-11 discharge routing resolution must be >= and multiple of the @@ -141,7 +143,7 @@ timestep = 1 !> mrm_read_river_network = .True. allows to read the river network for mRM !> read_restart = .True. forces mrm_read_river_network = .True. !----------------------------------------------------------------------------- -read_restart = .True. +read_restart = .False. mrm_read_river_network = .False. !----------------------------------------------------------------------------- !> flag for optimization: .TRUE.: optimization @@ -252,7 +254,8 @@ dir_Morpho(1) = "test_domain/input/morph/" !> directory where land cover files are located dir_LCover(1) = "test_domain/input/luse/" !> directory where restart output should be written -dir_RestartOut(1) = "test_domain/restart/" +mhm_file_RestartOut(1) = "test_domain/restart/mHM_restart_001.nc" +mrm_file_RestartOut(1) = "test_domain/restart/mRM_restart_001.nc" !> directory where output should be written dir_Out(1) = "test_domain/output_b1/" !> file containing latitude and longitude on the resolution_Hydrology @@ -264,7 +267,8 @@ dir_Morpho(2) = "test_domain_2/input/morph/" !> directory where land cover files are located dir_LCover(2) = "test_domain_2/input/luse/" !> directory where restart output should be written -dir_RestartOut(2) = "test_domain_2/restart/" +mhm_file_RestartOut(2) = "test_domain/restart/mHM_restart_002.nc" +mrm_file_RestartOut(2) = "test_domain/restart/mRM_restart_002.nc" !> directory where output should be written dir_Out(2) = "test_domain_2/output/" !> file containing latitude and longitude on the resolution_Hydrology diff --git a/test_domain_2/restart/restart/mHM_restart_002.nc b/test_domain_2/restart/mHM_restart_002.nc similarity index 100% rename from test_domain_2/restart/restart/mHM_restart_002.nc rename to test_domain_2/restart/mHM_restart_002.nc diff --git a/test_domain_2/restart/restart/mRM_restart_002.nc b/test_domain_2/restart/mRM_restart_002.nc similarity index 100% rename from test_domain_2/restart/restart/mRM_restart_002.nc rename to test_domain_2/restart/mRM_restart_002.nc