MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
basemodelmodule Module Reference

Data Types

type  basemodeltype
 Highest level model type. All models extend this parent type. More...
 

Functions/Subroutines

subroutine model_df (this)
 Define the model. More...
 
subroutine model_ar (this)
 Allocate and read. More...
 
subroutine model_rp (this)
 Read and prepare. More...
 
subroutine model_dt (this)
 Calculate time step length. More...
 
subroutine model_ot (this)
 Output results. More...
 
subroutine model_message (this, line, fmt)
 Write line to model iout. More...
 
subroutine model_fp (this)
 Final processing. More...
 
subroutine allocate_scalars (this, modelname)
 Allocate scalar variables. More...
 
subroutine model_da (this)
 Deallocate. More...
 
class(basemodeltype) function, pointer, public castasbasemodelclass (obj)
 
subroutine, public addbasemodeltolist (list, model)
 
class(basemodeltype) function, pointer, public getbasemodelfromlist (list, idx)
 

Function/Subroutine Documentation

◆ addbasemodeltolist()

subroutine, public basemodelmodule::addbasemodeltolist ( type(listtype), intent(inout)  list,
class(basemodeltype), intent(inout), pointer  model 
)

Definition at line 160 of file BaseModel.f90.

161  ! -- dummy
162  type(ListType), intent(inout) :: list
163  class(BaseModelType), pointer, intent(inout) :: model
164  ! -- local
165  class(*), pointer :: obj
166  !
167  obj => model
168  call list%Add(obj)
Here is the caller graph for this function:

◆ allocate_scalars()

subroutine basemodelmodule::allocate_scalars ( class(basemodeltype this,
character(len=*), intent(in)  modelname 
)
private

Definition at line 97 of file BaseModel.f90.

98  ! -- modules
100  ! -- dummy
101  class(BaseModelType) :: this
102  character(len=*), intent(in) :: modelname
103  !
104  call mem_allocate(this%name, lenmodelname, 'NAME', this%memoryPath)
105  call mem_allocate(this%macronym, 3, 'MACRONYM', this%memoryPath)
106  call mem_allocate(this%id, 'ID', this%memoryPath)
107  call mem_allocate(this%iout, 'IOUT', this%memoryPath)
108  call mem_allocate(this%inewton, 'INEWTON', this%memoryPath)
109  call mem_allocate(this%iprpak, 'IPRPAK', this%memoryPath)
110  call mem_allocate(this%iprflow, 'IPRFLOW', this%memoryPath)
111  call mem_allocate(this%ipakcb, 'IPAKCB', this%memoryPath)
112  call mem_allocate(this%idsoln, 'IDSOLN', this%memoryPath)
113  !
114  this%name = modelname
115  this%macronym = ''
116  this%idsoln = 0
117  this%id = 0
118  this%iout = 0
119  this%iprpak = 0
120  this%iprflow = 0
121  this%ipakcb = 0
122  this%inewton = 0 !default is standard formulation

◆ castasbasemodelclass()

class(basemodeltype) function, pointer, public basemodelmodule::castasbasemodelclass ( class(*), intent(inout), pointer  obj)

Definition at line 147 of file BaseModel.f90.

148  class(*), pointer, intent(inout) :: obj
149  class(BaseModelType), pointer :: res
150  !
151  res => null()
152  if (.not. associated(obj)) return
153  !
154  select type (obj)
155  class is (basemodeltype)
156  res => obj
157  end select
Here is the caller graph for this function:

◆ getbasemodelfromlist()

class(basemodeltype) function, pointer, public basemodelmodule::getbasemodelfromlist ( type(listtype), intent(inout)  list,
integer(i4b), intent(in)  idx 
)

Definition at line 171 of file BaseModel.f90.

172  ! -- dummy
173  type(ListType), intent(inout) :: list
174  integer(I4B), intent(in) :: idx
175  class(BaseModelType), pointer :: res
176  ! -- local
177  class(*), pointer :: obj
178  !
179  obj => list%GetItem(idx)
180  res => castasbasemodelclass(obj)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ model_ar()

subroutine basemodelmodule::model_ar ( class(basemodeltype this)
private

Definition at line 46 of file BaseModel.f90.

47  class(BaseModelType) :: this

◆ model_da()

subroutine basemodelmodule::model_da ( class(basemodeltype this)

Definition at line 127 of file BaseModel.f90.

128  ! -- modules
130  ! -- dummy
131  class(BaseModelType) :: this
132  !
133  ! -- Strings
134  call mem_deallocate(this%name, 'NAME', this%memoryPath)
135  call mem_deallocate(this%macronym, 'MACRONYM', this%memoryPath)
136  !
137  ! -- Scalars
138  call mem_deallocate(this%id)
139  call mem_deallocate(this%iout)
140  call mem_deallocate(this%inewton)
141  call mem_deallocate(this%iprpak)
142  call mem_deallocate(this%iprflow)
143  call mem_deallocate(this%ipakcb)
144  call mem_deallocate(this%idsoln)

◆ model_df()

subroutine basemodelmodule::model_df ( class(basemodeltype this)
private

Definition at line 40 of file BaseModel.f90.

41  class(BaseModelType) :: this

◆ model_dt()

subroutine basemodelmodule::model_dt ( class(basemodeltype this)
private

Definition at line 58 of file BaseModel.f90.

59  class(BaseModelType) :: this

◆ model_fp()

subroutine basemodelmodule::model_fp ( class(basemodeltype this)
private

Definition at line 91 of file BaseModel.f90.

92  class(BaseModelType) :: this

◆ model_message()

subroutine basemodelmodule::model_message ( class(basemodeltype this,
character(len=*), intent(in)  line,
character(len=*), intent(in), optional  fmt 
)
private

Definition at line 70 of file BaseModel.f90.

71  ! -- dummy
72  class(BaseModelType) :: this
73  character(len=*), intent(in) :: line
74  character(len=*), intent(in), optional :: fmt
75  ! -- local
76  character(len=LINELENGTH) :: cfmt
77  !
78  ! -- process optional variables
79  if (present(fmt)) then
80  cfmt = fmt
81  else
82  cfmt = '(1x,a)'
83  end if
84  !
85  ! -- write line
86  write (this%iout, trim(cfmt)) trim(line)

◆ model_ot()

subroutine basemodelmodule::model_ot ( class(basemodeltype this)
private

Definition at line 64 of file BaseModel.f90.

65  class(BaseModelType) :: this

◆ model_rp()

subroutine basemodelmodule::model_rp ( class(basemodeltype this)
private

Definition at line 52 of file BaseModel.f90.

53  class(BaseModelType) :: this