From a2bdd9ee8bd192f87b612e4d69c9af8267fdfa59 Mon Sep 17 00:00:00 2001 From: langevin-usgs Date: Tue, 26 Mar 2024 17:29:37 -0500 Subject: [PATCH] refactor(swf-dfw): remove slope as input variable (#1686) --- autotest/test_swf_dfw.py | 1 - autotest/test_swf_dfw_beg2022.py | 1 - autotest/test_swf_dfw_bowl.py | 1 - autotest/test_swf_dfw_gwf.py | 1 - autotest/test_swf_dfw_loop.py | 1 - autotest/test_swf_dfw_swrt2.py | 1 - autotest/test_swf_dfw_swrt2b.py | 1 - autotest/test_swf_dfw_swrt2dis.py | 1 - autotest/test_swf_vcatch.py | 1 - doc/mf6io/mf6ivar/dfn/swf-dfw.dfn | 11 ----------- doc/mf6io/mf6ivar/md/mf6ivar.md | 1 - doc/mf6io/mf6ivar/tex/swf-dfw-desc.tex | 2 -- doc/mf6io/mf6ivar/tex/swf-dfw-griddata.dat | 2 -- src/Idm/swf-dfwidm.f90 | 19 ------------------- src/Model/SurfaceWaterFlow/swf-dfw.f90 | 19 +------------------ 15 files changed, 1 insertion(+), 62 deletions(-) diff --git a/autotest/test_swf_dfw.py b/autotest/test_swf_dfw.py index a455f24beef..d4ea3bfdf60 100644 --- a/autotest/test_swf_dfw.py +++ b/autotest/test_swf_dfw.py @@ -82,7 +82,6 @@ def build_models(idx, test): print_flows=True, save_flows=True, manningsn=0.035, - slope=0.001, idcxs=0, ) diff --git a/autotest/test_swf_dfw_beg2022.py b/autotest/test_swf_dfw_beg2022.py index 6cf5221d7a5..568a127a984 100644 --- a/autotest/test_swf_dfw_beg2022.py +++ b/autotest/test_swf_dfw_beg2022.py @@ -100,7 +100,6 @@ def build_models(idx, test): print_flows=True, save_flows=True, manningsn=1.0 / 80.0, - slope=slope, idcxs=0, ) diff --git a/autotest/test_swf_dfw_bowl.py b/autotest/test_swf_dfw_bowl.py index 5ea344204a2..1317a985c81 100644 --- a/autotest/test_swf_dfw_bowl.py +++ b/autotest/test_swf_dfw_bowl.py @@ -117,7 +117,6 @@ def build_models(idx, test): print_flows=True, save_flows=True, manningsn=0.035, - slope=1 / dx, idcxs=0, ) diff --git a/autotest/test_swf_dfw_gwf.py b/autotest/test_swf_dfw_gwf.py index 9c36d6cb3b3..bae9f77fa2d 100644 --- a/autotest/test_swf_dfw_gwf.py +++ b/autotest/test_swf_dfw_gwf.py @@ -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, ) diff --git a/autotest/test_swf_dfw_loop.py b/autotest/test_swf_dfw_loop.py index 7a2dc0520cd..3af13d4700d 100644 --- a/autotest/test_swf_dfw_loop.py +++ b/autotest/test_swf_dfw_loop.py @@ -249,7 +249,6 @@ def build_models(idx, test): print_flows=True, save_flows=True, manningsn=0.03, - slope=0.001, idcxs=idcxs, ) diff --git a/autotest/test_swf_dfw_swrt2.py b/autotest/test_swf_dfw_swrt2.py index b270fcf99e5..414570a6e06 100644 --- a/autotest/test_swf_dfw_swrt2.py +++ b/autotest/test_swf_dfw_swrt2.py @@ -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, ) diff --git a/autotest/test_swf_dfw_swrt2b.py b/autotest/test_swf_dfw_swrt2b.py index 7ed893c8d91..76d1f2c76e2 100644 --- a/autotest/test_swf_dfw_swrt2b.py +++ b/autotest/test_swf_dfw_swrt2b.py @@ -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, ) diff --git a/autotest/test_swf_dfw_swrt2dis.py b/autotest/test_swf_dfw_swrt2dis.py index 71ca29cec0e..d0aefc378d8 100644 --- a/autotest/test_swf_dfw_swrt2dis.py +++ b/autotest/test_swf_dfw_swrt2dis.py @@ -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, ) diff --git a/autotest/test_swf_vcatch.py b/autotest/test_swf_vcatch.py index c4bf3413b18..0627f5ba9d6 100644 --- a/autotest/test_swf_vcatch.py +++ b/autotest/test_swf_vcatch.py @@ -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, ) diff --git a/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn b/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn index 9a00dd3e6ce..06eacba6744 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn @@ -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 diff --git a/doc/mf6io/mf6ivar/md/mf6ivar.md b/doc/mf6io/mf6ivar/md/mf6ivar.md index 187d584f141..39e5a6ee5b8 100644 --- a/doc/mf6io/mf6ivar/md/mf6ivar.md +++ b/doc/mf6io/mf6ivar/md/mf6ivar.md @@ -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. | diff --git a/doc/mf6io/mf6ivar/tex/swf-dfw-desc.tex b/doc/mf6io/mf6ivar/tex/swf-dfw-desc.tex index 51abe6802f7..e2fe42e2e1b 100644 --- a/doc/mf6io/mf6ivar/tex/swf-dfw-desc.tex +++ b/doc/mf6io/mf6ivar/tex/swf-dfw-desc.tex @@ -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} diff --git a/doc/mf6io/mf6ivar/tex/swf-dfw-griddata.dat b/doc/mf6io/mf6ivar/tex/swf-dfw-griddata.dat index 959b5b72cf2..0c0b189d738 100644 --- a/doc/mf6io/mf6ivar/tex/swf-dfw-griddata.dat +++ b/doc/mf6io/mf6ivar/tex/swf-dfw-griddata.dat @@ -1,8 +1,6 @@ BEGIN GRIDDATA MANNINGSN -- READARRAY - SLOPE - -- READARRAY [IDCXS -- READARRAY] END GRIDDATA diff --git a/src/Idm/swf-dfwidm.f90 b/src/Idm/swf-dfwidm.f90 index 15729b20e03..8bb197fb7cb 100644 --- a/src/Idm/swf-dfwidm.f90 +++ b/src/Idm/swf-dfwidm.f90 @@ -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 @@ -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 & ( & @@ -244,7 +226,6 @@ module SwfDfwInputModule swfdfw_filein, & swfdfw_obs6_filename, & swfdfw_manningsn, & - swfdfw_slope, & swfdfw_idcxs & ] diff --git a/src/Model/SurfaceWaterFlow/swf-dfw.f90 b/src/Model/SurfaceWaterFlow/swf-dfw.f90 index ed34d36747e..344d0d5f41d 100644 --- a/src/Model/SurfaceWaterFlow/swf-dfw.f90 +++ b/src/Model/SurfaceWaterFlow/swf-dfw.f90 @@ -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 @@ -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 @@ -213,8 +211,6 @@ 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, & @@ -222,7 +218,6 @@ subroutine allocate_arrays(this) do n = 1, this%dis%nodes this%manningsn(n) = DZERO - this%slope(n) = DZERO this%idcxs(n) = 0 this%icelltype(n) = 1 end do @@ -386,7 +381,6 @@ 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 @@ -394,12 +388,6 @@ subroutine source_griddata(this) 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) @@ -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 @@ -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)