!------------------------------------------------------------------------------
!
SUBROUTINE RMASS_Z(NREACT,KK,AM1,AM2,AM3,AM4)
!
!...5/10/76
!...This subroutine was written by Harry H. Towner of the Princeton
!...Plasma Physics lab.  This routine will return the masses for
!...a given reaction.  The reaction is assumed to be in the form of:
!		AM1(AM2,AM3)AM4
!...PARAMETERS:
!...NREACT - Specifies the reaction.
!		1)	T(D,N)HE4	2)   HE3(D,P)HE4
!		3)	D(D,P)T		4)   D(D,N)HE3
!		5)	T(T,2N)HE4 	6)   T(HE3,X)Y
!		12)	T(T,2N)HE4 (same as 5) !DPC fit 06/2018
!...KK - If KK=1 then the above reaction is reversed.
!...AM1-4 - The mass for the given reaction.  (keV/C**2)
!...Note that indeterminate masses are given a value of -1.e00.
!...All masses have the units of kev/c**2.
!
!
!============
! idecl:  explicitize implicit INTEGER declarations:
  use iso_c_binding, only: fp => c_double
  IMPLICIT NONE
  INTEGER kk,nreact,nreact_use
!============
! idecl:  explicitize implicit REAL declarations:
  real(fp) :: am1,am2,am3,am4
  real(fp), dimension(6) :: a1,a2,a3,a4
!============
  DATA A1/2.80888259e+6_fp,2.808352957e+6_fp,2*1.875587331e+6_fp,&
       2*2.80888259e+6_fp/
  DATA A2/4*1.875587331e+6_fp,2.80888259e+6_fp,2.808352957e+6_fp/
  DATA A3/9.395526709e+5_fp,2*9.382592233e+5_fp,9.395526709e+5_fp,2*-1.0_fp/
  DATA A4/2*3.727327439e+6_fp,2.80888259e+6_fp,2.808352957e+6_fp,&
       3.727327439e+6_fp,-1.0_fp/
!
!******************************************************************************
!
  NREACT_USE=NREACT
  if(NREACT.eq.12) then
     NREACT_USE=5
  endif
  IF (KK .EQ. 0) THEN
     AM1=A1(NREACT_USE)
     AM2=A2(NREACT_USE)
  ELSE IF (KK .EQ. 1) THEN
     AM1=A2(NREACT_USE)
     AM2=A1(NREACT_USE)
  ELSE
     WRITE(6,10)
10   FORMAT(T2,I2,' is an illegal value for KK!')
     call bad_exit
  END IF
!
  AM3=A3(NREACT_USE)
  AM4=A4(NREACT_USE)
  RETURN
END SUBROUTINE RMASS_Z
!
!------------------------------------------------------------------------------
! 30Jun2000 fgtok -s r8_precision.sub "r8con.csh conversion"
