set_up_particles_ic Subroutine

public subroutine set_up_particles_ic(params, F, spp, P)

Arguments

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

Core KORC simulation parameters.

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

An instance of KORC's derived type FIELDS containing all the information about the fields used in the simulation. See korc_types and korc_fields.

type(SPECIES), intent(inout), DIMENSION(:), ALLOCATABLE:: spp

An instance of KORC's derived type SPECIES containing all the information of different electron species. See korc_types.

type(PROFILES), intent(in) :: P

An instance of the KORC derived type PROFILES.


Contents

Source Code


Source Code

subroutine set_up_particles_ic(params,F,spp,P)
  !! @note Subroutine with calls to subroutines to load particles' 
  !! information if it is a restarting simulation, or to initialize the
  !! spatial and velocity distribution of each species if it is a new  
  !! simulation. @endnote
  TYPE(KORC_PARAMS), INTENT(INOUT) 				:: params
  !! Core KORC simulation parameters.
  TYPE(FIELDS), INTENT(INOUT) 					:: F
  !! An instance of KORC's derived type FIELDS containing all 
  !! the information about the fields used in the simulation. 
  !! See [[korc_types]] and [[korc_fields]].
  TYPE(SPECIES), DIMENSION(:), ALLOCATABLE, INTENT(INOUT)       :: spp
  !! An instance of KORC's derived type SPECIES containing all 
  !! the information of different electron species. See [[korc_types]].
  TYPE(PROFILES), INTENT(IN)                                 :: P
  !! An instance of the KORC derived type PROFILES.
  INTEGER                                                    :: ii
  !! Species iterator.

  if (params%restart.OR.params%proceed.or.params%reinit) then
     call load_particles_ic(params,spp,F)

     call init_random_seed()
     
  else
     call intitial_spatial_distribution(params,spp,P,F)
     
     call initial_gyro_distribution(params,F,spp)
  end if
  
end subroutine set_up_particles_ic