MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
gwf-oc.f90
Go to the documentation of this file.
1 module gwfocmodule
2 
3  use basedismodule, only: disbasetype
4  use kindmodule, only: dp, i4b
8 
9  implicit none
10  private
11  public gwfoctype, oc_cr
12 
13  !> @ brief Output control for GWF
14  !!
15  !! Concrete implementation of OutputControlType for the
16  !! GWF Model
17  !<
18  type, extends(outputcontroltype) :: gwfoctype
19  contains
20  procedure :: oc_ar
21  end type gwfoctype
22 
23 contains
24 
25  !> @ brief Create GwfOcType
26  !!
27  !! Create by allocating a new GwfOcType object and initializing
28  !! member variables.
29  !!
30  !<
31  subroutine oc_cr(ocobj, name_model, inunit, iout)
32  ! -- dummy
33  type(gwfoctype), pointer :: ocobj !< GwfOcType object
34  character(len=*), intent(in) :: name_model !< name of the model
35  integer(I4B), intent(in) :: inunit !< unit number for input
36  integer(I4B), intent(in) :: iout !< unit number for output
37  !
38  ! -- Create the object
39  allocate (ocobj)
40  !
41  ! -- Allocate scalars
42  call ocobj%allocate_scalars(name_model)
43  !
44  ! -- Save unit numbers
45  ocobj%inunit = inunit
46  ocobj%iout = iout
47  !
48  ! -- Initialize block parser
49  call ocobj%parser%Initialize(inunit, iout)
50  end subroutine oc_cr
51 
52  !> @ brief Allocate and read GwfOcType
53  !!
54  !! Setup head and budget as output control variables.
55  !!
56  !<
57  subroutine oc_ar(this, head, dis, dnodata)
58  ! -- dummy
59  class(gwfoctype) :: this !< GwfOcType object
60  real(DP), dimension(:), pointer, contiguous, intent(in) :: head !< model head
61  class(disbasetype), pointer, intent(in) :: dis !< model discretization package
62  real(DP), intent(in) :: dnodata !< no data value
63  ! -- local
64  integer(I4B) :: i, nocdobj, inodata
65  type(outputcontroldatatype), pointer :: ocdobjptr
66  real(DP), dimension(:), pointer, contiguous :: nullvec => null()
67  !
68  ! -- Initialize variables
69  inodata = 0
70  nocdobj = 2
71  allocate (this%ocds(nocdobj))
72  do i = 1, nocdobj
73  call ocd_cr(ocdobjptr)
74  select case (i)
75  case (1)
76  call ocdobjptr%init_dbl('BUDGET', nullvec, dis, 'PRINT LAST ', &
77  'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
78  this%iout, dnodata)
79  case (2)
80  call ocdobjptr%init_dbl('HEAD', head, dis, 'PRINT LAST ', &
81  'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
82  this%iout, dnodata)
83  end select
84  this%ocds(i) = ocdobjptr
85  deallocate (ocdobjptr)
86  end do
87  !
88  ! -- Read options or set defaults if this package not on
89  if (this%inunit > 0) then
90  call this%read_options()
91  end if
92  end subroutine oc_ar
93 
94 end module gwfocmodule
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenmodelname
maximum length of the model name
Definition: Constants.f90:22
subroutine, public oc_cr(ocobj, name_model, inunit, iout)
@ brief Create GwfOcType
Definition: gwf-oc.f90:32
subroutine oc_ar(this, head, dis, dnodata)
@ brief Allocate and read GwfOcType
Definition: gwf-oc.f90:58
This module defines variable data types.
Definition: kind.f90:8
Output control data module.
subroutine, public ocd_cr(ocdobj)
@ brief Create a new output control data type.
Model output control.
@ brief Output control for GWF
Definition: gwf-oc.f90:18
@ brief Controls model output. Overridden for each model type.