MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
TimeSeriesRecord.f90
Go to the documentation of this file.
2 
3  use kindmodule, only: dp, i4b
4  use listmodule, only: listtype
5 
6  private
9 
11  ! -- Public members
12  real(dp), public :: tsrtime
13  real(dp), public :: tsrvalue
14  end type timeseriesrecordtype
15 
16 contains
17 
18  !> @brief Allocate and assign members of a new TimeSeriesRecordType object
19  !<
20  subroutine constructtimeseriesrecord(newTsRecord, time, value)
21  implicit none
22  ! -- dummy
23  type(timeseriesrecordtype), pointer, intent(out) :: newtsrecord
24  real(dp), intent(in) :: time, value
25  !
26  allocate (newtsrecord)
27  newtsrecord%tsrTime = time
28  newtsrecord%tsrValue = value
29  !
30  ! -- Return
31  return
32  end subroutine constructtimeseriesrecord
33 
34  !> @brief Cast an unlimited polymorphic object as TimeSeriesRecordType
35  !<
36  function castastimeseriesrecordtype(obj) result(res)
37  implicit none
38  ! -- dummy
39  class(*), pointer, intent(inout) :: obj
40  ! -- return
41  type(timeseriesrecordtype), pointer :: res
42  !
43  res => null()
44  if (.not. associated(obj)) return
45  !
46  select type (obj)
47  type is (timeseriesrecordtype)
48  res => obj
49  end select
50  !
51  ! -- Return
52  return
53  end function castastimeseriesrecordtype
54 
55  !> @brief Add time series record to list
56  !<
57  subroutine addtimeseriesrecordtolist(list, tsrecord)
58  implicit none
59  ! -- dummy
60  type(listtype), intent(inout) :: list
61  type(timeseriesrecordtype), pointer, intent(inout) :: tsrecord
62  ! -- local
63  class(*), pointer :: obj => null()
64  !
65  obj => tsrecord
66  call list%Add(obj)
67  !
68  ! -- Return
69  return
70  end subroutine addtimeseriesrecordtolist
71 
72 end module timeseriesrecordmodule
This module defines variable data types.
Definition: kind.f90:8
subroutine, public addtimeseriesrecordtolist(list, tsrecord)
Add time series record to list.
subroutine, public constructtimeseriesrecord(newTsRecord, time, value)
Allocate and assign members of a new TimeSeriesRecordType object.
type(timeseriesrecordtype) function, pointer, public castastimeseriesrecordtype(obj)
Cast an unlimited polymorphic object as TimeSeriesRecordType.
A generic heterogeneous doubly-linked list.
Definition: List.f90:10