MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
disv1dgeom Module Reference

Functions/Subroutines

real(dp) function, public calcdist (vertices, ivert1, ivert2)
 Calculate distance between two vertices. More...
 
subroutine, public line_unit_vector (x0, y0, x1, y1, xcomp, ycomp, vmag)
 Calculate distance between two vertices. More...
 

Function/Subroutine Documentation

◆ calcdist()

real(dp) function, public disv1dgeom::calcdist ( real(dp), dimension(:, :), intent(in)  vertices,
integer(i4b), intent(in)  ivert1,
integer(i4b), intent(in)  ivert2 
)

Definition at line 12 of file Disv1dGeom.f90.

13  ! -- dummy
14  real(DP), dimension(:, :), intent(in) :: vertices
15  integer(I4B), intent(in) :: ivert1
16  integer(I4B), intent(in) :: ivert2
17  real(DP) :: dist, xdist, ydist
18  ! -- local
19  !
20  ! -- calc distance
21  xdist = abs(vertices(1, ivert1) - vertices(1, ivert2))
22  ydist = abs(vertices(2, ivert1) - vertices(2, ivert2))
23  dist = sqrt(xdist * xdist + ydist * ydist)
24 
25  ! -- return
26  return
Here is the caller graph for this function:

◆ line_unit_vector()

subroutine, public disv1dgeom::line_unit_vector ( real(dp), intent(in)  x0,
real(dp), intent(in)  y0,
real(dp), intent(in)  x1,
real(dp), intent(in)  y1,
real(dp), intent(out)  xcomp,
real(dp), intent(out)  ycomp,
real(dp)  vmag 
)

Calculate the vector components (xcomp, ycomp, and zcomp) for a line defined by two points, (x0, y0, z0), (x1, y1, z1). Also return the magnitude of the original vector, vmag.

Definition at line 36 of file Disv1dGeom.f90.

38  real(DP), intent(in) :: x0
39  real(DP), intent(in) :: y0
40  real(DP), intent(in) :: x1
41  real(DP), intent(in) :: y1
42  real(DP), intent(out) :: xcomp
43  real(DP), intent(out) :: ycomp
44  real(DP) :: dx, dy, vmag
45  !
46  dx = x1 - x0
47  dy = y1 - y0
48  vmag = sqrt(dx**2 + dy**2)
49  xcomp = dx / vmag
50  ycomp = dy / vmag
51  return