MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
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)
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 33 of file Disv1dGeom.f90.

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