driver Subroutine

public subroutine driver(edrive, gainve, etave, gain, etadrv)

Routine to calculate parameters of a generic driver suitable for inertial fusion energy author: P J Knight, CCFE, Culham Science Centre edrive : input real : Driver energy (J) gainve(10) : input real array : Gain vs energy data etave(10) : input real array : Driver efficiency vs energy data gain : output real : Target gain etadrv : output real : Driver efficiency This routine calculates the parameters of a generic driver suitable for inertial fusion energy. Gain and driver efficiency data are interpolated from input data. F/MI/PJK/LOGBOOK12, p.85

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: edrive
real(kind=dp), intent(in), dimension(10):: gainve
real(kind=dp), intent(in), dimension(10):: etave
real(kind=dp), intent(out) :: gain
real(kind=dp), intent(out) :: etadrv

Contents

Source Code


Source Code

  subroutine driver(edrive,gainve,etave,gain,etadrv)

    !! Routine to calculate parameters of a generic driver
    !! suitable for inertial fusion energy
    !! author: P J Knight, CCFE, Culham Science Centre
    !! edrive : input real : Driver energy (J)
    !! gainve(10) : input real array : Gain vs energy data
    !! etave(10) : input real array : Driver efficiency vs energy data
    !! gain   : output real : Target gain
    !! etadrv : output real : Driver efficiency
    !! This routine calculates the parameters of a generic driver
    !! suitable for inertial fusion energy.
    !! Gain and driver efficiency data are interpolated from input data.
    !! F/MI/PJK/LOGBOOK12, p.85
    !!
    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    implicit none

    !  Arguments

    real(dp), intent(in) :: edrive
    real(dp), dimension(10), intent(in) :: etave,gainve
    real(dp), intent(out) :: etadrv,gain

    !  Local variables

    real(dp) :: de,e
    integer :: ie

    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    !  The arrays contain data points for EDRIVE = 1MJ, 2MJ, ... , 10MJ

    e = 1.0D-6 * edrive
    ie = int(e)
    de = e - dble(ie)

    !  Assume linear interpolations and extrapolations

    if (ie <= 1) then

       gain =  gainve(2) - 1.0D-6*(edrive-2.0D6)*(gainve(1)-gainve(2))
       etadrv = etave(2) - 1.0D-6*(edrive-2.0D6)*(etave(1)-etave(2))

    else if (ie >= 9) then

       gain =  gainve(9) + 1.0D-6*(edrive-9.0D6)*(gainve(10)-gainve(9))
       etadrv = etave(9) + 1.0D-6*(edrive-9.0D6)*(etave(10)-etave(9))

    else

       gain =  gainve(ie) + de*(gainve(ie+1)-gainve(ie))
       etadrv = etave(ie) + de*(etave(ie+1)-etave(ie))

    end if

    !  Ensure sensible values

    gain = max(0.01D0,gain)
    etadrv = max(0.01D0,etadrv)

  end subroutine driver