MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
gwf-oc.f90
Go to the documentation of this file.
2
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
23contains
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, input_mempath, inunit, iout)
32 ! -- dummy
33 type(gwfoctype), pointer :: ocobj !< GwfOcType object
34 character(len=*), intent(in) :: name_model !< name of the model
35 character(len=*), intent(in) :: input_mempath !< input mempath of the package
36 integer(I4B), intent(in) :: inunit !< unit number for input
37 integer(I4B), intent(in) :: iout !< unit number for output
38 !
39 ! -- Create the object
40 allocate (ocobj)
41 !
42 ! -- Allocate scalars
43 call ocobj%allocate_scalars(name_model, input_mempath)
44 !
45 ! -- Save unit numbers
46 ocobj%inunit = inunit
47 ocobj%iout = iout
48 end subroutine oc_cr
49
50 !> @brief Allocate and read GwfOcType
51 !!
52 !! Setup head and budget as output control variables.
53 !!
54 !<
55 subroutine oc_ar(this, head, dis, dnodata)
59 ! -- dummy
60 class(gwfoctype) :: this !< GwfOcType object
61 real(DP), dimension(:), pointer, contiguous, intent(in) :: head !< model head
62 class(disbasetype), pointer, intent(in) :: dis !< model discretization package
63 real(DP), intent(in) :: dnodata !< no data value
64 ! -- local
65 integer(I4B) :: i, nocdobj, inodata
66 type(outputcontroldatatype), pointer :: ocdobjptr
67 real(DP), dimension(:), pointer, contiguous :: nullvec => null()
68 character(len=LINELENGTH) :: headfile
69 type(gwfocparamfoundtype) :: found
70 !
71 ! -- Initialize variables
72 inodata = 0
73 nocdobj = 2
74 allocate (this%ocds(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('HEAD', head, dis, 'PRINT LAST ', &
84 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
85 this%iout, dnodata)
86 end select
87 this%ocds(i) = ocdobjptr
88 deallocate (ocdobjptr)
89 end do
90 !
91 ! -- Read options or set defaults if this package not on
92 if (this%input_mempath /= '') then
93 write (this%iout, '(/,1x,a,/)') 'PROCESSING OC OPTIONS'
94 call this%source_options()
95 call mem_set_value(headfile, 'HEADFILE', this%input_mempath, &
96 found%headfile)
97 if (found%headfile) then
98 call this%set_ocfile('HEAD', headfile, this%iout)
99 end if
100 write (this%iout, '(1x,a)') 'END OF OC OPTIONS'
101 end if
102 end subroutine oc_ar
103
104end module gwfocmodule
This module contains simulation constants.
Definition Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition Constants.f90:45
integer(i4b), parameter lenmodelname
maximum length of the model name
Definition Constants.f90:22
subroutine, public oc_cr(ocobj, name_model, input_mempath, inunit, iout)
Create GwfOcType.
Definition gwf-oc.f90:32
subroutine oc_ar(this, head, dis, dnodata)
Allocate and read GwfOcType.
Definition gwf-oc.f90:56
This module defines variable data types.
Definition kind.f90:8
Output control data module.
subroutine, public ocd_cr(ocdobj)
Create a new output control data type.
Model output control.
Output control for GWF.
Definition gwf-oc.f90:18
Controls model output. Overridden for each model type.