tem_restart_readHeader Subroutine

private subroutine tem_restart_readHeader(me, timing, globProc, tree)

read the restart header lua file and hand the information to the required data types, re-set the time ...

Arguments

Type IntentOptional 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


Calls

proc~~tem_restart_readheader~~CallsGraph proc~tem_restart_readheader tem_restart_readHeader aot_get_val aot_get_val proc~tem_restart_readheader->aot_get_val aot_table_close aot_table_close proc~tem_restart_readheader->aot_table_close aot_table_open aot_table_open proc~tem_restart_readheader->aot_table_open close_config close_config proc~tem_restart_readheader->close_config interface~tem_varsys_dump tem_varSys_dump proc~tem_restart_readheader->interface~tem_varsys_dump interface~tem_varsys_load tem_varSys_load proc~tem_restart_readheader->interface~tem_varsys_load proc~load_tem load_tem proc~tem_restart_readheader->proc~load_tem proc~tem_open_distconf tem_open_distconf proc~tem_restart_readheader->proc~tem_open_distconf proc~tem_time_dump tem_time_dump proc~tem_restart_readheader->proc~tem_time_dump proc~tem_time_load tem_time_load proc~tem_restart_readheader->proc~tem_time_load proc~tem_time_sim_stamp tem_time_sim_stamp proc~tem_restart_readheader->proc~tem_time_sim_stamp

Called by

proc~~tem_restart_readheader~~CalledByGraph proc~tem_restart_readheader tem_restart_readHeader proc~tem_load_restart tem_load_restart proc~tem_load_restart->proc~tem_restart_readheader

Source Code

  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