MODFLOW 6
version 6.7.0.dev0
USGS Modular Hydrologic Model
|
Functions/Subroutines | |
logical function, public | between (x, a, b) |
Check if a value is between two other values (inclusive). More... | |
logical function, public | point_in_polygon (x, y, poly) |
Check if a point is within a polygon. More... | |
integer(i4b) function, public | get_node (ilay, irow, icol, nlay, nrow, ncol) |
Get node number, given layer, row, and column indices for a structured grid. If any argument is invalid return -1. More... | |
subroutine, public | get_ijk (nodenumber, nrow, ncol, nlay, irow, icol, ilay) |
Get row, column and layer indices from node number and grid dimensions. If nodenumber is invalid, irow, icol, and ilay are -1. More... | |
subroutine, public | get_jk (nodenumber, ncpl, nlay, icpl, ilay) |
Get layer index and within-layer node index from node number and grid dimensions. If nodenumber is invalid, icpl and ilay are -1. More... | |
pure real(dp) function, dimension(2), public | skew (v, s, invert) |
Skew a 2D vector along the x-axis. More... | |
subroutine, public | transform (xin, yin, zin, xout, yout, zout, xorigin, yorigin, zorigin, sinrot, cosrot, invert) |
Apply a 3D translation and optional 2D rotation to coordinates. More... | |
subroutine, public | compose (xorigin, yorigin, zorigin, sinrot, cosrot, xorigin_new, yorigin_new, zorigin_new, sinrot_new, cosrot_new, invert) |
Apply a 3D translation and 2D rotation to an existing transformation. More... | |
subroutine | defaults (xorigin, yorigin, zorigin, sinrot, cosrot, invert, translate, rotate, xorigin_opt, yorigin_opt, zorigin_opt, sinrot_opt, cosrot_opt, invert_opt) |
Process arguments and set defaults. Internal use only. More... | |
real(dp) function, public | area (xv, yv, cw) |
Calculate polygon area, with vertices given in CW or CCW order. More... | |
subroutine, public | shared_face (iverts1, iverts2, iface) |
Find the lateral face shared by two cells. More... | |
subroutine, public | clamp_bary (alpha, beta, gamma, pad) |
Clamp barycentric coordinates to the interior of a triangle, with optional padding some minimum distance from any face. More... | |
real(dp) function, public geomutilmodule::area | ( | real(dp), dimension(:), intent(in) | xv, |
real(dp), dimension(:), intent(in) | yv, | ||
logical(lgp), intent(in), optional | cw | ||
) |
logical function, public geomutilmodule::between | ( | real(dp), intent(in) | x, |
real(dp), intent(in) | a, | ||
real(dp), intent(in) | b | ||
) |
subroutine, public geomutilmodule::clamp_bary | ( | real(dp), intent(inout) | alpha, |
real(dp), intent(inout) | beta, | ||
real(dp), intent(out) | gamma, | ||
real(dp), intent(in), optional | pad | ||
) |
This routine requires 0 <= tol <= 1/3 and 1 = alpha + beta + gamma.
Definition at line 465 of file GeomUtil.f90.
subroutine, public geomutilmodule::compose | ( | real(dp) | xorigin, |
real(dp) | yorigin, | ||
real(dp) | zorigin, | ||
real(dp) | sinrot, | ||
real(dp) | cosrot, | ||
real(dp), optional | xorigin_new, | ||
real(dp), optional | yorigin_new, | ||
real(dp), optional | zorigin_new, | ||
real(dp), optional | sinrot_new, | ||
real(dp), optional | cosrot_new, | ||
logical(lgp), optional | invert | ||
) |
zorigin | origin coordinates (original) |
cosrot | sine and cosine of rotation (original) |
zorigin_new | origin coordinates (new) |
cosrot_new | sine and cosine of rotation (new) |
invert | whether to invert |
Definition at line 238 of file GeomUtil.f90.
|
private |
subroutine, public geomutilmodule::get_ijk | ( | integer(i4b), intent(in) | nodenumber, |
integer(i4b), intent(in) | nrow, | ||
integer(i4b), intent(in) | ncol, | ||
integer(i4b), intent(in) | nlay, | ||
integer(i4b), intent(out) | irow, | ||
integer(i4b), intent(out) | icol, | ||
integer(i4b), intent(out) | ilay | ||
) |
subroutine, public geomutilmodule::get_jk | ( | integer(i4b), intent(in) | nodenumber, |
integer(i4b), intent(in) | ncpl, | ||
integer(i4b), intent(in) | nlay, | ||
integer(i4b), intent(out) | icpl, | ||
integer(i4b), intent(out) | ilay | ||
) |
integer(i4b) function, public geomutilmodule::get_node | ( | integer(i4b), intent(in) | ilay, |
integer(i4b), intent(in) | irow, | ||
integer(i4b), intent(in) | icol, | ||
integer(i4b), intent(in) | nlay, | ||
integer(i4b), intent(in) | nrow, | ||
integer(i4b), intent(in) | ncol | ||
) |
logical function, public geomutilmodule::point_in_polygon | ( | real(dp), intent(in) | x, |
real(dp), intent(in) | y, | ||
real(dp), dimension(:, :), intent(in), allocatable | poly | ||
) |
Vertices and edge points are considered in the polygon. Adapted from https://stackoverflow.com/a/63436180/6514033,
[in] | x | x point coordinate |
[in] | y | y point coordinate |
[in] | poly | polygon vertices (column-major indexing) |
Definition at line 26 of file GeomUtil.f90.
subroutine, public geomutilmodule::shared_face | ( | integer(i4b), dimension(:) | iverts1, |
integer(i4b), dimension(:) | iverts2, | ||
integer(i4b), intent(out) | iface | ||
) |
Find the lateral (x-y plane) face shared by the given cells. The iface return argument will be 0 if they share no such face, otherwise the index of the shared face in cell 1's vertex array, where face N connects vertex N to vertex N + 1 going clockwise.
Note: assumes the cells are convex and share at most 2 vertices and that both vertex arrays are oriented clockwise.
Definition at line 402 of file GeomUtil.f90.
pure real(dp) function, dimension(2), public geomutilmodule::skew | ( | real(dp), dimension(2), intent(in) | v, |
real(dp), dimension(3), intent(in) | s, | ||
logical(lgp), intent(in), optional | invert | ||
) |
[in] | v | vector |
[in] | s | skew matrix entries (top left, top right, bottom right) |
Definition at line 148 of file GeomUtil.f90.
subroutine, public geomutilmodule::transform | ( | real(dp) | xin, |
real(dp) | yin, | ||
real(dp) | zin, | ||
real(dp) | xout, | ||
real(dp) | yout, | ||
real(dp) | zout, | ||
real(dp), optional | xorigin, | ||
real(dp), optional | yorigin, | ||
real(dp), optional | zorigin, | ||
real(dp), optional | sinrot, | ||
real(dp), optional | cosrot, | ||
logical(lgp), optional | invert | ||
) |
zin | input coordinates |
zout | output coordinates |
zorigin | origin coordinates |
cosrot | sine and cosine of rotation |
invert | whether to invert |
Definition at line 178 of file GeomUtil.f90.