subroutine load_params_ms(params)
TYPE(KORC_PARAMS), INTENT(INOUT) :: params
!REAL(rp) :: Te
! Background electron temperature in eV
!REAL(rp) :: ne
! Background electron density in 1/m^3
!INTEGER :: num_impurity_species
!REAL(rp), DIMENSION(10) :: Zo
! Full nuclear charge of each impurity: Z=1 for D, Z=10 for Ne
!REAL(rp), DIMENSION(10) :: Zj
! Atomic number of each impurity: Z=1 for D, Z=10 for Ne
!REAL(rp), DIMENSION(10) :: nz
! Impurity densities
!REAL(rp), DIMENSION(10) :: IZj
! Ionization energy of impurity in eV
!REAL(rp), DIMENSION(10) :: aZj
INTEGER :: i
!NAMELIST /CollisionParamsMultipleSpecies/ num_impurity_species,Te,ne, &
! Zo,Zj,nz,IZj
!open(unit=output_unit_write,file=TRIM(params%path_to_inputs), &
! status='OLD',form='formatted')
!read(output_unit_write,nml=CollisionParamsMultipleSpecies)
!close(output_unit_write)
if (params%profile_model(10:10).eq.'H') then
cparams_ms%num_impurity_species = 6
params%num_impurity_species = 6
else
cparams_ms%num_impurity_species = num_impurity_species
params%num_impurity_species = num_impurity_species
endif
ALLOCATE(cparams_ms%Zj(cparams_ms%num_impurity_species))
ALLOCATE(cparams_ms%Zo(cparams_ms%num_impurity_species))
ALLOCATE(cparams_ms%nz(cparams_ms%num_impurity_species))
ALLOCATE(cparams_ms%neb(cparams_ms%num_impurity_species))
ALLOCATE(cparams_ms%IZj(cparams_ms%num_impurity_species))
ALLOCATE(cparams_ms%aZj(cparams_ms%num_impurity_species))
ALLOCATE(cparams_ms%Ee_IZj(cparams_ms%num_impurity_species))
cparams_ms%Te = Te_mult*C_E
cparams_ms%ne = ne_mult
cparams_ms%nH = ne_mult
if (params%profile_model.eq.'M3D_C1') then
do i=1,cparams_ms%num_impurity_species
cparams_ms%Zj(i) = real(i)-1._rp
cparams_ms%Zo(i) = Zo_mult(1)
end do
cparams_ms%nz(1) = nz_mult(1)
params%Zj=cparams_ms%Zj
elseif (params%profile_model(10:10).eq.'H') then
cparams_ms%Zj(1)=0
cparams_ms%Zo(1)=18
cparams_ms%Zj(2)=1
cparams_ms%Zo(2)=18
cparams_ms%Zj(3)=2
cparams_ms%Zo(3)=18
cparams_ms%Zj(4)=3
cparams_ms%Zo(4)=18
cparams_ms%Zj(5)=0
cparams_ms%Zo(5)=1
cparams_ms%Zj(6)=1
cparams_ms%Zo(6)=1
cparams_ms%nz(1) = nz_mult(1)
params%Zj=cparams_ms%Zj
else
cparams_ms%Zj = Zj_mult(1:cparams_ms%num_impurity_species)
cparams_ms%Zo = Zo_mult(1:cparams_ms%num_impurity_species)
cparams_ms%nz = nz_mult(1:cparams_ms%num_impurity_species)
endif
if (.not.(params%profile_model(10:10).eq.'H')) then
do i=1,cparams_ms%num_impurity_species
if (int(cparams_ms%Zo(i)).eq.1) then
cparams_ms%IZj(i) = C_E*cparams_ms%IH(int(cparams_ms%Zj(i)+1))
cparams_ms%aZj(i) = cparams_ms%aH(int(cparams_ms%Zj(i)+1))
else if (int(cparams_ms%Zo(i)).eq.6) then
cparams_ms%IZj(i) = C_E*cparams_ms%IC(int(cparams_ms%Zj(i)+1))
cparams_ms%aZj(i) = cparams_ms%aC(int(cparams_ms%Zj(i)+1))
else if (int(cparams_ms%Zo(i)).eq.10) then
cparams_ms%IZj(i) = C_E*cparams_ms%INe(int(cparams_ms%Zj(i)+1))
cparams_ms%aZj(i) = cparams_ms%aNe(int(cparams_ms%Zj(i)+1))
else if (int(cparams_ms%Zo(i)).eq.18) then
cparams_ms%IZj(i) = C_E*cparams_ms%IAr(int(cparams_ms%Zj(i)+1))
cparams_ms%aZj(i) = cparams_ms%aAr(int(cparams_ms%Zj(i)+1))
else
if (params%mpi_params%rank .EQ. 0) then
write(output_unit_write,'("Atomic number not defined!")')
end if
exit
end if
end do
else
cparams_ms%IZj(1) = C_E*cparams_ms%IAr(1)
cparams_ms%aZj(1) = cparams_ms%aAr(1)
cparams_ms%IZj(2) = C_E*cparams_ms%IAr(2)
cparams_ms%aZj(2) = cparams_ms%aAr(2)
cparams_ms%IZj(3) = C_E*cparams_ms%IAr(3)
cparams_ms%aZj(3) = cparams_ms%aAr(3)
cparams_ms%IZj(4) = C_E*cparams_ms%IAr(4)
cparams_ms%aZj(4) = cparams_ms%aAr(4)
cparams_ms%IZj(5) = C_E*cparams_ms%IH(1)
cparams_ms%aZj(5) = cparams_ms%aH(1)
cparams_ms%IZj(6) = C_E*cparams_ms%IH(2)
cparams_ms%aZj(6) = cparams_ms%aH(2)
endif
cparams_ms%nef = ne_mult + sum(cparams_ms%Zj*cparams_ms%nz)
cparams_ms%neb = (cparams_ms%Zo-cparams_ms%Zj)*cparams_ms%nz
cparams_ms%rD = SQRT( C_E0*cparams_ms%Te/(cparams_ms%ne*C_E**2) )
cparams_ms%re = C_RE
cparams_ms%Ee_IZj = C_ME*C_C**2/cparams_ms%IZj
cparams_ms%neut_prof=neut_prof
cparams_ms%Gammac_min = Gammac_wu(params,cparams_ss%P%n_ne,cparams_ss%Te)
cparams_ms%LargeCollisions = LargeCollisions
if (params%mpi_params%rank .EQ. 0) then
write(output_unit_write,'("Number of impurity species: ",I16)')&
cparams_ms%num_impurity_species
do i=1,cparams_ms%num_impurity_species
if (cparams_ms%Zo(i).eq.1) then
write(output_unit_write,'("H with charge state: ",I16)') int(cparams_ms%Zj(i))
write(output_unit_write,'("Mean excitation energy I (eV)",E17.10)') &
cparams_ms%IZj(i)/C_E
write(output_unit_write,'("Effective ion length scale a (a_0)",E17.10)') &
cparams_ms%aZj(i)
else if (cparams_ms%Zo(i).eq.6) then
write(output_unit_write,'("C with charge state: ",I16)') int(cparams_ms%Zj(i))
write(output_unit_write,'("Mean excitation energy I (eV)",E17.10)') &
cparams_ms%IZj(i)/C_E
write(output_unit_write,'("Effective ion length scale a (a_0)",E17.10)') &
cparams_ms%aZj(i)
else if (cparams_ms%Zo(i).eq.10) then
write(output_unit_write,'("Ne with charge state: ",I16)') int(cparams_ms%Zj(i))
write(output_unit_write,'("Mean excitation energy I (eV)",E17.10)') &
cparams_ms%IZj(i)/C_E
write(output_unit_write,'("Effective ion length scale a (a_0)",E17.10)') &
cparams_ms%aZj(i)
else if (cparams_ms%Zo(i).eq.18) then
write(output_unit_write,'("Ar with charge state: ",I16)') int(cparams_ms%Zj(i))
write(output_unit_write,'("Mean excitation energy I (eV)",E17.10)') &
cparams_ms%IZj(i)/C_E
write(output_unit_write,'("Effective ion length scale a (a_0)",E17.10)') &
cparams_ms%aZj(i)
end if
end do
end if
end subroutine load_params_ms