Inferface with calls to subroutines for calculating the electric and magnetic field for each particle in the simulation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
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.
!write(6,*) params%field_model
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(output_unit_write,'("2 size of PSI_P: ",I16)') size(vars%PSI_P)
call interp_fields(params,vars, F)
! write(output_unit_write,'("get_fields")')
! write(output_unit_write,'("B_X: ",E17.10)') vars%B(:,1)
! write(output_unit_write,'("B_Z: ",E17.10)') vars%B(:,2)
! write(output_unit_write,'("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%flagCon)
!end if
else if (TRIM(params%field_model).eq.'M3D_C1'.or. &
TRIM(params%field_model).eq.'NIMROD') then
!write(6,*) 'get_fields'
call interp_fields(params,vars, F)
else if (params%field_model.eq.'UNIFORM') then
call uniform_fields(vars, F)
end if
end subroutine get_fields