set_hzero_lorentz_collisions_matrix Subroutine

private subroutine set_hzero_lorentz_collisions_matrix(aa, bb, cc, je, ik, is)

Special behaviour when h=0 for passing non-zonal electrons

The effect of these changes is to exclude passing electrons From pitch angle scattering, and to enforce 0 passing as a boundary condition For the trapped particle pitch angle scattering.

Arguments

Type IntentOptional Attributes Name
real, intent(inout), dimension(:) :: aa
real, intent(inout), dimension(:) :: bb
real, intent(inout), dimension(:) :: cc
integer, intent(in) :: je
integer, intent(in) :: ik
integer, intent(in) :: is

Contents


Source Code

  subroutine set_hzero_lorentz_collisions_matrix(aa, bb, cc, je, ik, is)
    use species, only: is_hybrid_electron_species, spec
    use kt_grids, only: aky
    use le_grids, only: ng2, grid_has_trapped_particles
    use warning_helpers, only: is_not_zero
    implicit none
    real, dimension(:), intent(in out) :: aa, bb, cc
    integer, intent(in) :: je, ik, is
    !> il index of 1st non-wfb trapped particle
    integer :: il_llim
    !> il index of last non-wfb trapped particle
    integer :: il_ulim

    il_llim = ng2 + 2
    il_ulim = 2*je-1 - (ng2+ 1)

    ! If not trapped particles then need to adjust limits
    ! Want to force aa = cc = 0 ; bb = 1
    if (.not. grid_has_trapped_particles()) then
       il_llim = ng2 + 1 ; il_ulim = ng2 -1
    end if

    if ( is_hybrid_electron_species(spec(is)) .and. is_not_zero(aky(ik))) then
       aa(:il_llim) = 0.
       bb(:il_llim-1) = 1.
       cc(:il_llim-1) = 0.
       aa(il_ulim+1:) = 0.
       bb(il_ulim+1:) = 1.
       cc(il_ulim:) = 0.
    endif
  end subroutine set_hzero_lorentz_collisions_matrix