!------------------------------------------------------------------------------
!
!  SIGALL_Z -- SIGTAB GENERIC CROSS SECTION ROUTINE
!
real(fp) FUNCTION SIGALL_Z(EREL,VREL)
!
!  INPUT EREL -- ** KEV **
!                ** KEV / AMU for atomic reactions **
!  OUTPUT
!        SIGALL_Z -- M**2
!        VREL     -- M/SEC
!
!  Mod tbt Dec 1994 -- Changed Li+++>Lx Charge exchange to
!                      1.E-35 from 0.0
!  Mod tbt Oct 1994 -- Added Lithium.
!  MOD DMC DEC 1990 -- INSTALL ALADDIN INTERFACE FOR ATOMIC PHYSICS
!   CAUTION -- THE ROUTINES DOSIG,DOSIG2,DOSIG3 TAKE THE ALADDIN
!   REACTION LABELS AS ARGUMENTS, BUT DO NOT READ THE ALADDIN FILE
!   FOR REASONS OF SPEED.  THE ALADDIN FILE DATA WAS READ IN BY
!   SUBROUTINE SIGALAD.  ** THE REACTION LABELS ARE CODED IN TWO
!   PLACES:  HERE, AND IN SUBROUTINE SIGALAD **
! 
!
!
!============
! idecl:  explicitize implicit INTEGER declarations:
  use iso_c_binding, only: fp => c_double
  use sigtabl_mod   
  use physconst_mod, only : zcmtom,zcm2tom2,zkev2ev,mp_g,zero,one,two
  use adas_mod, only : adas_sig
  IMPLICIT NONE
!============
! idecl:  explicitize implicit REAL declarations:
  real(fp) d
!============
!
!----------------------
!  THESE LOCALS STORE THE REACTION INDICES CORRESPONDING TO REACTION
!  LABELS READ IN BY SIGALAD/SIGALAD1; SET TO ZERO AND THEN COMPUTED
!  ONLY ONCE ON THE FIRST CALL FOR A GIVEN REACTION.
!
!============
! idecl:  explicitize implicit INTEGER declarations:
  INTEGER isavhcx,isavhii,isavxhhe,isavihhe,isavhecx,isavxhl,&
       isavihli,isavxhel,ilun
!============
!Q idecl:  explicitize implicit REAL declarations:
  real(fp) vrel,erel,zsig,dosig_z,sigcx_z,sigion_z,sgphex,&
       sgphei,dosig2_z,sghehi,sghecx,dosig3_z,sgheii,&
       sgplix,sgplii,sglicx,sglihi,sgliii,sigma_z,zamu
!============
! for adas calls
  real(fp), dimension(1)::erel_adas, sig_adas
  integer iErr
!
  INTEGER ISAVIHEH(2),ISAVHEII(3)
  INTEGER ISAVIHEL(2),ISAVILIH(2), ISAVILHE(3), ISAVILIL(3)
!
  DATA ISAVHCX/0/
  DATA ISAVHII/0/
  DATA ISAVXHHE/0/
  DATA ISAVIHHE/0/
  DATA ISAVIHEH/0,0/
  DATA ISAVHECX/0/
  DATA ISAVHEII/0,0,0/
  DATA ISAVXHL/0/
  DATA ISAVIHLI/0/
  DATA ISAVXHEL/0/
  DATA ISAVIHEL/0,0/
  DATA ISAVILIH/0,0/
  DATA ISAVILHE/0,0,0/
  DATA ISAVILIL/0,0,0/
  Save ISAVXHL,  ISAVIHLI, ISAVXHEL
  Save ISAVIHEL, ISAVILIH, ISAVILHE, ISAVILIL
!
!
  SAVE ISAVHCX,ISAVHII,ISAVXHHE,ISAVIHHE,ISAVIHEH,&
       ISAVHECX,ISAVHEII
!
!------------------------------------------------------------------------------
! initialize ADAS arrays
!
  Erel_adas=erel ![Kev/Amu]
  sig_adas=zero
!
  IF(KREACT.LT.0)&
       VREL=zcmtom*SQRT(two*1.6029e-12_fp*EREL*zkev2ev/mp_g)
!
  IF(KREACT.EQ.-1) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVHCX,&
             'CX H [+1] H [+0] H [+0] H [+1]')
     ELSE
        ZSIG=SIGCX_Z(EREL,one)
     ENDIF
  ELSE IF(KREACT.EQ.-2) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVHII,&
             'ION H [+1] H [+0] H [+1] H [+1] e')
     ELSE
        ZSIG=SIGION_Z(EREL,one)
     ENDIF
  ELSE IF(KREACT.EQ.-3) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVXHHE,&
             'CX  H [+1] He [+0]  H [+0] He [+1]')
     ELSE
        ZSIG=zcm2tom2*SGPHEX(EREL*zkev2ev)
     ENDIF
  ELSE IF(KREACT.EQ.-4) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVIHHE,&
             'ION H [+1] He [+0]  H [+1] He [+1] e')
     ELSE
        ZSIG=zcm2tom2*SGPHEI(EREL*zkev2ev)
     ENDIF
  ELSE IF(KREACT.EQ.-5) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG2_Z(zkev2ev*EREL,ISAVIHEH,&
             'CX  He [+2] H [+0]  He [+1] H [+1]',&
             'ION  He [+2] H [+0]  He [+2] H [+1] e')
     ELSE
        ZSIG=zcm2tom2*SGHEHI(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
  ELSE IF(KREACT.EQ.-6) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVHECX,&
             'CX2 He [+2] He [+0] He [+0] He [+2]')
     ELSE
        ZSIG=zcm2tom2*SGHECX(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
  ELSE IF(KREACT.EQ.-7) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG3_Z(zkev2ev*EREL,ISAVHEII,&
             'ION  He [+2] He [+0]  He [+2] He [+1] e',&
             'ION2  He [+2] He [+0]  He [+2] He [+2] 2e',&
             'CX  He [+2] He [+0]  He [+1] He [+1]')
     ELSE
        ZSIG=zcm2tom2*SGHEII(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
!
! ----- Lithium Fudge  tbt ----------------------------------------------------
  ELSE IF(KREACT.EQ.-8) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVXHL,&
        'CX  H [+1] Li [+0]  H [+0] Li [+1]')
     ELSE
        ZSIG=zcm2tom2*SGPLIX(EREL*zkev2ev)
     ENDIF
  ELSE IF(KREACT.EQ.-9) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVIHLI,&
             'ION  H [+1] Li [+0]  H [+1] Li [+1] e')
     ELSE
        ZSIG=zcm2tom2*SGPLII(EREL*zkev2ev)
     ENDIF
  ELSE IF(KREACT.EQ.-10) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG_Z(zkev2ev*EREL,ISAVXHEL,&
             'CX2  He [+2] Li [+0]  He [+0] Li [+2]')
     ELSE
        ZSIG=zcm2tom2*SGLICX(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
  ELSE IF(KREACT.EQ.-11) THEN
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG2_Z(zkev2ev*EREL,ISAVIHEL,&
             'CX  He [+2] Li [+0]  He [+1] Li [+1]',&
             'ION  He [+2] Li [+0]  He [+2] Li [+1] e')
     ELSE
        ZSIG=zcm2tom2*SGLIHI(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
  ELSE IF(KREACT.EQ.-12) THEN    ! Lithium Fudge - use He until later
     IF(ALADFLAG) THEN            ! Li+++>H
        ZSIG=zcm2tom2*DOSIG2_Z(zkev2ev*EREL,ISAVILIH,&
             'CX  He [+2] H [+0]  He [+1] H [+1]',&
             'ION  He [+2] H [+0]  He [+2] H [+1] e')
     ELSE
        ZSIG=zcm2tom2*SGHEHI(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
!
     ZSIG=1.5_fp*ZSIG          ! ** scale up by 3/2 **
!
  ELSE IF(KREACT.EQ.-13) THEN      ! Lithium fudge - use He for a while
     IF(ALADFLAG) THEN
        ZSIG=zcm2tom2*DOSIG3_Z(zkev2ev*EREL,ISAVILHE,&
             'ION  He [+2] He [+0]  He [+2] He [+1] e',&
             'ION2  He [+2] He [+0]  He [+2] He [+2] 2e',&
             'CX  He [+2] He [+0]  He [+1] He [+1]')
     ELSE
        ZSIG=zcm2tom2*SGHEII(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
!
     ZSIG=1.5_fp*ZSIG          ! ** scale up by 3/2 **
!
  ELSE IF(KREACT.EQ.-14) THEN      ! Li+++>Li cx = 0.
     ZSIG=1.e-35_fp   ! zero gives bomb later  tbt  12/94
  ELSE IF(KREACT.EQ.-15) THEN      ! Lithium Fudge  tbt using He instead
     IF(ALADFLAG) THEN              ! Li+++>Li
        ZSIG=zcm2tom2*DOSIG3_Z(zkev2ev*EREL,ISAVILIL,&
             'ION  He [+2] He [+0]  He [+2] He [+1] e',&
             'ION2  He [+2] He [+0]  He [+2] He [+2] 2e',&
             'CX  He [+2] He [+0]  He [+1] He [+1]')
     ELSE
        ZSIG=zcm2tom2*SGLIII(EREL*4.0e+3_fp)  ! HELIUM ION
     ENDIF
!
     ZSIG=1.5_fp*ZSIG          ! ** scale up by 3/2 **
!
 
!   End Lithium ***********************************************
  ELSE IF(KREACT.EQ.-16) THEN ! H0,H+ ii ! ADAS: csIndex(2,1,1)=11
     call adas_sig(Erel_adas, 1, 1, one, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-17) THEN ! He++,H0 ii !ADAS:csIndex(2,1,2)=12
     call adas_sig(Erel_adas, 1, 1, two, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-18) THEN ! H+,He0 ii !ADAS: csIndex(2,2,1)=43
     call adas_sig(Erel_adas, 1, 2, one, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-19) THEN ! He++,He0 ii!ADAS: csIndex(2,2,2)=46
     call adas_sig(Erel_adas, 1, 2, two, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2] 
  ELSE IF(KREACT.EQ.-20) THEN ! H0,H+ cx !ADAS: csIndex(4,1,1)=1
     call adas_sig(Erel_adas, 1, 1, one, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-21) THEN ! H+,He0 cx !ADAS: csIndex(4,2,1)=1
     call adas_sig(Erel_adas, 1, 2, one, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-22) THEN  ! He++,He0 cx !ADAS: csIndex(4,2,2)=20    
     call adas_sig(Erel_adas, 1, 2, two, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-23) THEN  ! He+,He0 II !ADAS: csIndex(1,2,2)=28    
     call adas_sig(Erel_adas, 1, 2, two, 1, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-24) THEN  ! Li+3 H0 ii!ADAS:csIndex(2,1,3)=13    
     call adas_sig(Erel_adas, 1, 1, 3._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-25) THEN ! Be+4,H0 ii !ADAS:csIndex(2,1,4)=14    
     call adas_sig(Erel_adas, 1, 1, 4._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-26) THEN  ! B+5,H0 ii !ADAS:csIndex(2,1,5)=15  
     call adas_sig(Erel_adas, 1, 1, 5._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-27) THEN  ! C+6,H0 ii !ADAS:csIndex(2,1,6)=16  
     call adas_sig(Erel_adas, 1, 1, 6._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-28) THEN  ! N+7,H0 ii !ADAS:csIndex(2,1,7)=17
     call adas_sig(Erel_adas, 1, 1, 7._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-29) THEN  ! O+8,H0 ii !ADAS:csIndex(2,1,8)=18
     call adas_sig(Erel_adas, 1, 1, 8._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-30) THEN  ! F+9,H0 ii !ADAS:csIndex(2,1,9)=19
     call adas_sig(Erel_adas, 1, 1, 9._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-31) THEN ! Ne+10,H0 ii !ADAS:csIndex(2,1,10)=20
     call adas_sig(Erel_adas, 1, 1, 10._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-32) THEN ! Be+4,He0 ii!ADAS: csIndex(2,2,4)=48
     call adas_sig(Erel_adas, 1, 2, 4._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-33) THEN ! C+6,He0 ii!ADAS: csIndex(2,2,6)=50
     call adas_sig(Erel_adas, 1, 2, 6._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-34) THEN ! O+8,He0 ii!ADAS: csIndex(2,2,8)=52
     call adas_sig(Erel_adas, 1, 2, 8._fp, 2, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-35) THEN ! H0,He+2 cx !ADAS: csIndex(4,1,2)=2
     call adas_sig(Erel_adas, 1, 1, two, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-36) THEN ! H0,Li+3 cx !ADAS: csIndex(4,1,3)=3
     call adas_sig(Erel_adas, 1, 1, 3._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-37) THEN ! H0,Be+4 cx !ADAS: csIndex(4,1,4)=4
     call adas_sig(Erel_adas, 1, 1, 4._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-38) THEN ! H0,B+5 cx !ADAS: csIndex(4,1,5)=5
     call adas_sig(Erel_adas, 1, 1, 5._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-39) THEN ! H0,C+6 cx !ADAS: csIndex(4,1,6)=6
     call adas_sig(Erel_adas, 1, 1, 6._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-40) THEN ! H0,N+7 cx !ADAS: csIndex(4,1,7)=7
     call adas_sig(Erel_adas, 1, 1, 7._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-41) THEN ! H0,O+8 cx !ADAS: csIndex(4,1,8)=8
     call adas_sig(Erel_adas, 1, 1, 8._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-42) THEN ! H0,F+9 cx !ADAS: csIndex(4,1,9)=9
     call adas_sig(Erel_adas, 1, 1, 9._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-43) THEN ! H0,Ne+10 cx !ADAS: csIndex(4,1,10)=10
     call adas_sig(Erel_adas, 1, 1, 10._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-44) THEN ! Be+4,He0 cx !ADAS: csIndex(4,2,4)=21
     call adas_sig(Erel_adas, 1, 2, 4._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-45) THEN ! C+6,He0 cx !ADAS: csIndex(4,2,6)=22
     call adas_sig(Erel_adas, 1, 2, 6._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-46) THEN ! O+8,He0 cx !ADAS: csIndex(4,2,8)=23
     call adas_sig(Erel_adas, 1, 2, 8._fp, 4, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-47) THEN  ! He+,He0 non neutr. CX !ADAS: csIndex(3,2,2)=5    
     call adas_sig(Erel_adas, 1, 2, two, 3, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-48) THEN  ! H+,He0 II !ADAS: csIndex(1,2,1)=24    
     call adas_sig(Erel_adas, 1, 2, one, 1, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-49) THEN  ! Be+4,He0 II !ADAS: csIndex(1,2,4)=31    
     call adas_sig(Erel_adas, 1, 2, 4._fp, 1, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-50) THEN  ! C+6,He0 II !ADAS: csIndex(1,2,6)=34    
     call adas_sig(Erel_adas, 1, 2, 6._fp, 1, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-51) THEN  ! O+8,He0 II !ADAS: csIndex(1,2,8)=37    
     call adas_sig(Erel_adas, 1, 2, 8._fp, 1, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-52) THEN  ! Be+4,He0 CX transfer !ADAS: csIndex(3,2,4)=8    
     call adas_sig(Erel_adas, 1, 2, 4._fp, 3, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-53) THEN  ! B+5,He0 CX transfer !ADAS: csIndex(3,2,5)=11    
     call adas_sig(Erel_adas, 1, 2, 5._fp, 3, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-54) THEN  ! C+6,He0 CX transfer !ADAS: csIndex(3,2,6)=12    
     call adas_sig(Erel_adas, 1, 2, 6._fp, 3, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-55) THEN  ! N+7,He0 CX transfer !ADAS: csIndex(3,2,7)=15    
     call adas_sig(Erel_adas, 1, 2, 7._fp, 3, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-56) THEN ! O+8,He0 CX transfer !ADAS: csIndex(3,2,8)=16    
     call adas_sig(Erel_adas, 1, 2, 8._fp, 3, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-57) THEN ! Ne+10,He0 CX transfer !ADAS: csIndex(3,2,10)=19    
     call adas_sig(Erel_adas, 1, 2, 10._fp, 3, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
     
     
     
  ELSE IF(KREACT.EQ.-58) THEN ! H+,H0 ii !ADAS:csIndex(2,1,2)=12
     call adas_sig(Erel_adas, 1, 1, one, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-59) THEN ! He++,H0 ii !ADAS:csIndex(2,1,2)=12
     call adas_sig(Erel_adas, 1, 1, two, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-60) THEN  ! Li+3 H0 ii!ADAS:csIndex(2,1,3)=13    
     call adas_sig(Erel_adas, 1, 1, 3._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-61) THEN ! Be+4,H0 ii !ADAS:csIndex(2,1,4)=14    
     call adas_sig(Erel_adas, 1, 1, 4._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-62) THEN  ! B+5,H0 ii !ADAS:csIndex(2,1,5)=15  
     call adas_sig(Erel_adas, 1, 1, 5._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-63) THEN  ! C+6,H0 ii !ADAS:csIndex(2,1,6)=16  
     call adas_sig(Erel_adas, 1, 1, 6._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-64) THEN  ! N+7,H0 ii !ADAS:csIndex(2,1,7)=17
     call adas_sig(Erel_adas, 1, 1, 7._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-65) THEN  ! O+8,H0 ii !ADAS:csIndex(2,1,8)=18
     call adas_sig(Erel_adas, 1, 1, 8._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-66) THEN  ! F+9,H0 ii !ADAS:csIndex(2,1,9)=19
     call adas_sig(Erel_adas, 1, 1, 9._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-67) THEN ! Ne+10,H0 ii !ADAS:csIndex(2,1,10)=20
     call adas_sig(Erel_adas, 1, 1, 10._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-68) THEN  ! H+,He0 II !ADAS: csIndex(1,2,1)=24    
     call adas_sig(Erel_adas, 1, 2, one, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-69) THEN  ! He+,He0 II !ADAS: csIndex(1,2,2)=28    
     call adas_sig(Erel_adas, 1, 2, two, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-70) THEN  ! Be+4,He0 II !ADAS: csIndex(1,2,4)=31    
     call adas_sig(Erel_adas, 1, 2, 4._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-71) THEN  ! C+6,He0 II !ADAS: csIndex(1,2,6)=34    
     call adas_sig(Erel_adas, 1, 2, 6._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  ELSE IF(KREACT.EQ.-72) THEN  ! O+8,He0 II !ADAS: csIndex(1,2,8)=37    
     call adas_sig(Erel_adas, 1, 2, 8._fp, 5, SIG_adas, iErr)
     ZSIG=SIG_adas(1)*zcm2tom2 ![m**2]
  else
     
!  NUCLEAR REACTION, ISOTOPES ARE FIXED, ENERGIES ARE NOT /AMU
     ZSIG=SIGMA_Z(KREACT,KK,ILUN,EREL)
     ZAMU=1.073559e-6_fp*AMASS2 ! BEAM PTCL MASS IN AMU
     VREL=zcmtom*SQRT(two*1.6029e-12_fp*EREL*zkev2ev/(ZAMU*mp_g))
  ENDIF
!
      
  SIGALL_Z=ZSIG
!
  RETURN
END FUNCTION SIGALL_Z
!
!------------------------------------------------------------------------------
! 30Jun2000 fgtok -s r8_precision.sub "r8con.csh conversion"
! 02Aug2000 fgtok -s r8_precision.sub "r8con.csh conversion"
! 02Aug2000 fgtok
