print_preconnection_list Subroutine

private subroutine print_preconnection_list(output_unit)

Print the list of preconnected units

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: output_unit

which unit to print to (optional)


Source Code

   SUBROUTINE print_preconnection_list(output_unit)
      !! Print the list of preconnected units

      INTEGER, INTENT(IN), OPTIONAL                      :: output_unit
         !! which unit to print to (optional)

      INTEGER                                            :: ic, nc, unit

      IF (PRESENT(output_unit)) THEN
         unit = output_unit
      ELSE
         unit = default_output_unit
      END IF

      nc = SIZE(preconnected)

      IF (output_unit > 0) THEN

         WRITE (UNIT=output_unit, FMT="(A,/,A)") &
            " LIST OF PRECONNECTED LOGICAL UNITS", &
            "  Slot   Unit number   File name"
         DO ic = 1, nc
            IF (preconnected(ic)%unit_number > 0) THEN
               WRITE (UNIT=output_unit, FMT="(I6,3X,I6,8X,A)") &
                  ic, preconnected(ic)%unit_number, &
                  TRIM(ADJUSTL(preconnected(ic)%file_name))
            ELSE
               WRITE (UNIT=output_unit, FMT="(I6,17X,A)") &
                  ic, "UNUSED"
            END IF
         END DO
      END IF
   END SUBROUTINE print_preconnection_list