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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
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)
if(params%LargeCollisions.and.(.not.params%load_balance)) then
do ii=1_idef,params%num_species
spp(ii)%pRE=int(sum(float(spp(ii)%vars%flagRE)))
end do
end if
!write(6,*) 'flagRE',spp(1)%vars%flagRE
!write(6,*) 'pRE',spp(1)%pRE
call init_random_seed()
else
if (params%mpi_params%rank .EQ. 0) then
write(output_unit_write,'("* * * * INITIALIZING SPATIAL DISTRIBUTION * * * *")')
flush(output_unit_write)
end if
call intitial_spatial_distribution(params,spp,P,F)
if (params%mpi_params%rank .EQ. 0) then
write(output_unit_write,'("* * * * * * * * * * * * * * * * * * * * * * * *",/)')
end if
if (params%mpi_params%rank .EQ. 0) then
write(output_unit_write,'("* * * * INITIALIZING VELOCITY COMPONENTS * * * *")')
end if
call initial_gyro_distribution(params,F,spp)
if (params%mpi_params%rank .EQ. 0) then
write(output_unit_write,'("* * * * * * * * * * * * * * * * * * * * * * * *",/)')
end if
end if
end subroutine set_up_particles_ic