D.2.10 Output_Communication Procedure

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

  subroutine Output_Communication (Communication, Unit)

    ! Input variables.

    ! 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(in) :: Communication
    type(integer), intent(in), optional :: Unit          ! Output unit.

    ! Internal variable.

    type(integer) :: A_Unit                              ! Actual output unit.

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

    ! Verify requirements.

    VERIFY(Valid_State(Communication),5)      ! Communication is valid.

    ! Only output on the IO PE.

    if (this_is_IO_PE) then

      ! Set unit number.
     
      if (PRESENT(Unit)) then
        A_Unit = Unit
      else
        A_Unit = 6
      end if
     
      ! Output Identification Info.

      if (Parallel) then
        write (A_Unit,100) 'Running in parallel mode using ', &
                            TRIM(Parallel_Library), ':'
        write (A_Unit,101) 'NPEs  = ', NPEs
        write (A_Unit,101) 'PE    = ', this_PE
        write (A_Unit,101) 'IO_PE = ', IO_PE
      else
        write (A_Unit,100) 'Running in serial mode.'
      end if

    end if

    ! Format statements.

100 format (a,:,a,a,/)
101 format (2x,a,i5)

    ! Verify guarantees - none.

    return
  end subroutine Output_Communication



Michael L. Hall