read the restart header lua file and hand the information to the required data types, re-set the time ...
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_restart_type) | :: | me | the restart header info |
|||
type(tem_time_type), | intent(inout) | :: | timing | the timing for re-setting the times |
||
type(tem_comm_env_type), | intent(in) | :: | globProc | Global communicator |
||
type(treelmesh_type), | intent(inout) | :: | tree | mesh, provided in treelm format |
subroutine tem_restart_readHeader( me, timing, globProc, tree )
! -------------------------------------------------------------------- !
!> the restart header info
type(tem_restart_type) :: me
!> the timing for re-setting the times
type(tem_time_type), intent(inout) :: timing
!> Global communicator
type( tem_comm_env_type ), intent(in) :: globProc
!> mesh, provided in treelm format
type(treelmesh_type), intent(inout) :: tree
! -------------------------------------------------------------------- !
integer :: thandle
integer :: iError
type( flu_State ) :: conf
character(len=labelLen) :: buffer
! -------------------------------------------------------------------- !
write(logUnit(1),*) 'Opening Restart Header ' &
& // trim(me%controller%readFileName)
! Open the restart header file
call tem_open_distconf( L = conf, &
& filename = trim(me%controller%readFileName), &
& proc = globProc )
! Load the number of elements from the restart header file for sanity check
call aot_get_val( L = conf, &
& key = 'nElems', &
& val = me%header%nElems, &
& ErrCode = iError, &
& default = 1 )
! Load the solver name
call aot_get_val( L = conf, &
& key = 'solver', &
& val = buffer, &
& ErrCode = iError, &
& default = '' )
me%header%solverTag = trim( buffer )
write(logUnit(1),*) 'Solver: '// trim(me%header%solverTag )
! Load the solver config file
call aot_get_val( L = conf, &
& key = 'solver_configFile', &
& val = me%header%solverConfigFile, &
& ErrCode = iError, &
& default = '' )
! Load the number of dofs for each scalar variable of the equation system
call aot_get_val( L = conf, &
& key = 'nDofs', &
& val = me%read_file%nDofs, &
& ErrCode = iError, &
& default = 1 )
call load_tem( me = tree, &
& conf = conf, &
& myPart = globProc%rank, &
& nParts = globProc%comm_size, &
& comm = globProc%comm )
! Load the timestamp from the header
call tem_time_load( conf = conf, &
& key = 'time_point', &
& me = timing, &
& clock_start = timing%clock_start )
me%header%timestamp = trim(tem_time_sim_stamp(timing))
write(logUnit(1),*) 'Restarting from point in time:'
call tem_time_dump(timing, logUnit(1))
! Load the variable systems
call tem_varSys_load( me = me%header%varSys, conf = conf )
call tem_varSys_dump( me = me%header%varSys, outUnit = dbgUnit(3) )
call aot_table_open( L=conf, thandle = thandle, key = 'binary_name' )
! Load the binary file names for each variable system defined
call aot_get_val( L = conf, &
& thandle = thandle, &
& pos = 1, &
& val = me%header%binName, &
& ErrCode = iError, &
& default = '' )
call aot_table_close( L = conf, thandle = thandle )
call close_config( conf )
end subroutine tem_restart_readHeader