print_gmbe_gradient_info Subroutine

public subroutine print_gmbe_gradient_info(total_gradient, sys_geom, current_log_level)

Print GMBE gradient information

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: total_gradient(:,:)
type(system_geometry_t), intent(in) :: sys_geom
integer, intent(in) :: current_log_level

Calls

proc~~print_gmbe_gradient_info~~CallsGraph proc~print_gmbe_gradient_info print_gmbe_gradient_info info info proc~print_gmbe_gradient_info->info to_char to_char proc~print_gmbe_gradient_info->to_char

Called by

proc~~print_gmbe_gradient_info~~CalledByGraph proc~print_gmbe_gradient_info print_gmbe_gradient_info proc~compute_gmbe compute_gmbe proc~compute_gmbe->proc~print_gmbe_gradient_info

Variables

Type Visibility Attributes Name Initial
character(len=256), private :: grad_line
integer, private :: iatom

Source Code

   subroutine print_gmbe_gradient_info(total_gradient, sys_geom, current_log_level)
      !! Print GMBE gradient information
      real(dp), intent(in) :: total_gradient(:, :)
      type(system_geometry_t), intent(in) :: sys_geom
      integer, intent(in) :: current_log_level

      integer :: iatom
      character(len=256) :: grad_line

      call logger%info("GMBE gradient computation completed")
      call logger%info("  Total gradient norm: "//to_char(sqrt(sum(total_gradient**2))))

      if (current_log_level >= info_level .and. sys_geom%total_atoms < 100) then
         call logger%info(" ")
         call logger%info("Total GMBE Gradient (Hartree/Bohr):")
         do iatom = 1, sys_geom%total_atoms
            write (grad_line, '(a,i5,a,3f20.12)') "  Atom ", iatom, ": ", &
               total_gradient(1, iatom), total_gradient(2, iatom), total_gradient(3, iatom)
            call logger%info(trim(grad_line))
         end do
         call logger%info(" ")
      end if
   end subroutine print_gmbe_gradient_info