D.2.2 Finalize_Communication Procedure

The main documentation of the Finalize_Communication Procedure contains additional explanation of this code listing.

  subroutine Finalize_Communication (Communication, Output_Toggle)

    ! Input variable.

    type(logical), intent(in), optional :: Output_Toggle ! Toggle final output.

    ! Input/Output variable.

    ! Place holder to allow generic procedure calls -- real data associated  
    ! with the communication is stored in global class variables for easy 
    ! access.
    type(Communication_type), intent(inout) :: Communication

    ! Internal variable.

    type(logical) :: IO_Output_Toggle    ! Actual output toggle.

    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ! Verify requirements - none.

    ! Set up output toggle.

    if (PRESENT(Output_Toggle)) then
      IO_Output_Toggle = Output_Toggle .and. this_is_IO_PE
    else
      IO_Output_Toggle = this_is_IO_PE
    end if

    ! Finalize parallel/serial processor information.
  
    ifdef([USE_PGSLIB],[
  
      ! PGSLib parallel finalization.
  
      if (IO_Output_Toggle) write (6,100) 'Parallel run completed.'
      call PGSLib_Finalize
  
    ],[
  
      ! Serial finalization.
  
      if (IO_Output_Toggle) write (6,100) 'Serial run completed.'
  
    ])

    ! Format statement.

100 format (/,a)

    ! Verify guarantees - none.

    return
  end subroutine Finalize_Communication



Michael L. Hall