update_avalanche_params Subroutine

private subroutine update_avalanche_params(params, prtcls)

Updates the avalanche parameters aval_params% at each step in the MCMC after the profiles are interpolated at the sampled R,Z location.

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(PARTICLES), intent(in) :: prtcls

An instance of PARTICLES containing the variables of a given species. Call to this subroutine generally passes spp%vars.


Called by

proc~~update_avalanche_params~~CalledByGraph proc~update_avalanche_params update_avalanche_params proc~avalanche_4d Avalanche_4D proc~avalanche_4d->proc~update_avalanche_params proc~get_avalanche_4d get_Avalanche_4D proc~get_avalanche_4d->proc~avalanche_4d

Contents


Source Code

SUBROUTINE update_avalanche_params(params,prtcls)
  !! Updates the avalanche parameters aval_params% at each step
  !! in the MCMC after the profiles are interpolated at the sampled
  !! R,Z location.
  TYPE(KORC_PARAMS), INTENT(IN) 	:: params
  !! Core KORC simulation parameters.
  TYPE(PARTICLES), INTENT(IN) :: prtcls
  !! An instance of PARTICLES containing the variables of a
  !! given species. Call to this subroutine generally passes spp%vars.

  aval_params%ne = prtcls%ne(1)*params%cpp%density
  aval_params%Zeff = prtcls%Zeff(1)
  aval_params%Te = prtcls%Te(1)*params%cpp%temperature ! In Joules
  
  aval_params%lD = SQRT(C_E0*aval_params%Te/(aval_params%ne*C_E**2))
  aval_params%bmin = aval_params%Zeff/(12.0_rp*C_PI*aval_params%ne* &
       aval_params%lD**2)
  aval_params%CoulombLog = LOG(aval_params%lD/aval_params%bmin)
  aval_params%Tau = 1.0_rp/(4.0_rp*C_PI*C_C*C_RE**2*aval_params%ne* &
       aval_params%CoulombLog)

  aval_params%Ec = C_ME*C_C/(C_E*aval_params%Tau)
  aval_params%Ebar = aval_params%Epar/aval_params%Ec

  aval_params%alpha = (aval_params%Ebar - 1.0_rp)/(1.0_rp +&
       aval_params%Zeff)
  aval_params%cz = SQRT(3.0_rp*(aval_params%Zeff + 5.0_rp)/C_PI)* &
       aval_params%CoulombLog
  aval_params%fo = aval_params%alpha/aval_params%cz
  aval_params%C1 = 0.5_rp*aval_params%alpha
  aval_params%C2 = 1.0_rp/aval_params%cz - aval_params%C1

  
END SUBROUTINE update_avalanche_params