      SUBROUTINE finalize(success)
c============================================================================
c PROCEDURE NAME: 	_finalize
c PROCEDURE TYPE: 	_subroutine
c VERSION DATE:		_23.II.98
c
c PURPOSE:
c
c CALLING PARAMETERS:
c   Name	Type	i/o	units	Description
c   --------	----	---	-----	--------------
c   success      l4      o              Successful completion flag
c
c EXTERNAL ROUTINES REQUIRED:
c   writeout
c
c NOTES & CAVEATS:
c
c REVISION HISTORY:
c
c============================================================================
      IMPLICIT NONE
c----------------------------------------------------------------------------
c Compile parameters
c
      INCLUDE "ovpindex.prm"

c----------------------------------------------------------------------------
c Calling parameters
c
      LOGICAL success

c----------------------------------------------------------------------------
c Common blocks
c
      INCLUDE "ovpindex.cmn"
      INCLUDE "sites.cmn"
      INCLUDE "ovx.cmn"

c----------------------------------------------------------------------------
c Local variables
c
      INTEGER*4 isite


c============================================================================

      WRITE(loglun,'(A)') 'FINALIZE ...'

c--Write the remaining data out to the master output file.

      DO isite= 1, n_sites
        IF(n_fov(isite) .GT. 0) CALL writeout(isite)
      END DO

      success=.TRUE.
      RETURN
      END
