tem_restart_finalize Subroutine

public subroutine tem_restart_finalize(me)

Finalizing a restart object

Arguments

Type IntentOptional Attributes Name
type(tem_restart_type), intent(inout) :: me

the restart type to close


Calls

proc~~tem_restart_finalize~~CallsGraph proc~tem_restart_finalize tem_restart_finalize mpi_type_free mpi_type_free proc~tem_restart_finalize->mpi_type_free proc~check_mpi_error check_mpi_error proc~tem_restart_finalize->proc~check_mpi_error mpi_error_string mpi_error_string proc~check_mpi_error->mpi_error_string proc~tem_abort tem_abort proc~check_mpi_error->proc~tem_abort mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_restart_finalize~~CalledByGraph proc~tem_restart_finalize tem_restart_finalize proc~hvs_output_finalize hvs_output_finalize proc~hvs_output_finalize->proc~tem_restart_finalize proc~tem_tracking_finalize tem_tracking_finalize proc~tem_tracking_finalize->proc~hvs_output_finalize

Source Code

  subroutine tem_restart_finalize( me )
    ! -------------------------------------------------------------------- !
    !> the restart type to close
    type( tem_restart_type ), intent(inout) :: me
    ! -------------------------------------------------------------------- !
    integer :: iError
    logical :: nUnitOpened
    ! -------------------------------------------------------------------- !
    ! close solverspecific scratch unit
    if (me%comm%rank == 0 .and. me%controller%writeRestart) then
      if (me%solSpec_unit>0) then
        inquire(unit=me%solSpec_unit, opened=nUnitOpened)
        if (nUnitOpened) close(me%solSpec_unit)
      end if
    end if

    ! free the contiguous type
    if (me%controller%writeRestart .or. me%controller%readRestart) then
      call MPI_Type_free(me%write_file%ftype, iError)
      call check_mpi_error( iError,'Free write-ftype in restart_finalize')
      call MPI_Type_free(me%write_file%vectype, iError)
      call check_mpi_error( iError,'Free write-vectype in restart_finalize')
      if (me%read_file%ndofs /= me%write_file%ndofs) then
        call MPI_Type_free(me%read_file%ftype, iError)
        call check_mpi_error( iError,'Free read-ftype in restart_finalize')
        call MPI_Type_free(me%read_file%vectype, iError)
        call check_mpi_error( iError,'Free read-vectype in restart_finalize')
      end if
    end if

  end subroutine tem_restart_finalize