Skip to content

Commit

Permalink
replace grb.f90
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jan 24, 2025
1 parent ccc6aee commit 6bcbaa8
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 211 deletions.
28 changes: 14 additions & 14 deletions make/makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# makefile created by pymake (version 1.2.11.dev0) for the 'mf6' executable.
# makefile created by pymake (version 1.4.0.dev0) for the 'mf6' executable.


include ./makedefaults
Expand Down Expand Up @@ -226,7 +226,6 @@ $(OBJDIR)/SourceCommon.o \
$(OBJDIR)/MemoryManagerExt.o \
$(OBJDIR)/ats.o \
$(OBJDIR)/GeomUtil.o \
$(OBJDIR)/GridFileReader.o \
$(OBJDIR)/TimeSeriesLink.o \
$(OBJDIR)/TimeSeriesFileList.o \
$(OBJDIR)/tdis.o \
Expand All @@ -243,13 +242,22 @@ $(OBJDIR)/Connections.o \
$(OBJDIR)/TimeArray.o \
$(OBJDIR)/ObsOutput.o \
$(OBJDIR)/DiscretizationBase.o \
$(OBJDIR)/ArrayReaderBase.o \
$(OBJDIR)/TimeArraySeries.o \
$(OBJDIR)/ObsOutputList.o \
$(OBJDIR)/Observe.o \
$(OBJDIR)/Integer2dReader.o \
$(OBJDIR)/BudgetFileReader.o \
$(OBJDIR)/TimeArraySeriesLink.o \
$(OBJDIR)/ObsUtility.o \
$(OBJDIR)/ObsContainer.o \
$(OBJDIR)/Integer1dReader.o \
$(OBJDIR)/Double2dReader.o \
$(OBJDIR)/Double1dReader.o \
$(OBJDIR)/Disv.o \
$(OBJDIR)/Disu.o \
$(OBJDIR)/Dis.o \
$(OBJDIR)/Disv1dGeom.o \
$(OBJDIR)/BudgetTerm.o \
$(OBJDIR)/Budget.o \
$(OBJDIR)/TimeArraySeriesManager.o \
Expand All @@ -259,6 +267,10 @@ $(OBJDIR)/NumericalPackage.o \
$(OBJDIR)/Particle.o \
$(OBJDIR)/PackageBudget.o \
$(OBJDIR)/HeadFileReader.o \
$(OBJDIR)/GridFileReader.o \
$(OBJDIR)/Disv2d.o \
$(OBJDIR)/Disv1d.o \
$(OBJDIR)/Dis2d.o \
$(OBJDIR)/BudgetObject.o \
$(OBJDIR)/BoundaryPackage.o \
$(OBJDIR)/CellDefn.o \
Expand Down Expand Up @@ -303,7 +315,6 @@ $(OBJDIR)/GwfVscInputData.o \
$(OBJDIR)/gwf-ghb.o \
$(OBJDIR)/gwf-drn.o \
$(OBJDIR)/IndexMap.o \
$(OBJDIR)/ArrayReaderBase.o \
$(OBJDIR)/MethodSubcellPool.o \
$(OBJDIR)/CellPoly.o \
$(OBJDIR)/CellRectQuad.o \
Expand All @@ -328,12 +339,10 @@ $(OBJDIR)/InterfaceMap.o \
$(OBJDIR)/SeqVector.o \
$(OBJDIR)/ImsLinearSettings.o \
$(OBJDIR)/ConvergenceSummary.o \
$(OBJDIR)/Integer2dReader.o \
$(OBJDIR)/MethodCellTernary.o \
$(OBJDIR)/MethodCellPollockQuad.o \
$(OBJDIR)/MethodCellPollock.o \
$(OBJDIR)/MethodCellPassToBot.o \
$(OBJDIR)/Disv1dGeom.o \
$(OBJDIR)/VectorInterpolation.o \
$(OBJDIR)/swf-cxs.o \
$(OBJDIR)/CellWithNbrs.o \
Expand All @@ -343,9 +352,6 @@ $(OBJDIR)/tsp-oc.o \
$(OBJDIR)/tsp-obs.o \
$(OBJDIR)/tsp-mvt.o \
$(OBJDIR)/tsp-adv.o \
$(OBJDIR)/Disv.o \
$(OBJDIR)/Disu.o \
$(OBJDIR)/Dis.o \
$(OBJDIR)/gwf-uzf.o \
$(OBJDIR)/tsp-apt.o \
$(OBJDIR)/gwt-mst.o \
Expand All @@ -367,12 +373,8 @@ $(OBJDIR)/DefinitionSelect.o \
$(OBJDIR)/StructVector.o \
$(OBJDIR)/IdmLogger.o \
$(OBJDIR)/NCFileVars.o \
$(OBJDIR)/Integer1dReader.o \
$(OBJDIR)/Double2dReader.o \
$(OBJDIR)/Double1dReader.o \
$(OBJDIR)/MethodCellPool.o \
$(OBJDIR)/CellUtil.o \
$(OBJDIR)/Disv1d.o \
$(OBJDIR)/swf-dfw.o \
$(OBJDIR)/swf-ic.o \
$(OBJDIR)/VirtualExchange.o \
Expand Down Expand Up @@ -427,8 +429,6 @@ $(OBJDIR)/swf-oc.o \
$(OBJDIR)/swf-obs.o \
$(OBJDIR)/swf-flw.o \
$(OBJDIR)/swf-cdb.o \
$(OBJDIR)/Disv2d.o \
$(OBJDIR)/Dis2d.o \
$(OBJDIR)/GridConnection.o \
$(OBJDIR)/DistributedVariable.o \
$(OBJDIR)/gwt.o \
Expand Down
74 changes: 64 additions & 10 deletions src/Model/ModelUtilities/FlowModelInterface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module FlowModelInterfaceModule
use ListModule, only: ListType
use BudgetFileReaderModule, only: BudgetFileReaderType
use HeadFileReaderModule, only: HeadFileReaderType
use GridFileReaderModule, only: GridFileReaderType, read_grb
use GridFileReaderModule, only: GridFileReaderType
use PackageBudgetModule, only: PackageBudgetType
use BudgetObjectModule, only: BudgetObjectType, budgetobject_cr_bfr

Expand Down Expand Up @@ -341,6 +341,9 @@ subroutine read_packagedata(this)
use DisModule, only: DisType
use DisvModule, only: DisvType
use DisuModule, only: DisuType
use Dis2dModule, only: Dis2dType
use Disv2dModule, only: Disv2dType
use Disv1dModule, only: Disv1dType
! -- dummy
class(FlowModelInterfaceType) :: this
! -- local
Expand Down Expand Up @@ -448,18 +451,16 @@ subroutine read_packagedata(this)
this%iugrb = inunit
call this%gfr%initialize(this%iugrb)

! check node count
nodes = this%gfr%read_int("NCELLS")
if (nodes /= this%dis%nodes) then
write (errmsg, fmtdiserr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if

! check idomain
! check grid equivalence
select case (this%gfr%grid_type)
case ('DIS')
select type (dis => this%dis)
type is (DisType)
nodes = this%gfr%read_int("NCELLS")
if (nodes /= this%dis%nodes) then
write (errmsg, fmtdiserr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
idomain3d = this%gfr%read_idomain_dis()
if (.not. all(dis%idomain == idomain3d)) then
write (errmsg, fmtidomerr) trim(this%text)
Expand All @@ -469,6 +470,11 @@ subroutine read_packagedata(this)
case ('DISV')
select type (dis => this%dis)
type is (DisvType)
nodes = this%gfr%read_int("NCELLS")
if (nodes /= this%dis%nodes) then
write (errmsg, fmtdiserr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
idomain2d = this%gfr%read_idomain_disv()
if (.not. all(dis%idomain == idomain2d)) then
write (errmsg, fmtidomerr) trim(this%text)
Expand All @@ -478,14 +484,62 @@ subroutine read_packagedata(this)
case ('DISU')
select type (dis => this%dis)
type is (DisuType)
nodes = this%gfr%read_int("NODES")
if (nodes /= this%dis%nodes) then
write (errmsg, fmtdiserr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
idomain1d = this%gfr%read_idomain_disu()
if (.not. all(dis%idomain == idomain1d)) then
write (errmsg, fmtidomerr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
end select
case ('DIS2D')
select type (dis => this%dis)
type is (Dis2dType)
nodes = this%gfr%read_int("NCELLS")
if (nodes /= this%dis%nodes) then
write (errmsg, fmtdiserr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
idomain2d = this%gfr%read_idomain_dis2d()
if (.not. all(dis%idomain == idomain2d)) then
write (errmsg, fmtidomerr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
end select
case ('DISV2D')
select type (dis => this%dis)
type is (Disv2dType)
nodes = this%gfr%read_int("NCELLS")
if (nodes /= this%dis%nodes) then
write (errmsg, fmtdiserr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
idomain1d = this%gfr%read_idomain_disv2d()
if (.not. all(dis%idomain == idomain1d)) then
write (errmsg, fmtidomerr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
end select
case ('DISV1D')
select type (dis => this%dis)
type is (Disv1dType)
nodes = this%gfr%read_int("NCELLS")
if (nodes /= this%dis%nodes) then
write (errmsg, fmtdiserr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
idomain1d = this%gfr%read_idomain_disv1d()
if (.not. all(dis%idomain == idomain1d)) then
write (errmsg, fmtidomerr) trim(this%text)
call store_error(errmsg, terminate=.TRUE.)
end if
end select
end select
! TODO other grid types

call this%gfr%finalize()
case default
write (errmsg, '(a,3(1x,a))') &
'UNKNOWN', trim(adjustl(this%text)), 'PACKAGEDATA:', trim(keyword)
Expand Down
Loading

0 comments on commit 6bcbaa8

Please sign in to comment.