Skip to content

Commit

Permalink
Merge branch 'restart_ids' into 'develop'
Browse files Browse the repository at this point in the history
Restart ids

See merge request mhm/mhm!34
  • Loading branch information
StephanThober committed Jun 3, 2020
2 parents bc17636 + 9f5056d commit 62f6beb
Show file tree
Hide file tree
Showing 32 changed files with 169 additions and 113 deletions.
6 changes: 4 additions & 2 deletions check/case_00/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_01/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_02/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_03/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
17 changes: 12 additions & 5 deletions check/case_04/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions check/case_05/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_06/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_07/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_08/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_09/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions check/case_10/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 6 additions & 5 deletions check/case_11/mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 6 additions & 4 deletions check/case_mrm_01/mrm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 14 additions & 6 deletions mhm.nml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ L0Domain(2) = 2
!-----------------------------------------------------------------------------
!> flag for writing restart output
!-----------------------------------------------------------------------------
write_restart = .TRUE.
write_restart = .False.
!-----------------------------------------------------------------------------
!> read domain specific optional data
!-----------------------------------------------------------------------------
Expand All @@ -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
Expand All @@ -137,8 +139,12 @@ resolution_Routing(2) = 24000
timestep = 1
!-----------------------------------------------------------------------------
!> flags for reading restart output
!> 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 = .FALSE.
read_restart = .False.
mrm_read_river_network = .False.
!-----------------------------------------------------------------------------
!> flag for optimization: .TRUE.: optimization
!> or .FALSE.: no optimazition
Expand Down Expand Up @@ -248,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
Expand All @@ -260,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
Expand Down
8 changes: 4 additions & 4 deletions src/MPR/mo_mpr_restart.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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)), " ...")

Expand Down
4 changes: 2 additions & 2 deletions src/MPR/mpr_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 62f6beb

Please sign in to comment.