d2norm Function

private pure function d2norm(a, b)

Returns with precautions to avoid overflow.

History

  • 21 Mar 1990: First version.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a
real(kind=wp), intent(in) :: b

Return Value real(kind=wp)


Called by

proc~~d2norm~~CalledByGraph proc~d2norm lsqr_module::d2norm proc~lsqr lsqr_module::lsqr_solver%LSQR proc~lsqr->proc~d2norm proc~solve_ez lsqr_module::lsqr_solver_ez%solve_ez proc~solve_ez->proc~lsqr

Source Code

   pure function d2norm( a, b )

   real(wp) :: d2norm
   real(wp),intent(in) :: a
   real(wp),intent(in) :: b

   real(wp) :: scale

   scale  = abs( a ) + abs( b )
   if (scale == zero) then
      d2norm = zero
   else
      d2norm = scale * sqrt( (a/scale)**2   +  (b/scale)**2 )
   end if

   end function d2norm