SUBROUTINE open_scratch_file (iunit, iu06)  
! ----------------------------------------------------------------------
!     -------
!       *IU06*   - PRINTER OUTPUT.
IMPLICIT NONE
INTEGER, INTENT(OUT) :: iunit
INTEGER, INTENT(IN)  :: iu06
CHARACTER :: filename * 80
INTEGER   :: ierrcode

WRITE(filename, '(''FORT'',I2)') iunit
OPEN (UNIT = iunit, STATUS = 'SCRATCH', FORM = 'UNFORMATTED', IOSTAT = ierrcode)
IF( ierrcode .GT. 0 ) THEN
   WRITE(iu06,*) ' *********************************************'
   WRITE(iu06,*) ' *                                           *'
   WRITE(iu06,*) ' * FATAL  ERROR IN SUB. OPEN_SCRATH_FILES    *'
   WRITE(iu06,*) ' * ======================================    *'
   WRITE(iu06,*) ' *                                           *'
   WRITE(iu06,*) ' * CAN NOT OPEN:  ', filename
   WRITE(iu06,*) ' * PROGRAM WILL BE ABORTED                   *'
   WRITE(iu06,*) ' *********************************************'
   CALL ABORT
ENDIF
WRITE(iu06,*) 'OPEN SCRATCH File on UNIT=', iunit

RETURN
END SUBROUTINE open_scratch_file
