Prepare an array of wavevectors in a given block (in A^2) which are saved in the S-matrix file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | channel_indices_(:) |
holds the indices pointing to the basis arrays |
||
real(kind=dp), | intent(inout) | :: | wavevectors_(:) |
array of wavevectors (in A^2) |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int32), | private | :: | index_ | ||||
real(kind=dp), | private | :: | internal_energy_ | ||||
integer(kind=int32), | private | :: | wv_index_ |
subroutine prepare_wavevector_array(channel_indices_, wavevectors_)
!! Prepare an array of wavevectors in a given block (in A^2)
!! which are saved in the S-matrix file
!---------------------------------------------------------------------!
integer(int32), intent(in) :: channel_indices_(:)
!! holds the indices pointing to the basis arrays
real(dp), intent(inout) :: wavevectors_(:)
!! array of wavevectors (in A^2)
!---------------------------------------------------------------------!
integer(int32) :: index_, wv_index_
real(dp) :: internal_energy_
!---------------------------------------------------------------------!
wv_index_ = 0
do index_ = 1, size(channel_indices_)
internal_energy_ = internal_energies(channel_indices_(index_))
if (is_open(internal_energy_)) then
wv_index_ = wv_index_ + 1
wavevectors_ (wv_index_) = &
sqrt( wavevector_squared_from_energy(internal_energy_) ) &
/ bohr_to_angstrom
endif
enddo
!---------------------------------------------------------------------!
if (wv_index_ /= size(wavevectors_)) then
call write_error("prepare_wavevector_array: mismatch between " // &
"number of open channels and size of wavevectors array")
endif
!---------------------------------------------------------------------!
end subroutine prepare_wavevector_array