print_gmbe_intersection_debug Subroutine

public subroutine print_gmbe_intersection_debug(n_intersections, n_monomers, intersection_sets, intersection_levels, intersection_results)

Print debug information about GMBE intersections

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_intersections
integer, intent(in) :: n_monomers
integer, intent(in) :: intersection_sets(:,:)
integer, intent(in) :: intersection_levels(:)
type(calculation_result_t), intent(in) :: intersection_results(:)

Calls

proc~~print_gmbe_intersection_debug~~CallsGraph proc~print_gmbe_intersection_debug print_gmbe_intersection_debug debug debug proc~print_gmbe_intersection_debug->debug proc~energy_total energy_t%energy_total proc~print_gmbe_intersection_debug->proc~energy_total proc~mp2_total mp2_energy_t%mp2_total proc~energy_total->proc~mp2_total

Called by

proc~~print_gmbe_intersection_debug~~CalledByGraph proc~print_gmbe_intersection_debug print_gmbe_intersection_debug proc~compute_gmbe compute_gmbe proc~compute_gmbe->proc~print_gmbe_intersection_debug

Variables

Type Visibility Attributes Name Initial
character(len=512), private :: detail_line
integer, private :: i
integer, private :: j
integer, private :: set_size
character(len=256), private :: set_str
real(kind=dp), private :: sign_factor

Source Code

   subroutine print_gmbe_intersection_debug(n_intersections, n_monomers, intersection_sets, &
                                            intersection_levels, intersection_results)
      !! Print debug information about GMBE intersections
      integer, intent(in) :: n_intersections, n_monomers
      integer, intent(in) :: intersection_sets(:, :)
      integer, intent(in) :: intersection_levels(:)
      type(calculation_result_t), intent(in) :: intersection_results(:)

      integer :: i, j, set_size
      real(dp) :: sign_factor
      character(len=512) :: detail_line
      character(len=256) :: set_str

      if (n_intersections > 0) then
         call logger%debug("GMBE intersection details:")
         do i = 1, n_intersections
            set_str = "("
            set_size = 0
            do j = 1, n_monomers
               if (intersection_sets(j, i) > 0) then
                  if (set_size > 0) set_str = trim(set_str)//","
                  write (set_str, '(a,i0)') trim(set_str), intersection_sets(j, i)
                  set_size = set_size + 1
               end if
            end do
            set_str = trim(set_str)//")"

            sign_factor = real((-1)**(intersection_levels(i) + 1), dp)
            write (detail_line, '(a,i0,a,i0,a,a,a,f16.8)') &
               "  Intersection ", i, ": level=", intersection_levels(i), &
               " fragments=", trim(set_str), " energy=", intersection_results(i)%energy%total()
            call logger%debug(trim(detail_line))
         end do
      end if
   end subroutine print_gmbe_intersection_debug