Skip to content

Commit

Permalink
refactor(discretization): move dis modules to src/Model/Discretization (
Browse files Browse the repository at this point in the history
MODFLOW-USGS#1637)

* move discretization modules to src/Model/Discretization/
* rename gwf-dis.f90 -> Dis.f90, likewise for disv and disu
* define "found type" in discretization modules, remove generated IDM file dependency
* move toward clean separation between generic framework and model-scoped code
* future work may introduce model-specific dis types extending these
* for now this allows moving forward with feature toggling
* rerun mem_allocate.py and mf6ivar.py
  • Loading branch information
wpbonelli authored Feb 27, 2024
1 parent 8d07992 commit 9af21a0
Show file tree
Hide file tree
Showing 23 changed files with 415 additions and 350 deletions.
2 changes: 1 addition & 1 deletion doc/mf6io/mf6ivar/md/mf6ivar.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
| GWF | WEL | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of well information will be written to the listing file immediately after it is read. |
| GWF | WEL | OPTIONS | PRINT_FLOWS | KEYWORD | keyword to indicate that the list of well flow rates will be printed to the listing file for every stress period time step in which ``BUDGET PRINT'' is specified in Output Control. If there is no Output Control option and ``PRINT\_FLOWS'' is specified, then flow rates are printed for the last time step of each stress period. |
| GWF | WEL | OPTIONS | SAVE_FLOWS | KEYWORD | keyword to indicate that well flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control. |
| GWF | WEL | OPTIONS | AUTO_FLOW_REDUCE | DOUBLE PRECISION | keyword and real value that defines the fraction of the cell thickness used as an interval for smoothly adjusting negative pumping rates to 0 in cells with head values less than or equal to the bottom of the cell. Negative pumping rates are adjusted to 0 or a smaller negative value when the head in the cell is equal to or less than the calculated interval above the cell bottom. AUTO\_FLOW\_REDUCE is set to 0.1 if the specified value is less than or equal to zero. By default, negative pumping rates are not reduced during a simulation. |
| GWF | WEL | OPTIONS | AUTO_FLOW_REDUCE | DOUBLE PRECISION | keyword and real value that defines the fraction of the cell thickness used as an interval for smoothly adjusting negative pumping rates to 0 in cells with head values less than or equal to the bottom of the cell. Negative pumping rates are adjusted to 0 or a smaller negative value when the head in the cell is equal to or less than the calculated interval above the cell bottom. AUTO\_FLOW\_REDUCE is set to 0.1 if the specified value is less than or equal to zero. By default, negative pumping rates are not reduced during a simulation. This AUTO\_FLOW\_REDUCE option only applies to wells in model cells that are marked as ``convertible'' (ICELLTYPE /= 0) in the Node Property Flow (NPF) input file. Reduction in flow will not occur for wells in cells marked as confined (ICELLTYPE = 0). |
| GWF | WEL | OPTIONS | AUTO_FLOW_REDUCE_CSV | KEYWORD | keyword to specify that record corresponds to the AUTO\_FLOW\_REDUCE output option in which a new record is written for each well and for each time step in which the user-requested extraction rate is reduced by the program. |
| GWF | WEL | OPTIONS | FILEOUT | KEYWORD | keyword to specify that an output filename is expected next. |
| GWF | WEL | OPTIONS | AFRCSVFILE | STRING | name of the comma-separated value (CSV) output file to write information about well extraction rates that have been reduced by the program. Entries are only written if the extraction rates are reduced. |
Expand Down
88 changes: 44 additions & 44 deletions doc/mf6io/mf6ivar/md/mf6memvar.md
Original file line number Diff line number Diff line change
Expand Up @@ -756,39 +756,7 @@
| PackageMover.f90 | PackageMoverModule | PackageMoverType | QTOMVR | 1 |
| PackageMover.f90 | PackageMoverModule | PackageMoverType | QFROMMVR | 1 |
| PackageMover.f90 | PackageMoverModule | PackageMoverType | QFROMMVR0 | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | TOP1D | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | BOT1D | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | AREA1D | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | IDOMAIN | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | VERTICES | 2 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | IAINP | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | JAINP | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | IHCINP | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | CL12INP | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | HWVAINP | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | ANGLDEGXINP | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | CELLXY | 2 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | IAVERT | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | JAVERT | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | NJAUSR | 0 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | NVERT | 0 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | VOFFSETTOL | 0 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | IANGLEDEGX | 0 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | NODEUSER | 1 |
| gwf-disu.f90 | GwfDisuModule | GwfDisuType | NODEREDUCED | 1 |
| gwf-ic.f90 | GwfIcModule | GwfIcType | STRT | 1 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | IDOMAIN | 2 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | TOP1D | 1 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | BOT2D | 2 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | VERTICES | 2 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | CELLXY | 2 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | IAVERT | 1 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | JAVERT | 1 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | NLAY | 0 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | NCPL | 0 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | NVERT | 0 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | NODEUSER | 1 |
| gwf-disv.f90 | GwfDisvModule | GwfDisvType | NODEREDUCED | 1 |
| gwf-npf.f90 | GwfNpfModule | GwfNpftype | INAME | 0 |
| gwf-npf.f90 | GwfNpfModule | GwfNpftype | IXT3D | 0 |
| gwf-npf.f90 | GwfNpfModule | GwfNpftype | IXT3DRHS | 0 |
Expand Down Expand Up @@ -1344,20 +1312,52 @@
| gwf-sfr.f90 | SfrModule | SfrType | QAUXCBC | 1 |
| gwf-sfr.f90 | SfrModule | SfrType | DENSETERMS | 2 |
| gwf-sfr.f90 | SfrModule | SfrType | VISCRATIOS | 2 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | DELR | 1 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | DELC | 1 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | IDOMAIN | 3 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | TOP2D | 2 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | BOT3D | 3 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | CELLX | 1 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | CELLY | 1 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | NLAY | 0 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | NROW | 0 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | NCOL | 0 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | NODEUSER | 1 |
| gwf-dis.f90 | GwfDisModule | GwfDisType | NODEREDUCED | 1 |
| gwf-drn.f90 | DrnModule | DrnType | IAUXDDRNCOL | 0 |
| gwf-drn.f90 | DrnModule | DrnType | ICUBIC_SCALING | 0 |
| Disv.f90 | DisvModule | DisvType | IDOMAIN | 2 |
| Disv.f90 | DisvModule | DisvType | TOP1D | 1 |
| Disv.f90 | DisvModule | DisvType | BOT2D | 2 |
| Disv.f90 | DisvModule | DisvType | VERTICES | 2 |
| Disv.f90 | DisvModule | DisvType | CELLXY | 2 |
| Disv.f90 | DisvModule | DisvType | IAVERT | 1 |
| Disv.f90 | DisvModule | DisvType | JAVERT | 1 |
| Disv.f90 | DisvModule | DisvType | NLAY | 0 |
| Disv.f90 | DisvModule | DisvType | NCPL | 0 |
| Disv.f90 | DisvModule | DisvType | NVERT | 0 |
| Disv.f90 | DisvModule | DisvType | NODEUSER | 1 |
| Disv.f90 | DisvModule | DisvType | NODEREDUCED | 1 |
| Disu.f90 | DisuModule | DisuType | TOP1D | 1 |
| Disu.f90 | DisuModule | DisuType | BOT1D | 1 |
| Disu.f90 | DisuModule | DisuType | AREA1D | 1 |
| Disu.f90 | DisuModule | DisuType | IDOMAIN | 1 |
| Disu.f90 | DisuModule | DisuType | VERTICES | 2 |
| Disu.f90 | DisuModule | DisuType | IAINP | 1 |
| Disu.f90 | DisuModule | DisuType | JAINP | 1 |
| Disu.f90 | DisuModule | DisuType | IHCINP | 1 |
| Disu.f90 | DisuModule | DisuType | CL12INP | 1 |
| Disu.f90 | DisuModule | DisuType | HWVAINP | 1 |
| Disu.f90 | DisuModule | DisuType | ANGLDEGXINP | 1 |
| Disu.f90 | DisuModule | DisuType | CELLXY | 2 |
| Disu.f90 | DisuModule | DisuType | IAVERT | 1 |
| Disu.f90 | DisuModule | DisuType | JAVERT | 1 |
| Disu.f90 | DisuModule | DisuType | NJAUSR | 0 |
| Disu.f90 | DisuModule | DisuType | NVERT | 0 |
| Disu.f90 | DisuModule | DisuType | VOFFSETTOL | 0 |
| Disu.f90 | DisuModule | DisuType | IANGLEDEGX | 0 |
| Disu.f90 | DisuModule | DisuType | NODEUSER | 1 |
| Disu.f90 | DisuModule | DisuType | NODEREDUCED | 1 |
| Dis.f90 | DisModule | DisType | DELR | 1 |
| Dis.f90 | DisModule | DisType | DELC | 1 |
| Dis.f90 | DisModule | DisType | IDOMAIN | 3 |
| Dis.f90 | DisModule | DisType | TOP2D | 2 |
| Dis.f90 | DisModule | DisType | BOT3D | 3 |
| Dis.f90 | DisModule | DisType | CELLX | 1 |
| Dis.f90 | DisModule | DisType | CELLY | 1 |
| Dis.f90 | DisModule | DisType | NLAY | 0 |
| Dis.f90 | DisModule | DisType | NROW | 0 |
| Dis.f90 | DisModule | DisType | NCOL | 0 |
| Dis.f90 | DisModule | DisType | NODEUSER | 1 |
| Dis.f90 | DisModule | DisType | NODEREDUCED | 1 |
| tsp-apt.f90 | TspAptModule | TspAptType | IAUXFPCONC | 0 |
| tsp-apt.f90 | TspAptModule | TspAptType | IMATROWS | 0 |
| tsp-apt.f90 | TspAptModule | TspAptType | IPRCONC | 0 |
Expand Down
2 changes: 1 addition & 1 deletion doc/mf6io/mf6ivar/tex/gwf-wel-desc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

\item \texttt{SAVE\_FLOWS}---keyword to indicate that well flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control.

\item \texttt{auto\_flow\_reduce}---keyword and real value that defines the fraction of the cell thickness used as an interval for smoothly adjusting negative pumping rates to 0 in cells with head values less than or equal to the bottom of the cell. Negative pumping rates are adjusted to 0 or a smaller negative value when the head in the cell is equal to or less than the calculated interval above the cell bottom. AUTO\_FLOW\_REDUCE is set to 0.1 if the specified value is less than or equal to zero. By default, negative pumping rates are not reduced during a simulation.
\item \texttt{auto\_flow\_reduce}---keyword and real value that defines the fraction of the cell thickness used as an interval for smoothly adjusting negative pumping rates to 0 in cells with head values less than or equal to the bottom of the cell. Negative pumping rates are adjusted to 0 or a smaller negative value when the head in the cell is equal to or less than the calculated interval above the cell bottom. AUTO\_FLOW\_REDUCE is set to 0.1 if the specified value is less than or equal to zero. By default, negative pumping rates are not reduced during a simulation. This AUTO\_FLOW\_REDUCE option only applies to wells in model cells that are marked as ``convertible'' (ICELLTYPE /= 0) in the Node Property Flow (NPF) input file. Reduction in flow will not occur for wells in cells marked as confined (ICELLTYPE = 0).

\item \texttt{AUTO\_FLOW\_REDUCE\_CSV}---keyword to specify that record corresponds to the AUTO\_FLOW\_REDUCE output option in which a new record is written for each well and for each time step in which the user-requested extraction rate is reduced by the program.

Expand Down
16 changes: 9 additions & 7 deletions make/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ SOURCEDIR30=../src/Model/SurfaceWaterFlow
SOURCEDIR31=../src/Model/GroundWaterTransport
SOURCEDIR32=../src/Model/ModelUtilities
SOURCEDIR33=../src/Model/GroundWaterFlow
SOURCEDIR34=../src/Model/TransportModel
SOURCEDIR35=../src/Model/Geometry
SOURCEDIR36=../src/Model/GroundWaterEnergy
SOURCEDIR34=../src/Model/Discretization
SOURCEDIR35=../src/Model/TransportModel
SOURCEDIR36=../src/Model/Geometry
SOURCEDIR37=../src/Model/GroundWaterEnergy

VPATH = \
${SOURCEDIR1} \
Expand Down Expand Up @@ -77,7 +78,8 @@ ${SOURCEDIR32} \
${SOURCEDIR33} \
${SOURCEDIR34} \
${SOURCEDIR35} \
${SOURCEDIR36}
${SOURCEDIR36} \
${SOURCEDIR37}

.SUFFIXES: .f90 .F90 .o

Expand Down Expand Up @@ -206,7 +208,6 @@ $(OBJDIR)/BudgetObject.o \
$(OBJDIR)/BoundaryPackage.o \
$(OBJDIR)/CellDefn.o \
$(OBJDIR)/Particle.o \
$(OBJDIR)/gwf-disv.o \
$(OBJDIR)/FlowModelInterface.o \
$(OBJDIR)/Subcell.o \
$(OBJDIR)/TrackData.o \
Expand All @@ -219,7 +220,6 @@ $(OBJDIR)/TernarySolveTrack.o \
$(OBJDIR)/SubcellTri.o \
$(OBJDIR)/Method.o \
$(OBJDIR)/SubcellRect.o \
$(OBJDIR)/gwf-dis.o \
$(OBJDIR)/VirtualBase.o \
$(OBJDIR)/STLVecInt.o \
$(OBJDIR)/BaseModel.o \
Expand Down Expand Up @@ -280,7 +280,9 @@ $(OBJDIR)/tsp-oc.o \
$(OBJDIR)/tsp-obs.o \
$(OBJDIR)/tsp-mvt.o \
$(OBJDIR)/tsp-adv.o \
$(OBJDIR)/gwf-disu.o \
$(OBJDIR)/Disv.o \
$(OBJDIR)/Disu.o \
$(OBJDIR)/Dis.o \
$(OBJDIR)/gwf-uzf.o \
$(OBJDIR)/tsp-apt.o \
$(OBJDIR)/gwt-mst.o \
Expand Down
6 changes: 3 additions & 3 deletions msvs/mf6core.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-buy.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-chd.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-csub.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-dis.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-disu.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-disv.f90"/>
<File RelativePath="..\src\Model\Discretization\Dis.f90"/>
<File RelativePath="..\src\Model\Discretization\Disu.f90"/>
<File RelativePath="..\src\Model\Discretization\Disv.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-drn.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-evt.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-ghb.f90"/>
Expand Down
6 changes: 3 additions & 3 deletions msvs/mf6lib.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
<Filter Name="GroundWaterFlow">
<File RelativePath="..\src\Model\GroundWaterFlow\gwf.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-chd.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-dis.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-disu.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-disv.f90"/>
<File RelativePath="..\src\Model\Discretization\Dis.f90"/>
<File RelativePath="..\src\Model\Discretization\Disu.f90"/>
<File RelativePath="..\src\Model\Discretization\Disv.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-drn.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-evt.f90"/>
<File RelativePath="..\src\Model\GroundWaterFlow\gwf-ghb.f90"/>
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Connection/GridConnection.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module GridConnectionModule
use MemoryHelperModule, only: create_mem_path
use ListModule, only: ListType, isEqualIface
use NumericalModelModule
use GwfDisuModule
use DisuModule
use DisConnExchangeModule
use VirtualModelModule, only: VirtualModelType, get_virtual_model, &
get_virtual_model_from_list
Expand Down Expand Up @@ -973,7 +973,7 @@ subroutine getDiscretization(this, disu)
use ConnectionsModule
use SparseModule, only: sparsematrix
class(GridConnectionType) :: this !< the grid connection
class(GwfDisuType), pointer :: disu !< the target disu object
class(DisuType), pointer :: disu !< the target disu object
! local
integer(I4B) :: icell, nrOfCells, idx
class(VirtualModelType), pointer :: v_model
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Connection/GweInterfaceModel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module GweInterfaceModelModule
use MemoryHelperModule, only: create_mem_path
use NumericalModelModule, only: NumericalModelType
use GweModule, only: GweModelType, CastAsGweModel
use GwfDisuModule, only: disu_cr, CastAsDisuType
use DisuModule, only: disu_cr, CastAsDisuType
use TspFmiModule, only: fmi_cr, TspFmiType
use TspAdvModule, only: adv_cr, TspAdvType
use TspAdvOptionsModule, only: TspAdvOptionsType
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Connection/GwfInterfaceModel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module GwfInterfaceModelModule
use GwfBuyModule, only: buy_cr
use GridConnectionModule
use BaseDisModule
use GwfDisuModule
use DisuModule
use GwfNpfModule
use GwfNpfOptionsModule
use GwfBuyInputDataModule
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Connection/GwtInterfaceModel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module GwtInterfaceModelModule
use MemoryHelperModule, only: create_mem_path
use NumericalModelModule, only: NumericalModelType
use GwtModule, only: GwtModelType, CastAsGwtModel
use GwfDisuModule, only: disu_cr, CastAsDisuType
use DisuModule, only: disu_cr, CastAsDisuType
use TspFmiModule, only: fmi_cr, TspFmiType
use TspAdvModule, only: adv_cr, TspAdvType
use TspAdvOptionsModule, only: TspAdvOptionsType
Expand Down
Loading

0 comments on commit 9af21a0

Please sign in to comment.