!------------------------------------------------------------------------------
!
!  DOSIGX_Z -- DO EXTRAPOLATIONS OF ALADDIN FITS -- SIGTAB/ALADDIN
!
real(fp) FUNCTION DOSIGX_Z(ZEREL,INDXR)
!
!  INPUT:  ZEREL -- REL. ENERGY INPUT (EV/AMU)
!          INDXR -- REACTION INDEX
!
!  ZEREL IS ALREADY KNOWN TO BE OUTSIDE THE FIT RANGE FOR THE INDICATED
!   REACTION.
!
!  OUTPUT:  DOSIGX_Z -- THE EXTRAPOLATED CROSS-SECTION, CM**2
!
!
!  SIGTAB COMMON:
!
  use iso_c_binding, only: fp => c_double
  use sigtabl_mod   
  use physconst_mod, only : za2=>half
  IMPLICIT NONE
!============
! idecl:  explicitize implicit INTEGER declarations:
  INTEGER indxr
!===========
! idecl:  explicitize implicit REAL declarations:
  real(fp) zerel,zlss,zdle,zls,zlsx
!============
  IF(ZEREL.LE.ALEMIN(INDXR)) THEN
     ZLSS=ALSMIN(INDXR)
     ZDLE=log(ALEMIN(INDXR))-log(ZEREL)
     ZLS=log(ALAMIN(INDXR))
!
     ZLSX=ZLS-ZDLE*(ZLSS+ZDLE*ZA2)
!
  ELSE
!
     ZLSS=ALSMAX(INDXR)
     ZDLE=log(ZEREL)-log(ALEMAX(INDXR))
     ZLS=log(ALAMAX(INDXR))
!
     ZLSX=ZLS+ZDLE*(ZLSS-ZDLE*ZA2)
!
  ENDIF
!
  DOSIGX_Z=EXP(ZLSX)
!
  RETURN
END FUNCTION DOSIGX_Z
!
!------------------------------------------------------------------------------
! 30Jun2000 fgtok -s r8_precision.sub "r8con.csh conversion"
