prepare_wavevector_array Subroutine

public 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

Arguments

Type IntentOptional 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)


Calls

proc~~prepare_wavevector_array~~CallsGraph proc~prepare_wavevector_array prepare_wavevector_array proc~is_open is_open proc~prepare_wavevector_array->proc~is_open proc~write_error write_error proc~prepare_wavevector_array->proc~write_error proc~wavevector_squared_from_energy wavevector_squared_from_energy proc~prepare_wavevector_array->proc~wavevector_squared_from_energy proc~total_energy total_energy proc~is_open->proc~total_energy proc~write_message write_message proc~write_error->proc~write_message proc~wavevector_squared_from_energy->proc~write_error proc~wavevector_squared_from_energy->proc~total_energy

Called by

proc~~prepare_wavevector_array~~CalledByGraph proc~prepare_wavevector_array prepare_wavevector_array program~scattering SCATTERING program~scattering->proc~prepare_wavevector_array

Contents


Variables

Type Visibility Attributes Name Initial
integer(kind=int32), private :: index_
real(kind=dp), private :: internal_energy_
integer(kind=int32), private :: wv_index_

Source Code

      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