MODFLOW 6  version 6.7.0.dev2
USGS Modular Hydrologic Model
linearalgebrautilsmodule Module Reference

Functions/Subroutines

pure real(dp) function, dimension(:, :), allocatable, public eye (n)
 
pure real(dp) function, dimension(size(a), size(b)), public outer_product (A, B)
 
real(dp) function, dimension(3), public cross_product (a, b)
 

Function/Subroutine Documentation

◆ cross_product()

real(dp) function, dimension(3), public linearalgebrautilsmodule::cross_product ( real(dp), dimension(3), intent(in)  a,
real(dp), dimension(3), intent(in)  b 
)

Definition at line 39 of file LinearAlgebraUtils.f90.

40  ! -- return
41  real(DP), dimension(3) :: c
42  ! -- dummy
43  real(DP), dimension(3), intent(in) :: a
44  real(DP), dimension(3), intent(in) :: b
45 
46  c(1) = a(2) * b(3) - a(3) * b(2)
47  c(2) = a(3) * b(1) - a(1) * b(3)
48  c(3) = a(1) * b(2) - a(2) * b(1)

◆ eye()

pure real(dp) function, dimension(:, :), allocatable, public linearalgebrautilsmodule::eye ( integer(i4b), intent(in)  n)

Definition at line 11 of file LinearAlgebraUtils.f90.

12  ! -- dummy
13  integer(I4B), intent(in) :: n
14  real(DP), dimension(:, :), allocatable :: A
15  ! -- locals
16  integer(I4B) :: i
17 
18  allocate (a(n, n))
19  a = 0.0_dp
20  do i = 1, n
21  a(i, i) = 1.0_dp
22  end do
Here is the caller graph for this function:

◆ outer_product()

pure real(dp) function, dimension(size(a), size(b)), public linearalgebrautilsmodule::outer_product ( real(dp), dimension(:), intent(in)  A,
real(dp), dimension(:), intent(in)  B 
)

Definition at line 25 of file LinearAlgebraUtils.f90.

26  ! -- dummy
27  real(DP), intent(in) :: A(:), B(:)
28  real(DP) :: AB(size(A), size(B))
29  ! -- locals
30  integer :: nA, nB
31 
32  na = size(a)
33  nb = size(b)
34 
35  ab = spread(source=a, dim=2, ncopies=nb) * &
36  spread(source=b, dim=1, ncopies=na)
Here is the caller graph for this function: