interp_profiles Subroutine

public subroutine interp_profiles(params, prtcls, P)

Arguments

Type IntentOptional AttributesName
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.


Calls

proc~~interp_profiles~~CallsGraph proc~interp_profiles interp_profiles proc~check_if_in_profiles_domain check_if_in_profiles_domain proc~interp_profiles->proc~check_if_in_profiles_domain proc~interp_3d_profiles interp_3D_profiles proc~interp_profiles->proc~interp_3d_profiles proc~korc_abort korc_abort proc~interp_profiles->proc~korc_abort proc~interp_2d_profiles interp_2D_profiles proc~interp_profiles->proc~interp_2d_profiles proc~get_fio_profile get_fio_profile proc~interp_profiles->proc~get_fio_profile ezspline_error ezspline_error proc~interp_3d_profiles->ezspline_error mpi_abort mpi_abort proc~korc_abort->mpi_abort proc~interp_2d_profiles->ezspline_error interface~fio_eval_field fio_eval_field proc~get_fio_profile->interface~fio_eval_field

Called by

proc~~interp_profiles~~CalledByGraph proc~interp_profiles interp_profiles proc~get_profiles get_profiles proc~get_profiles->proc~interp_profiles proc~avalanche_4d Avalanche_4D proc~avalanche_4d->proc~get_profiles proc~get_avalanche_4d get_Avalanche_4D proc~get_avalanche_4d->proc~avalanche_4d

Contents

Source Code


Source Code

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