get_fields Subroutine

public subroutine get_fields(params, vars, F)

Arguments

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

Core KORC simulation parameters.

type(PARTICLES), intent(inout) :: vars

An instance of the KORC derived type PARTICLES.

type(FIELDS), intent(in) :: F

An instance of the KORC derived type FIELDS.


Contents

Source Code


Source Code

  subroutine get_fields(params,vars,F)
    !! @note Inferface with calls to subroutines for calculating the electric 
    !! and magnetic field for each particle in the simulation. @endnote
    TYPE(KORC_PARAMS), INTENT(IN)      :: params
    !! Core KORC simulation parameters.
    TYPE(PARTICLES), INTENT(INOUT)     :: vars
    !!  An instance of the KORC derived type PARTICLES.
    TYPE(FIELDS), INTENT(IN)           :: F
    !! An instance of the KORC derived type FIELDS.

    if (params%field_model(1:10).eq.'ANALYTICAL') then
    !SELECT CASE (TRIM(params%field_model))
    !CASE('ANALYTICAL')
       if (params%field_eval.eq.'eqn') then
          call get_analytical_fields(params,vars, F)
       else
          call interp_fields(params,vars, F)          
       end if
    else if (params%field_model(1:8).eq.'EXTERNAL') then

       !       write(6,'("2 size of PSI_P: ",I16)') size(vars%PSI_P)

       call interp_fields(params,vars, F)

!       write(6,'("get_fields")')
!       write(6,'("B_X: ",E17.10)') vars%B(:,1)
!       write(6,'("B_Z: ",E17.10)') vars%B(:,2)
!       write(6,'("B_Y: ",E17.10)') vars%B(:,3)
       
       !if (F%Efield.AND..NOT.F%Efield_in_file) then
       !   call analytical_electric_field_cyl(F,vars%Y,vars%E,vars%flag)
       !end if
    else if (params%field_model.eq.'UNIFORM') then

       call uniform_fields(vars, F)
    end if
  end subroutine get_fields