get_profiles Subroutine

public subroutine get_profiles(params, vars, P, F)

Arguments

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

Core KORC simulation parameters.

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

An instance of PARTICLES containing the variables of a given species.

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.

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

An instance of the KORC derived type FIELDS.


Contents

Source Code


Source Code

  subroutine get_profiles(params,vars,P,F)
    !! @note Subrotuine that calls the appropriate subroutine for calculating
    !! or interpolating the plasma profiles at the particles' position. @endnote
    TYPE(KORC_PARAMS), INTENT(IN)  :: params
    !! Core KORC simulation parameters.
    TYPE(PARTICLES), INTENT(INOUT) :: vars
    !! An instance of PARTICLES containing the variables of a given species.
    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]].
    TYPE(FIELDS), INTENT(IN)                                   :: F
    !! An instance of the KORC derived type FIELDS.

    SELECT CASE (TRIM(params%profile_model))
    CASE('ANALYTICAL')

!       write(6,'("Y in: ",E17.10)') vars%Y(1,:)
       
       call cyl_to_cart(vars%Y, vars%X)

!       write(6,'("X getprof: ",E17.10)') vars%X(1,:)
       
       call cart_to_tor_check_if_confined(vars%X,F,vars%Y,vars%flag)

!       write(6,'("flag: ",I15)') vars%flag(1) 

       call get_analytical_profiles(P,vars%Y,vars%ne,vars%Te, &
            vars%Zeff,vars%flag)

       call cart_to_cyl(vars%X, vars%Y)

!       write(6,'("Y out: ",E17.10)') vars%Y(1,:)
    CASE('EXTERNAL')
       call interp_profiles(params,vars,P)
    CASE('UNIFORM')
       call uniform_profiles(vars,P)
    CASE DEFAULT
    END SELECT

  end subroutine get_profiles