get_block_indices Function

private function get_block_indices(v_, j_, channel_indices_) result(block_indices_)

Returns indices from channel_indices_ that match the specified quantum state.

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: v_

vibrational quantum number

integer(kind=int32), intent(in) :: j_

rotational quantum number

integer(kind=int32), intent(in) :: channel_indices_(:)

holds the indices pointing to the basis arrays

Return Value integer(kind=int32), allocatable, (:)

(output) indices that match the specified quantum state


Called by

proc~~get_block_indices~~CalledByGraph proc~get_block_indices get_block_indices proc~compute_individual_cross_section compute_individual_cross_section proc~compute_individual_cross_section->proc~get_block_indices proc~calculate_state_to_state_cross_section calculate_state_to_state_cross_section proc~calculate_state_to_state_cross_section->proc~compute_individual_cross_section program~scattering SCATTERING program~scattering->proc~calculate_state_to_state_cross_section

Contents

Source Code


Variables

Type Visibility Attributes Name Initial
integer(kind=int32), private :: index_
integer(kind=int32), private :: match_count_
integer(kind=int32), private :: number_of_channels_

Source Code

      function get_block_indices(v_, j_, channel_indices_) result(block_indices_)
         !! Returns indices from channel_indices_ that match the specified quantum state.
         integer(int32), intent(in) :: v_
            !! vibrational quantum number
         integer(int32), intent(in) :: j_
            !! rotational quantum number
         integer(int32), intent(in) :: channel_indices_(:)
            !! holds the indices pointing to the basis arrays
         integer(int32), allocatable :: block_indices_(:)
            !! (output) indices that match the specified quantum state
         !---------------------------------------------------------------------!
         integer(int32) :: number_of_channels_, match_count_, index_
         !---------------------------------------------------------------------!
         number_of_channels_ = size(channel_indices_)
         match_count_ = 0
         !---------------------------------------------------------------------!
         ! Count the number of matches to preallocate the array
         !---------------------------------------------------------------------!
         do index_ = 1, number_of_channels_
            if (vib_levels(channel_indices_(index_)) == v_ .and.               &
               rot_levels(channel_indices_(index_)) == j_) then
               match_count_ = match_count_ + 1
            endif
         enddo
         !---------------------------------------------------------------------!
         ! Allocate array with the correct size
         !---------------------------------------------------------------------!
         allocate(block_indices_(match_count_))
         match_count_ = 0
         !---------------------------------------------------------------------!
         ! Fill the array with matching indices.
         !---------------------------------------------------------------------!
         do index_ = 1, number_of_channels_
            if (vib_levels(channel_indices_(index_)) == v_ .and.               &
               rot_levels(channel_indices_(index_)) == j_) then
               match_count_ = match_count_ + 1
               block_indices_(match_count_) = index_
            endif
         enddo
         !---------------------------------------------------------------------!
      end function get_block_indices