!------------------------------------------------------------------------------
!
!  DOSIG_Z -- EVALUATE A CROSS SECTION FROM ALADDIN DATA
!
real(fp) FUNCTION DOSIG_Z(ZEREL,INDXR,ZLBL)
!============
! 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 indxr,isigind_z,ier
!============
! idecl:  explicitize implicit REAL declarations:
  real(fp) zerel,zsigma,dosigx_z
!============
  CHARACTER*(*) ZLBL
!
!  INPUT ZEREL = REL. ENERGY AT WHICH TO EVALUATE CROSS SECTION
!        INDXR = REACTION INDEX (IF ALREADY KNOWN) OR ZERO
!        ZLBL  = REACTION LABEL (USED IF INDEX NOT KNOWN)
!
!  OUTPUT INDXR = NONZERO REACTION INDEX (IF INDXR=0 ON INPUT)
!         DOSIG = CROSS SECTION (INTERPOLATED OR EXTRAPOLATED FROM
!                 ALADDIN DATA)
!
!------------------------------------------------------------------------------
!
  IF(INDXR.EQ.0) THEN
     INDXR=ISIGIND_Z(ZLBL)
  ENDIF
!
  IF((ALEMIN(INDXR).LE.ZEREL).AND.(ZEREL.LE.ALEMAX(INDXR))) THEN
!
!  IN RANGE -- USE FIT
     NCF=NALPCF(INDXR)
     CF(1:ncf)=ALPCF(1:ncf,INDXR)
     CALL ALAD_EVAL_Z(ZEREL,ZSIGMA,1,IER)
  ELSE
!
!  OUT OF RANGE -- USE EXTRAPOLATION
     ZSIGMA=DOSIGX_Z(ZEREL,INDXR)
  ENDIF
!
  DOSIG_Z=ZSIGMA
!
  RETURN
END FUNCTION DOSIG_Z
!
!------------------------------------------------------------------------------
! 30Jun2000 fgtok -s r8_precision.sub "r8con.csh conversion"
