MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
gwfsfrcrosssectionutilsmodule Module Reference

This module contains stateless sfr subroutines and functions. More...

Functions/Subroutines

real(dp) function, public get_saturated_topwidth (npts, stations)
 Calculate the saturated top width for a reach.
real(dp) function, public get_wetted_topwidth (npts, stations, heights, d)
 Calculate the wetted top width for a reach.
real(dp) function get_wet_vert_face (n, npts, heights, d, leftface)
 Calculate wetted vertical height.
real(dp) function, public get_wetted_perimeter (npts, stations, heights, d)
 Calculate the wetted perimeter for a reach.
real(dp) function, public get_cross_section_area (npts, stations, heights, d)
 Calculate the cross-sectional area for a reach.
real(dp) function, public get_hydraulic_radius (npts, stations, heights, d)
 Calculate the hydraulic radius for a reach.
real(dp) function, public get_mannings_section (npts, stations, heights, roughfracs, roughness, conv_fact, slope, d)
 Calculate the manning's discharge for a reach.
subroutine determine_vert_neighbors (npts, stations, heights, leftv, rightv)
 Determine vertical segments.
subroutine get_wetted_perimeters (npts, stations, heights, d, p)
 Calculate the wetted perimeters for each line segment.
subroutine get_cross_section_areas (npts, stations, heights, d, a)
 Calculate the cross-sectional areas for each line segment.
subroutine get_wetted_topwidths (npts, stations, heights, d, w)
 Calculate the wetted top widths for each line segment.
pure subroutine get_wetted_station (x0, x1, d0, d1, dmax, dmin, d)
 Calculate the station values for the wetted portion of the cross-section.

Detailed Description

This module contains the functions to calculate the wetted perimeter and cross-sectional area for a reach cross-section that are used in the streamflow routing (SFR) package. It also contains subroutines to calculate the wetted perimeter and cross-sectional area for each line segment in the cross-section. This module does not depend on the SFR package.

Function/Subroutine Documentation

◆ determine_vert_neighbors()

subroutine gwfsfrcrosssectionutilsmodule::determine_vert_neighbors ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
logical, dimension(npts - 1), intent(inout) leftv,
logical, dimension(npts - 1), intent(inout) rightv )
private

Subroutine to cycle through each segment (npts - 1) and determine whether neighboring segments are vertically-oriented.

Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data

Definition at line 295 of file SfrCrossSectionUtils.f90.

296 ! -- dummy
297 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
298 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
299 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
300 logical, dimension(npts - 1), intent(inout) :: leftv
301 logical, dimension(npts - 1), intent(inout) :: rightv
302 ! -- local
303 integer(I4B) :: n
304 !
305 ! -- default neighboring segments to false unless determined otherwise
306 ! o 2 pt x-section has 1 segment (no neighbors to eval)
307 ! o 3+ pt x-section has at the very least one neighbor to eval
308 do n = 1, npts - 1
309 leftv(n) = .false.
310 rightv(n) = .false.
311 ! -- left neighbor
312 if (n > 1) then
313 if (stations(n - 1) == stations(n) .and. heights(n - 1) > heights(n)) then
314 leftv(n) = .true.
315 end if
316 end if
317 ! -- right neighbor
318 if (n < npts - 1) then
319 if (stations(n + 2) == stations(n + 1) .and. &
320 heights(n + 2) > heights(n + 1)) then
321 rightv(n) = .true.
322 end if
323 end if
324 end do
Here is the caller graph for this function:

◆ get_cross_section_area()

real(dp) function, public gwfsfrcrosssectionutilsmodule::get_cross_section_area ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d )

Function to calculate the cross-sectional area for a reach using the cross-section station-height data given a passed depth.

Returns
a cross-sectional area
Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]ddepth to evaluate cross-section

Definition at line 148 of file SfrCrossSectionUtils.f90.

149 ! -- dummy variables
150 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
151 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
152 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
153 real(DP), intent(in) :: d !< depth to evaluate cross-section
154 ! -- local variables
155 integer(I4B) :: n
156 real(DP) :: a
157 real(DP), dimension(npts - 1) :: areas
158 !
159 ! -- initialize the area
160 a = dzero
161 !
162 ! -- calculate the cross-sectional area for each line segment
163 call get_cross_section_areas(npts, stations, heights, d, areas)
164 !
165 ! -- calculate the cross-sectional area
166 do n = 1, npts - 1
167 a = a + areas(n)
168 end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_cross_section_areas()

subroutine gwfsfrcrosssectionutilsmodule::get_cross_section_areas ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d,
real(dp), dimension(npts - 1), intent(inout) a )
private

Subroutine to calculate the cross-sectional area for each line segment that defines the reach using the cross-section station-height data given a passed depth.

Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]ddepth to evaluate cross-section
[in,out]across-sectional area for each line segment

Definition at line 415 of file SfrCrossSectionUtils.f90.

416 ! -- dummy variables
417 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
418 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
419 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
420 real(DP), intent(in) :: d !< depth to evaluate cross-section
421 real(DP), dimension(npts - 1), intent(inout) :: a !< cross-sectional area for each line segment
422 ! -- local variables
423 integer(I4B) :: n
424 real(DP) :: x0
425 real(DP) :: x1
426 real(DP) :: d0
427 real(DP) :: d1
428 real(DP) :: dmax
429 real(DP) :: dmin
430 real(DP) :: xlen
431 !
432 ! -- iterate over the station-height data
433 do n = 1, npts - 1
434 !
435 ! -- initialize the cross-sectional area
436 a(n) = dzero
437 !
438 ! -- initialize station-height data for segment
439 x0 = stations(n)
440 x1 = stations(n + 1)
441 d0 = heights(n)
442 d1 = heights(n + 1)
443 !
444 ! -- get the start and end station position of the wetted segment
445 call get_wetted_station(x0, x1, d0, d1, dmax, dmin, d)
446 !
447 ! -- calculate the cross-sectional area for the segment
448 xlen = x1 - x0
449 if (xlen > dzero) then
450 !
451 ! -- add the area above dmax
452 if (d > dmax) then
453 a(n) = xlen * (d - dmax)
454 end if
455 !
456 ! -- add the area below dmax
457 if (dmax /= dmin .and. d > dmin) then
458 if (d < dmax) then
459 a(n) = a(n) + dhalf * (d - dmin) * xlen
460 else
461 a(n) = a(n) + dhalf * (dmax - dmin) * xlen
462 end if
463 end if
464 end if
465 end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_hydraulic_radius()

real(dp) function, public gwfsfrcrosssectionutilsmodule::get_hydraulic_radius ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d )

Function to calculate the hydraulic radius for a reach using the cross-section station-height data given a passed depth.

Returns
r hydraulic radius
Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]ddepth to evaluate cross-section

Definition at line 178 of file SfrCrossSectionUtils.f90.

179 ! -- dummy variables
180 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
181 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
182 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
183 real(DP), intent(in) :: d !< depth to evaluate cross-section
184 ! -- local variables
185 integer(I4B) :: n
186 real(DP) :: r
187 real(DP) :: p
188 real(DP) :: a
189 real(DP), dimension(npts - 1) :: areas
190 real(DP), dimension(npts - 1) :: perimeters
191 !
192 ! -- initialize the hydraulic radius, perimeter, and area
193 r = dzero
194 p = dzero
195 a = dzero
196 !
197 ! -- calculate the wetted perimeter for each line segment
198 call get_wetted_perimeters(npts, stations, heights, d, perimeters)
199 !
200 ! -- calculate the wetted perimenter
201 do n = 1, npts - 1
202 p = p + perimeters(n)
203 end do
204 !
205 ! -- calculate the hydraulic radius only if the perimeter is non-zero
206 if (p > dzero) then
207 !
208 ! -- calculate the cross-sectional area for each line segment
209 call get_cross_section_areas(npts, stations, heights, d, areas)
210 !
211 ! -- calculate the cross-sectional area
212 do n = 1, npts - 1
213 a = a + areas(n)
214 end do
215 !
216 ! -- calculate the hydraulic radius
217 r = a / p
218 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mannings_section()

real(dp) function, public gwfsfrcrosssectionutilsmodule::get_mannings_section ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), dimension(npts), intent(in) roughfracs,
real(dp), intent(in) roughness,
real(dp), intent(in) conv_fact,
real(dp), intent(in) slope,
real(dp), intent(in) d )

Function to calculate the mannings discharge for a reach by calculating the discharge for each section, which can have a unique Manning's coefficient given a passed depth.

Returns
q reach discharge
Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]roughfracscross-section Mannings roughness fraction data
[in]roughnessbase reach roughness
[in]conv_factunit conversion factor
[in]slopereach slope
[in]ddepth to evaluate cross-section

Definition at line 229 of file SfrCrossSectionUtils.f90.

231 ! -- dummy variables
232 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
233 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
234 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
235 real(DP), dimension(npts), intent(in) :: roughfracs !< cross-section Mannings roughness fraction data
236 real(DP), intent(in) :: roughness !< base reach roughness
237 real(DP), intent(in) :: conv_fact !< unit conversion factor
238 real(DP), intent(in) :: slope !< reach slope
239 real(DP), intent(in) :: d !< depth to evaluate cross-section
240 ! -- local variables
241 integer(I4B) :: n
242 real(DP) :: conveyance
243 real(DP) :: q
244 real(DP) :: rh
245 real(DP) :: r
246 real(DP) :: p
247 real(DP) :: a
248 real(DP), dimension(npts - 1) :: areas
249 real(DP), dimension(npts - 1) :: perimeters
250 !
251 ! -- initialize the conveyance, hydraulic radius, perimeter, and area
252 conveyance = dzero
253 q = dzero
254 rh = dzero
255 r = dzero
256 p = dzero
257 a = dzero
258 !
259 ! -- calculate the wetted perimeter for each line segment
260 call get_wetted_perimeters(npts, stations, heights, d, perimeters)
261 !
262 ! -- calculate the wetted perimenter
263 do n = 1, npts - 1
264 p = p + perimeters(n)
265 end do
266 !
267 ! -- calculate the hydraulic radius only if the perimeter is non-zero
268 if (p > dzero) then
269 !
270 ! -- calculate the cross-sectional area for each line segment
271 call get_cross_section_areas(npts, stations, heights, d, areas)
272 !
273 ! -- calculate the cross-sectional area
274 do n = 1, npts - 1
275 p = perimeters(n)
276 r = roughness * roughfracs(n)
277 if (p * r > dzero) then
278 a = areas(n)
279 rh = a / p
280 conveyance = conveyance + a * rh**dtwothirds / r
281 end if
282 end do
283 q = conv_fact * conveyance * sqrt(slope)
284 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_saturated_topwidth()

real(dp) function, public gwfsfrcrosssectionutilsmodule::get_saturated_topwidth ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations )

Function to calculate the maximum top width for a reach using the cross-section station data.

Returns
w saturated top width
Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)

Definition at line 34 of file SfrCrossSectionUtils.f90.

35 ! -- dummy variables
36 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
37 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
38 ! -- local variables
39 real(DP) :: w
40 !
41 ! -- calculate the saturated top width
42 if (npts > 1) then
43 w = stations(npts) - stations(1)
44 else
45 w = stations(1)
46 end if
Here is the caller graph for this function:

◆ get_wet_vert_face()

real(dp) function gwfsfrcrosssectionutilsmodule::get_wet_vert_face ( integer(i4b), intent(in) n,
integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d,
logical, intent(in) leftface )
private

For segments flanked by vertically-oriented neighboring segments, return the length of the submerged, vertically-oriented, neighboring face

Parameters
[in]nindex to be evaluated
[in]nptslength of heights vector
[in]heightscross-section height data
Returns
vertically wetted face length

Definition at line 85 of file SfrCrossSectionUtils.f90.

86 ! -- dummy
87 integer(I4B), intent(in) :: n !< index to be evaluated
88 integer(I4B), intent(in) :: npts !< length of heights vector
89 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
90 real(DP), intent(in) :: d
91 logical, intent(in) :: leftface
92 ! -- local
93 real(DP) :: vwf !< vertically wetted face length
94 !
95 ! -- calculate the vertically-oriented wetted face length
96 if (leftface) then
97 if (heights(n - 1) > d) then
98 vwf = d - heights(n)
99 else if (heights(n - 1) > heights(n)) then
100 vwf = heights(n - 1) - heights(n)
101 end if
102 else
103 if (heights(n + 2) > d) then
104 vwf = d - heights(n + 1)
105 else if (heights(n + 2) > heights(n + 1)) then
106 vwf = heights(n + 2) - heights(n + 1)
107 end if
108 end if
Here is the caller graph for this function:

◆ get_wetted_perimeter()

real(dp) function, public gwfsfrcrosssectionutilsmodule::get_wetted_perimeter ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d )

Function to calculate the wetted perimeter for a reach using the cross-section station-height data given a passed depth.

Returns
p wetted perimeter
Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]ddepth to evaluate cross-section

Definition at line 118 of file SfrCrossSectionUtils.f90.

119 ! -- dummy variables
120 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
121 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
122 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
123 real(DP), intent(in) :: d !< depth to evaluate cross-section
124 ! -- local variables
125 integer(I4B) :: n
126 real(DP) :: p
127 real(DP), dimension(npts - 1) :: perimeters
128 !
129 ! -- initialize the wetted perimeter for the reach
130 p = dzero
131 !
132 ! -- calculate the wetted perimeter for each line segment
133 call get_wetted_perimeters(npts, stations, heights, d, perimeters)
134 !
135 ! -- calculate the wetted perimenter
136 do n = 1, npts - 1
137 p = p + perimeters(n)
138 end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_wetted_perimeters()

subroutine gwfsfrcrosssectionutilsmodule::get_wetted_perimeters ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d,
real(dp), dimension(npts - 1), intent(inout) p )
private

Subroutine to calculate the wetted perimeter for each line segment that defines the reach using the cross-section station-height data given a passed depth.

Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]ddepth to evaluate cross-section
[in,out]pwetted perimeter for each line segment

Definition at line 334 of file SfrCrossSectionUtils.f90.

335 ! -- dummy variables
336 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
337 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
338 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
339 real(DP), intent(in) :: d !< depth to evaluate cross-section
340 real(DP), dimension(npts - 1), intent(inout) :: p !< wetted perimeter for each line segment
341 ! -- local variables
342 integer(I4B) :: n
343 real(DP) :: x0
344 real(DP) :: x1
345 real(DP) :: d0
346 real(DP) :: d1
347 real(DP) :: dmax
348 real(DP) :: dmin
349 real(DP) :: xlen
350 real(DP) :: dlen
351 logical, dimension(npts - 1) :: leftv, rightv
352 !
353 ! -- set neighbor status
354 call determine_vert_neighbors(npts, stations, heights, leftv, rightv)
355 !
356 ! -- iterate over the station-height data
357 do n = 1, npts - 1
358 !
359 ! -- initialize the wetted perimeter
360 p(n) = dzero
361 !
362 ! -- initialize station-height data for segment
363 x0 = stations(n)
364 x1 = stations(n + 1)
365 d0 = heights(n)
366 d1 = heights(n + 1)
367 !
368 ! -- get the start and end station position of the wetted segment
369 call get_wetted_station(x0, x1, d0, d1, dmax, dmin, d)
370 !
371 ! -- calculate the wetted perimeter for the segment
372 ! - bottom wetted length
373 xlen = x1 - x0
374 dlen = dzero
375 if (xlen > dzero) then
376 if (d > dmax) then
377 dlen = dmax - dmin
378 else
379 dlen = d - dmin
380 end if
381 else
382 if (d > dmin) then
383 dlen = min(d, dmax) - dmin
384 else
385 dlen = dzero
386 end if
387 end if
388 p(n) = sqrt(xlen**dtwo + dlen**dtwo)
389 !
390 ! -- if neighboring segments are vertical, account for their
391 ! contribution to wetted perimeter
392 !
393 ! left neighbor (if applicable)
394 if (n > 1) then
395 if (leftv(n)) then
396 p(n) = p(n) + get_wet_vert_face(n, npts, heights, d, .true.)
397 end if
398 end if
399 ! right neighbor (if applicable)
400 if (n < npts - 1) then
401 if (rightv(n)) then
402 p(n) = p(n) + get_wet_vert_face(n, npts, heights, d, .false.)
403 end if
404 end if
405 end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_wetted_station()

pure subroutine gwfsfrcrosssectionutilsmodule::get_wetted_station ( real(dp), intent(inout) x0,
real(dp), intent(inout) x1,
real(dp), intent(in) d0,
real(dp), intent(in) d1,
real(dp), intent(inout) dmax,
real(dp), intent(inout) dmin,
real(dp), intent(in) d )
private

Subroutine to calculate the station values that define the extent of the wetted portion of the cross section for a line segment. The left (x0) and right (x1) station positions are altered if the passed depth is less than the maximum line segment depth. If the line segment is dry the left and right station are equal. Otherwise the wetted station values are equal to the full line segment or smaller if the passed depth is less than the maximum line segment depth.

Parameters
[in,out]x0left station position
[in,out]x1right station position
[in]d0depth at the left station
[in]d1depth at the right station
[in,out]dmaxmaximum depth
[in,out]dminminimum depth
[in]ddepth to evaluate cross-section

Definition at line 519 of file SfrCrossSectionUtils.f90.

520 ! -- dummy variables
521 real(DP), intent(inout) :: x0 !< left station position
522 real(DP), intent(inout) :: x1 !< right station position
523 real(DP), intent(in) :: d0 !< depth at the left station
524 real(DP), intent(in) :: d1 !< depth at the right station
525 real(DP), intent(inout) :: dmax !< maximum depth
526 real(DP), intent(inout) :: dmin !< minimum depth
527 real(DP), intent(in) :: d !< depth to evaluate cross-section
528 ! -- local variables
529 real(DP) :: xlen
530 real(DP) :: dlen
531 real(DP) :: slope
532 real(DP) :: xt
533 !
534 ! -- calculate the minimum and maximum depth
535 dmin = min(d0, d1)
536 dmax = max(d0, d1)
537 !
538 ! -- calculate x0 and x1
539 if (d <= dmin) then
540 ! -- if d is less than or equal to the minimum value the
541 ! station length (xlen) is zero
542 x1 = x0
543 else if (d >= dmax) then
544 ! x0 and x1 unchanged (full wetted width)
545 continue
546 else
547 ! -- if d is between dmin and dmax, station length is less
548 ! than d1 - d0
549 xlen = x1 - x0
550 dlen = d1 - d0
551 ! because of preceding checks
552 ! we know dmin<d<dmax, dmax>dmin, dlen > 0
553 ! no need to check for dlen == 0
554 slope = xlen / dlen
555 xt = x0 + slope * (d - d0)
556 if (d0 > d1) then
557 ! x1 unchanged
558 x0 = xt
559 else
560 !x0 unchanged
561 x1 = xt
562 end if
563 end if
Here is the caller graph for this function:

◆ get_wetted_topwidth()

real(dp) function, public gwfsfrcrosssectionutilsmodule::get_wetted_topwidth ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d )

Function to calculate the wetted top width for a reach using the cross-section station-height data given a passed depth.

Returns
w wetted top width
Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]ddepth to evaluate cross-section

Definition at line 56 of file SfrCrossSectionUtils.f90.

57 ! -- dummy variables
58 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
59 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
60 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
61 real(DP), intent(in) :: d !< depth to evaluate cross-section
62 ! -- local variables
63 integer(I4B) :: n
64 real(DP) :: w
65 real(DP), dimension(npts - 1) :: widths
66 !
67 ! -- initialize the wetted perimeter for the reach
68 w = dzero
69 !
70 ! -- calculate the wetted top width for each line segment
71 call get_wetted_topwidths(npts, stations, heights, d, widths)
72 !
73 ! -- calculate the wetted top widths
74 do n = 1, npts - 1
75 w = w + widths(n)
76 end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_wetted_topwidths()

subroutine gwfsfrcrosssectionutilsmodule::get_wetted_topwidths ( integer(i4b), intent(in) npts,
real(dp), dimension(npts), intent(in) stations,
real(dp), dimension(npts), intent(in) heights,
real(dp), intent(in) d,
real(dp), dimension(npts - 1), intent(inout) w )
private

Subroutine to calculate the wetted top width for each line segment that defines the reach using the cross-section station-height data given a passed depth.

Parameters
[in]nptsnumber of station-height data for a reach
[in]stationscross-section station distances (x-distance)
[in]heightscross-section height data
[in]ddepth to evaluate cross-section
[in,out]wwetted top widths for each line segment

Definition at line 475 of file SfrCrossSectionUtils.f90.

476 ! -- dummy variables
477 integer(I4B), intent(in) :: npts !< number of station-height data for a reach
478 real(DP), dimension(npts), intent(in) :: stations !< cross-section station distances (x-distance)
479 real(DP), dimension(npts), intent(in) :: heights !< cross-section height data
480 real(DP), intent(in) :: d !< depth to evaluate cross-section
481 real(DP), dimension(npts - 1), intent(inout) :: w !< wetted top widths for each line segment
482 ! -- local variables
483 integer(I4B) :: n
484 real(DP) :: x0
485 real(DP) :: x1
486 real(DP) :: d0
487 real(DP) :: d1
488 real(DP) :: dmax
489 real(DP) :: dmin
490 !
491 ! -- iterate over the station-height data
492 do n = 1, npts - 1
493 !
494 ! -- initialize station-height data for segment
495 x0 = stations(n)
496 x1 = stations(n + 1)
497 d0 = heights(n)
498 d1 = heights(n + 1)
499 !
500 ! -- get the start and end station position of the wetted segment
501 call get_wetted_station(x0, x1, d0, d1, dmax, dmin, d)
502 !
503 ! -- calculate the wetted top width for the segment
504 w(n) = x1 - x0
505 end do
Here is the call graph for this function:
Here is the caller graph for this function: