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