MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
tsp-oc.f90
Go to the documentation of this file.
1 module tspocmodule
2 
3  use basedismodule, only: disbasetype
4  use kindmodule, only: dp, i4b
8 
9  implicit none
10  private
11  public tspoctype, oc_cr
12 
13  !> @ brief Output control
14  !!
15  !! Concrete implementation of OutputControlType for a
16  !! Transport Model
17  !<
18  type, extends(outputcontroltype) :: tspoctype
19  contains
20  procedure :: oc_ar
21  end type tspoctype
22 
23 contains
24 
25  !> @ brief Create TspOcType
26  !!
27  !! Create by allocating a new TspOcType object and initializing
28  !! member variables.
29  !<
30  subroutine oc_cr(ocobj, name_model, inunit, iout)
31  ! -- dummy
32  type(tspoctype), pointer :: ocobj !< TspOcType 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 TspOcType
55  !!
56  !! Setup dependent variable (e.g., concentration or temperature)
57  !! and budget as output control variables.
58  !!
59  !<
60  subroutine oc_ar(this, depvar, dis, dnodata, dvname)
61  ! -- dummy
62  class(tspoctype) :: this !< TspOcType object
63  real(DP), dimension(:), pointer, contiguous, intent(in) :: depvar !< model concentration
64  character(len=*), intent(in) :: dvname !< name of dependent variable solved by generalized transport model (concentration, temperature)
65  class(disbasetype), pointer, intent(in) :: dis !< model discretization package
66  real(DP), intent(in) :: dnodata !< no data value
67  ! -- local
68  integer(I4B) :: i, nocdobj, inodata
69  type(outputcontroldatatype), pointer :: ocdobjptr
70  real(DP), dimension(:), pointer, contiguous :: nullvec => null()
71  !
72  ! -- Initialize variables
73  inodata = 0
74  nocdobj = 2
75  allocate (this%ocdobj(nocdobj))
76  do i = 1, nocdobj
77  call ocd_cr(ocdobjptr)
78  select case (i)
79  case (1)
80  call ocdobjptr%init_dbl('BUDGET', nullvec, dis, 'PRINT LAST ', &
81  'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
82  this%iout, dnodata)
83  case (2)
84  call ocdobjptr%init_dbl(trim(dvname), depvar, dis, 'PRINT LAST ', &
85  'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
86  this%iout, dnodata)
87  end select
88  this%ocdobj(i) = ocdobjptr
89  deallocate (ocdobjptr)
90  end do
91  !
92  ! -- Read options or set defaults if this package not on
93  if (this%inunit > 0) then
94  call this%read_options()
95  end if
96  !
97  ! -- Return
98  return
99  end subroutine oc_ar
100 
101 end module tspocmodule
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, public oc_cr(ocobj, name_model, inunit, iout)
@ brief Create TspOcType
Definition: tsp-oc.f90:31
subroutine oc_ar(this, depvar, dis, dnodata, dvname)
@ brief Allocate and read TspOcType
Definition: tsp-oc.f90:61
@ brief Output control
Definition: tsp-oc.f90:18