       SUBROUTINE output(z,M7Plus,SG7Plus,NumSep,Pres,Tres,
     1    PSep,TSep,Psc,Tsc,x,ysepgas,FVF,API,GOR,GG,GHV)

c***********************************************************************
c      This subroutine outputs the results of the subroutine oilsep in
c         the program COPES.  For information on variables see the
c         subroutine oilsep.

c      Author: Scott K. Laudeman
c      Date: June 20, 1987

c***********************************************************************

c***********************************************************************
c      Declarations
c***********************************************************************

       REAL M7Plus,PSep(10),TSep(10),x(12),ysepgas(12),z(12)
       INTEGER FileUnit,TermUnit
       COMMON FileUnit,TermUnit

c***********************************************************************
c      Main Program
c***********************************************************************

       OPEN (UNIT=FileUnit,FILE='Results',STATUS='NEW')

       WRITE (FileUnit,1100)
       WRITE (FileUnit,*)
       WRITE (FileUnit,*)
       WRITE (FileUnit,1200)
       WRITE (FileUnit,1300) Pres,Tres
       DO 10 i=1,NumSep
          WRITE (FileUnit,1400) i,PSep(i),TSep(i)
10     CONTINUE
       WRITE (FileUnit,1500) Psc,Tsc
       WRITE (FileUnit,*)
       WRITE (FileUnit,1550)
       WRITE (FileUnit,1600)
       WRITE (FileUnit,1700) z(1),ysepgas(1),x(1)
       WRITE (FileUnit,1800) z(2),ysepgas(2),x(2)
       WRITE (FileUnit,1900) z(3),ysepgas(3),x(3)
       WRITE (FileUnit,2000) z(4),ysepgas(4),x(4)
       WRITE (FileUnit,2100) z(5),ysepgas(5),x(5)
       WRITE (FileUnit,2200) z(6),ysepgas(6),x(6)
       WRITE (FileUnit,2300) z(7),ysepgas(7),x(7)
       WRITE (FileUnit,2400) z(8),ysepgas(8),x(8)
       WRITE (FileUnit,2500) z(9),ysepgas(9),x(9)
       WRITE (FileUnit,2600) z(10),ysepgas(10),x(10)
       WRITE (FileUnit,2700) z(11),ysepgas(11),x(11)
       WRITE (FileUnit,2800) z(12),ysepgas(12),x(12)
       WRITE (FileUnit,*)
       WRITE (FileUnit,2900) SG7Plus
       WRITE (FileUnit,3000) M7Plus
       WRITE (FileUnit,*)
       WRITE (FileUnit,3100) FVF
       WRITE (FileUnit,3200) API
       WRITE (FileUnit,3300) GOR
       WRITE (FileUnit,3400) GG
       WRITE (FileUnit,3500) GHV

       CLOSE (UNIT=FileUnit)

1100   FORMAT(22X,'GAS-OIL SEPARATOR FLASH CALCULATIONS')
1200   FORMAT(30X,'Pressure, Psia',4X,'Temperature, deg F')
1300   FORMAT('Reservoir Conditions',13X,F8.2,13x,F6.2)
1400   FORMAT('Stage',I2,26X,F8.2,13x,F6.2)
1500   FORMAT('Standard Conditions',14X,F8.2,13x,F6.2)
1550   FORMAT(20X,'*******************Compositions*******************')
1600   FORMAT(20X,'Reservoir Fluid',4X,'Separator Gas',4X,'Stock Tank
     1 Oil')
1700   FORMAT('Carbon Dioxide',9X,F8.5,10X,F8.5,10X,F8.5)
1800   FORMAT('Hydrogen Sulfide',7X,F8.5,10X,F8.5,10X,F8.5)
1900   FORMAT('Nitrogen',15X,F8.5,10X,F8.5,10X,F8.5)
2000   FORMAT('Methane',16X,F8.5,10X,F8.5,10X,F8.5)
2100   FORMAT('Ethane',17X,F8.5,10X,F8.5,10X,F8.5)
2200   FORMAT('Propane',16X,F8.5,10X,F8.5,10X,F8.5)
2300   FORMAT('Isobutane',14X,F8.5,10X,F8.5,10X,F8.5)
2400   FORMAT('n-Butane',15X,F8.5,10X,F8.5,10X,F8.5)
2500   FORMAT('Isopentane',13X,F8.5,10X,F8.5,10X,F8.5)
2600   FORMAT('n-Pentane',14X,F8.5,10X,F8.5,10X,F8.5)
2700   FORMAT('Hexane',17X,F8.5,10X,F8.5,10X,F8.5)
2800   FORMAT('Heptanes Plus',10X,F8.5,10X,F8.5,10X,F8.5)
2900   FORMAT('Specific Gravity Heptanes Plus',5X,F8.4)
3000   FORMAT('Molecular Weight Heptanes Plus',6X,F8.2,2X,
     1 'Lbs/(Lb*Mole)')
3100   FORMAT('Oil Formation Volume Factor',9X,F8.4,2X,'bbl/STB')
3200   FORMAT('Stock Tank Oil Gravity',16X,F5.2,3X,'Deg. API')
3300   FORMAT('Gas-Oil Ratio',22X,F8.1,3X,'SCF/STB')
3400   FORMAT('Separator Gas Gravity',14X,F8.4)
3500   FORMAT('Separator Gas Gross Heating Value',3X,F8.1,2X,
     1 'BTU/SCF')

       RETURN

       END
