Subroutine that calls the appropriate subroutines for interpolating the 2-D or 3-D plasma profiles to the particles' position.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | Core KORC simulation parameters. |
||
type(PARTICLES), | intent(inout) | :: | prtcls | An instance of PARTICLES containing the variables of a given species. Call to this subroutine generally passes spp%vars. |
||
type(PROFILES), | intent(in) | :: | P | An instance of KORC's derived type PROFILES containing all the information about the plasma profiles used in the simulation. See[[ korc_types]] and korc_profiles. |
subroutine interp_profiles(params,prtcls,P)
!! @note Subroutine that calls the appropriate subroutines for
!! interpolating the 2-D or 3-D plasma profiles to the particles'
!! position. @endnote
TYPE(KORC_PARAMS), INTENT(IN) :: params
!! Core KORC simulation parameters.
TYPE(PARTICLES), INTENT(INOUT) :: prtcls
!! An instance of PARTICLES containing the variables of a
!! given species. Call to this subroutine generally passes spp%vars.
TYPE(PROFILES), INTENT(IN) :: P
!! An instance of KORC's derived type PROFILES containing all the
!! information about the plasma profiles used in the simulation.
!! See[[ korc_types]] and [[korc_profiles]].
if (.not.params%GC_coords) call cart_to_cyl(prtcls%X,prtcls%X)
!write(output_unit_write,'("Also R_buffer: ",E17.10)') prtcls%Y(1,1)
#ifdef PSPLINE
call check_if_in_profiles_domain(prtcls%Y, prtcls%flagCon)
#endif
if (ALLOCATED(P%ne_2D)) then
#ifdef PSPLINE
! write(output_unit_write,'("Also R_buffer: ",E17.10)') prtcls%X(1,1)
call interp_2D_profiles(prtcls%Y,prtcls%ne,prtcls%Te,prtcls%Zeff, &
prtcls%flagCon)
else if (ALLOCATED(P%ne_3D)) then
call interp_3D_profiles(prtcls%Y,prtcls%ne,prtcls%Te,prtcls%Zeff, &
prtcls%flagCon)
#endif
#ifdef FIO
else if (P%FIO_ne .ge. 0 .or. &
P%FIO_te .ge. 0 .or. &
P%FIO_zeff .ge. 0) then
call get_fio_profile(prtcls, P, params)
#endif
else
write(output_unit_write,'("Error: NO PROFILES ALLOCATED")')
call KORC_ABORT(16)
end if
end subroutine interp_profiles