find_ras_size Subroutine

public pure subroutine find_ras_size(ras, classes, space_size)

Arguments

Type IntentOptional Attributes Name
type(ras_parameters), intent(in) :: ras
type(ras_class_data), intent(in) :: classes(:)
integer, intent(out) :: space_size

Contents

Source Code


Source Code

    pure subroutine find_ras_size(ras, classes, space_size)

        type(ras_parameters), intent(in) :: ras
        type(ras_class_data), intent(in) :: classes(:)
        integer, intent(out) :: space_size
        integer :: i, j, k, l
        integer :: temp_class

        space_size = 0

        ! Loop over all classes, call it class_i.
        do i = 1, ras%num_classes
            ! For this class, loop over all classes which can be combined with this one,
            ! call it class_j.
            do j = 1, classes(i)%num_comb
                temp_class = classes(i)%allowed_combns(j)
                ! Loop over all symmetries for class_i.
                do k = 0, 7
                    ! Required symmetry for class_j.
                    l = ieor(HFSym_ras, k)
                    ! Finally, add the total number of combinations of strings from the two
                    ! classes with these symmetry labels.
                    space_size = space_size + &
                                 int(classes(i)%num_sym(k) * classes(temp_class)%num_sym(l))
                end do
            end do
        end do

    end subroutine find_ras_size