Skip to content

Commit

Permalink
refactor(swf-dfw): remove slope as input variable (#1686)
Browse files Browse the repository at this point in the history
  • Loading branch information
langevin-usgs authored Mar 26, 2024
1 parent 79c5ff0 commit a2bdd9e
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 62 deletions.
1 change: 0 additions & 1 deletion autotest/test_swf_dfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def build_models(idx, test):
print_flows=True,
save_flows=True,
manningsn=0.035,
slope=0.001,
idcxs=0,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_dfw_beg2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def build_models(idx, test):
print_flows=True,
save_flows=True,
manningsn=1.0 / 80.0,
slope=slope,
idcxs=0,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_dfw_bowl.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def build_models(idx, test):
print_flows=True,
save_flows=True,
manningsn=0.035,
slope=1 / dx,
idcxs=0,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_dfw_gwf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def add_swf_model(sim):
length_conversion=1.0,
time_conversion=86400.0,
manningsn=0.035,
slope=0.001,
idcxs=0,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_dfw_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ def build_models(idx, test):
print_flows=True,
save_flows=True,
manningsn=0.03,
slope=0.001,
idcxs=idcxs,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_dfw_swrt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def build_models(idx, test):
print_flows=True,
save_flows=True,
manningsn=0.30,
slope=0.05 / 500.0,
idcxs=None,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_dfw_swrt2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def build_models(idx, test):
print_flows=True,
save_flows=True,
manningsn=0.30,
slope=0.05 / 500.0,
idcxs=None,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_dfw_swrt2dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def build_models(idx, test):
print_flows=True,
save_flows=True,
manningsn=0.30,
slope=0.05 / 500.0,
idcxs=None,
)

Expand Down
1 change: 0 additions & 1 deletion autotest/test_swf_vcatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def build_models(idx, test):
print_flows=False,
save_flows=True,
manningsn=rough,
slope=-3e30, # todo: this is reason to get rid of slope as input
idcxs=None,
)

Expand Down
11 changes: 0 additions & 11 deletions doc/mf6io/mf6ivar/dfn/swf-dfw.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@ optional
longname mannings roughness coefficient
description mannings roughness coefficient

block griddata
name slope
type double precision
shape (nodes)
valid
reader readarray
layered false
optional
longname bottom slope
description bottom slope of the river bed

block griddata
name idcxs
type integer
Expand Down
1 change: 0 additions & 1 deletion doc/mf6io/mf6ivar/md/mf6ivar.md
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,6 @@
| SWF | DFW | OPTIONS | FILEIN | KEYWORD | keyword to specify that an input filename is expected next. |
| SWF | DFW | OPTIONS | OBS6_FILENAME | STRING | name of input file to define observations for the DFW package. See the ``Observation utility'' section for instructions for preparing observation input files. Tables \ref{table:gwf-obstypetable} and \ref{table:gwt-obstypetable} lists observation type(s) supported by the DFW package. |
| SWF | DFW | GRIDDATA | MANNINGSN | DOUBLE PRECISION (NODES) | mannings roughness coefficient |
| SWF | DFW | GRIDDATA | SLOPE | DOUBLE PRECISION (NODES) | bottom slope of the river bed |
| SWF | DFW | GRIDDATA | IDCXS | INTEGER (NODES) | integer value indication the cross section identifier in the Cross Section Package that applies to the reach. If not provided then reach will be treated as hydraulically wide. |
| SWF | CXS | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of stream reach information will be written to the listing file immediately after it is read. |
| SWF | CXS | DIMENSIONS | NSECTIONS | INTEGER | integer value specifying the number of cross sections that will be defined. There must be NSECTIONS entries in the PACKAGEDATA block. |
Expand Down
2 changes: 0 additions & 2 deletions doc/mf6io/mf6ivar/tex/swf-dfw-desc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
\begin{description}
\item \texttt{manningsn}---mannings roughness coefficient

\item \texttt{slope}---bottom slope of the river bed

\item \texttt{idcxs}---integer value indication the cross section identifier in the Cross Section Package that applies to the reach. If not provided then reach will be treated as hydraulically wide.

\end{description}
Expand Down
2 changes: 0 additions & 2 deletions doc/mf6io/mf6ivar/tex/swf-dfw-griddata.dat
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
BEGIN GRIDDATA
MANNINGSN
<manningsn(nodes)> -- READARRAY
SLOPE
<slope(nodes)> -- READARRAY
[IDCXS
<idcxs(nodes)> -- READARRAY]
END GRIDDATA
19 changes: 0 additions & 19 deletions src/Idm/swf-dfwidm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module SwfDfwInputModule
logical :: filein = .false.
logical :: obs6_filename = .false.
logical :: manningsn = .false.
logical :: slope = .false.
logical :: idcxs = .false.
end type SwfDfwParamFoundType

Expand Down Expand Up @@ -197,23 +196,6 @@ module SwfDfwInputModule
.false. & ! timeseries
)

type(InputParamDefinitionType), parameter :: &
swfdfw_slope = InputParamDefinitionType &
( &
'SWF', & ! component
'DFW', & ! subcomponent
'GRIDDATA', & ! block
'SLOPE', & ! tag name
'SLOPE', & ! fortran variable
'DOUBLE1D', & ! type
'NODES', & ! shape
.true., & ! required
.false., & ! multi-record
.false., & ! preserve case
.false., & ! layered
.false. & ! timeseries
)

type(InputParamDefinitionType), parameter :: &
swfdfw_idcxs = InputParamDefinitionType &
( &
Expand Down Expand Up @@ -244,7 +226,6 @@ module SwfDfwInputModule
swfdfw_filein, &
swfdfw_obs6_filename, &
swfdfw_manningsn, &
swfdfw_slope, &
swfdfw_idcxs &
]

Expand Down
19 changes: 1 addition & 18 deletions src/Model/SurfaceWaterFlow/swf-dfw.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
! todo:
! Move Newton to FN routines
! Implement a proper perturbation epsilon
! Is slope input parameter needed?
! Parameterize the smoothing depth?
!
module SwfDfwModule
Expand Down Expand Up @@ -41,9 +40,8 @@ module SwfDfwModule
integer(I4B), pointer :: icentral => null() !< flag to use central in space weighting (default is upstream weighting)
real(DP), pointer :: unitconv !< conversion factor used in mannings equation; calculated from timeconv and lengthconv
real(DP), pointer :: timeconv !< conversion factor from model length units to meters (1.0 if model uses meters for length)
real(DP), pointer :: lengthconv !< conversion factor frommodel time units to seconds (1.0 if model uses seconds for time)
real(DP), pointer :: lengthconv !< conversion factor from model time units to seconds (1.0 if model uses seconds for time)
real(DP), dimension(:), pointer, contiguous :: manningsn => null() !< mannings roughness for each reach
real(DP), dimension(:), pointer, contiguous :: slope => null() !< slope for each reach
integer(I4B), dimension(:), pointer, contiguous :: idcxs => null() !< cross section id for each reach
integer(I4B), dimension(:), pointer, contiguous :: ibound => null() !< pointer to model ibound
integer(I4B), dimension(:), pointer, contiguous :: icelltype => null() !< set to 1 and is accessed by chd for checking
Expand Down Expand Up @@ -213,16 +211,13 @@ subroutine allocate_arrays(this)
! -- user-provided input
call mem_allocate(this%manningsn, this%dis%nodes, &
'MANNINGSN', this%memoryPath)
call mem_allocate(this%slope, this%dis%nodes, &
'SLOPE', this%memoryPath)
call mem_allocate(this%idcxs, this%dis%nodes, &
'IDCXS', this%memoryPath)
call mem_allocate(this%icelltype, this%dis%nodes, &
'ICELLTYPE', this%memoryPath)

do n = 1, this%dis%nodes
this%manningsn(n) = DZERO
this%slope(n) = DZERO
this%idcxs(n) = 0
this%icelltype(n) = 1
end do
Expand Down Expand Up @@ -386,20 +381,13 @@ subroutine source_griddata(this)
! -- update defaults with idm sourced values
call mem_set_value(this%manningsn, 'MANNINGSN', &
idmMemoryPath, map, found%manningsn)
call mem_set_value(this%slope, 'SLOPE', idmMemoryPath, map, found%slope)
call mem_set_value(this%idcxs, 'IDCXS', idmMemoryPath, map, found%idcxs)
!
! -- ensure MANNINGSN was found
if (.not. found%manningsn) then
write (errmsg, '(a)') 'Error in GRIDDATA block: MANNINGSN not found.'
call store_error(errmsg)
end if
!
! -- ensure SLOPE was found
if (.not. found%slope) then
write (errmsg, '(a)') 'Error in GRIDDATA block: SLOPE not found.'
call store_error(errmsg)
end if

if (count_errors() > 0) then
call store_error_filename(this%input_fname)
Expand Down Expand Up @@ -427,10 +415,6 @@ subroutine log_griddata(this, found)
write (this%iout, '(4x,a)') 'MANNINGSN set from input file'
end if

if (found%slope) then
write (this%iout, '(4x,a)') 'SLOPE set from input file'
end if

if (found%idcxs) then
write (this%iout, '(4x,a)') 'IDCXS set from input file'
end if
Expand Down Expand Up @@ -1028,7 +1012,6 @@ subroutine dfw_da(this)
!
! -- Deallocate arrays
call mem_deallocate(this%manningsn)
call mem_deallocate(this%slope)
call mem_deallocate(this%idcxs)
call mem_deallocate(this%icelltype)

Expand Down

0 comments on commit a2bdd9e

Please sign in to comment.