!------------------------------------------------------------------------------
!
!  DOSIG2_Z -- EVALUATE A CROSS SECTION FROM ALADDIN DATA -- SUM OF 2
!
real(fp) FUNCTION DOSIG2_Z(ZEREL,INDXR,ZLBL1,ZLBL2)
!
!============
! idecl:  explicitize implicit INTEGER declarations:
  use iso_c_binding, only: fp => c_double
  use sigtabl_mod   
  use alpcom_mod
  use alcom_mod
  IMPLICIT NONE
  INTEGER isigind_z,ix,ier
!============
! idecl:  explicitize implicit REAL declarations:
 real(fp) zerel,zsum,zsigma,dosigx_z
!============
 INTEGER INDXR(2)
 CHARACTER*(*) ZLBL1
 CHARACTER*(*) ZLBL2
!
!  INPUT ZEREL = REL. ENERGY AT WHICH TO EVALUATE CROSS SECTION
!        INDXR = REACTION INDICES (IF ALREADY KNOWN) OR ZERO
!        ZLBL1,ZLBL2 = REACTION LABELS (USED IF INDEX NOT KNOWN)
!
!  OUTPUT INDXR = NONZERO REACTION INDICES (IF INDXR=0 ON INPUT)
!         DOSIG2 = CROSS SECTION (INTERPOLATED OR EXTRAPOLATED FROM
!                 ALADDIN DATA)
!
!------------------------------------------------------------------------------
!
 IF(INDXR(1).EQ.0) THEN
    INDXR(1)=ISIGIND_Z(ZLBL1)
    INDXR(2)=ISIGIND_Z(ZLBL2)
 ENDIF
!
 ZSUM = 0.0_fp
!
 DO IX=1,2
    IF((ALEMIN(INDXR(IX)).LE.ZEREL).AND.&
         (ZEREL.LE.ALEMAX(INDXR(IX)))) THEN
!
!  IN RANGE -- USE FIT
       NCF=NALPCF(INDXR(IX))
       CF(1:ncf)=ALPCF(1:ncf,INDXR(IX))
       CALL ALAD_EVAL_Z(ZEREL,ZSIGMA,1,IER)
    ELSE
!
!  OUT OF RANGE -- USE EXTRAPOLATION
       ZSIGMA=DOSIGX_Z(ZEREL,INDXR(IX))
    ENDIF
!
    ZSUM=ZSUM+ZSIGMA
 enddo
 DOSIG2_Z=ZSUM
!
 RETURN
END FUNCTION DOSIG2_Z
!
!------------------------------------------------------------------------------
! 30Jun2000 fgtok -s r8_precision.sub "r8con.csh conversion"
