
subroutine banner( Unit, Startstring, Infostring, & 
                   Hostname, Datestring, Timestring, Newflag )

! This subroutine prints the output banner
! to any file requested.
! Startstring is a string put before each line printed.
! If Unit=6 or Unit=5 or Unit<=0, then
! the banner is printed to the standard output
! (Unit=6).

use portlib       ! # MS Fortran 

implicit none

character*(*), intent(in)        :: Startstring
!  This string is put before printing anything else at each line.
logical,       intent(in)        :: Newflag 
!  Newflag==.TRUE. if the current date and time are to be obtained.
integer,       intent(in)        :: Unit    
!  Output unit (the output file number).
character*80,  intent(inout)     :: Hostname, Infostring, &
                                    Datestring, Timestring
!  Hostname, Date and Time as character variables


integer             :: u    ! Output unit; local variable

! Used for timing (DATE_AND_TIME subroutine); local variables.
character*8         :: Dat  ! Date:	YYYYMMDD
character*5         :: Zon  ! Time zone: +-HHMM (difference from GMT)
character*10        :: Tim  ! Time: HHMMSS.SSS


! Get the current date and time.
if ( Newflag ) then
    u = HOSTNAM( Hostname )    ! # MS Fortran

!	Hostname = ' UNIX '         ! # U_ALPHA
    
	! Get current date, time and time-zone.
    call DATE_AND_TIME( TIME=Tim, ZONE=Zon, DATE=Dat )
	             
    Datestring = Dat(5:6)//'/'//Dat(7:8)//'/'//Dat(1:4)     ! US format

	Timestring = Tim(1:2)//':'//Tim(3:4) //          &
         '  ' // Zon(1:3)//':'//Zon(4:5) //          &
		 ' (hours from GMT) '

  	Infostring = ' Installation: ' // trim(Hostname)   // &
	             '     Run date: ' // trim(DateString) // &
	             ' ' // Tim(1:2)//':'//Tim(3:4) //':'//Tim(5:6)
endif

! Unit 5 is the standard  input.
! Unit 6 is the standard output.
if ( Unit <= 0   .OR.   Unit==5 ) then 
    u = 6
else
    u = Unit
endif

write (u,"(A)") trim( Startstring )
write (u,"(A)") trim( Startstring ) // &
  '***********************************************************************************'
write (u,"(A)") trim( Startstring ) // &
  ' GIBBS PROGRAM - last change 1/22/2000'
write (u,"(A)") trim( Startstring ) // &
  '***********************************************************************************'
write (u,"(A)") trim( Startstring ) // &
  ' Programmers: J. R. Errington and A. Z. Panagiotopoulos '
write (u,"(A)") trim( Startstring )
write (u,"(A)") trim( Startstring ) // Infostring
write (u,"(A)") trim( Startstring )


end subroutine banner








