!+ Subroutine to perform mandatory checks on archives for joining.
!
! Method:
!	The gases, pressures, temperatures, amounts and partial 
!	pressures in two entries are compared to see if they can 
!	be joined.
!
! Current Owner of Code: J. M. Edwards
!
! History:
!	Version		Date			Comment
!	1.0		12-04-95		First Version under RCS
!						(J. M. Edwards)
!
! Description of Code:
!   FORTRAN 77  with extensions listed in documentation.
!
!- ---------------------------------------------------------------------
      SUBROUTINE TEST_MANDATORY(L_POSSIBLE
     &   , I_GAS_1, P_1, T_1, AMOUNT_1, PARTIAL_P_1
     &   , I_GAS_2, P_2, T_2, AMOUNT_2, PARTIAL_P_2
     &   )
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/prec_machine.ucf'
      INCLUDE 'incl/precision_pp.tcf'
!
!     DUMMY ARGUMENTS.
      INTEGER	!, INTENT(IN)
     &     I_GAS_1
!             TYPE OF FIRST GAS
     &   , I_GAS_2
!             TYPE OF SECOND GAS
      LOGICAL	!, INTENT(INOUT)
     &     L_POSSIBLE
!             FLAG FOR POSSIBLE MERGING
      REAL*8	!, INTENT(IN)
     &     P_1
!             PRESSURE OF FIRST ENTRY
     &   , P_2
!             PRESSURE OF SECOND ENTRY
     &   , T_1
!             TEMPERATURE OF FIRST ENTRY
     &   , T_2
!             TEMPERATURE OF SECOND ENTRY
     &   , AMOUNT_1
!             AMOUNT OF FIRST ENTRY
     &   , AMOUNT_2
!             AMOUNT OF SECOND ENTRY
     &   , PARTIAL_P_1
!             PARTIAL PRESSURE OF FIRST ENTRY
     &   , PARTIAL_P_2
!             PARTIAL PRESSURE OF SECOND ENTRY
!
!
      IF (I_GAS_1.NE.I_GAS_2) L_POSSIBLE=.FALSE.
      IF (ABS(P_1-P_2).GT.P_2*TOL_PRESS_PP) L_POSSIBLE=.FALSE.
      IF (ABS(T_1-T_2).GT.T_2*TOL_TEMP_PP) L_POSSIBLE=.FALSE.
      IF (ABS(AMOUNT_1-AMOUNT_2).GT.AMOUNT_2*TOL_AMOUNT_PP)
     &   L_POSSIBLE=.FALSE.
      IF (ABS(PARTIAL_P_1-PARTIAL_P_2).GT.PARTIAL_P_2*TOL_PRESS_PP)
     &   L_POSSIBLE=.FALSE.
!
!
      RETURN
      END
