80 character(len=:),
allocatable,
public :: label
84 type(iteration_counter_t),
public :: iteration
90 logical,
public :: always_available = .false.
95 logical,
public :: updated_on_demand = .
true.
103 character(len=100),
allocatable,
public :: parents(:)
112 function quantity_constructor(label, always_available, updated_on_demand, iteration, parents)
result(quantity)
113 character(len=*),
intent(in) :: label
114 logical,
optional,
intent(in) :: always_available
115 logical,
optional,
intent(in) :: updated_on_demand
116 type(iteration_counter_t),
optional,
intent(in) :: iteration
117 character(len=*),
optional,
intent(in) :: parents(:)
118 type(quantity_t) :: quantity
122 quantity%label = trim(label)
123 if (
present(always_available))
then
124 quantity%always_available = always_available
126 if (
present(updated_on_demand))
then
127 quantity%updated_on_demand = updated_on_demand
129 if (
present(iteration))
then
130 quantity%iteration = iteration
132 if (
present(parents))
then
133 allocate(quantity%parents(
size(parents)))
134 do i = 1,
size(parents)
135 quantity%parents(i) = trim(parents(i))
138 allocate(quantity%parents(0))
147 class(quantity_list_t) :: this
148 class(quantity_t),
target :: quantity
150 call this%add_copy(quantity)
159 character(len=*),
intent(in) :: label
160 class(quantity_t),
pointer :: quantity
168 call iterator%start(this)
169 do while (iterator%has_next() .and. .not. have)
170 quantity => iterator%get_next()
171 have = trim(quantity%label) == trim(label)
184 character(len=*),
intent(in) :: labels(:)
185 logical :: always_available(size(labels))
190 do i = 1,
size(labels)
191 quantity => this%get(labels(i))
192 always_available(i) = quantity%always_available
201 character(len=*),
intent(in) :: labels(:)
203 logical :: equal(size(labels))
208 do i = 1,
size(labels)
209 quantity => this%get(labels(i))
211 equal(i) = quantity%iteration == iteration
223 select type (ptr => this%get_next_ptr())
This module implements fully polymorphic linked lists, and some specializations thereof.
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
logical function, dimension(size(labels)) quantity_list_always_available(this, labels)
Return if given quantities are always available or not.
subroutine quantity_list_add_node(this, quantity)
add a quantity to the list
class(quantity_t) function, pointer quantity_iterator_get_next(this)
get next quantity from the list
class(quantity_t) function, pointer quantity_list_get(this, label)
get pointer to quantity with given label
type(quantity_t) function quantity_constructor(label, always_available, updated_on_demand, iteration, parents)
logical function, dimension(size(labels)) quantity_list_iteration_equal(this, labels, iteration)
Return if given quantities are at a given iteration.
This class implements the iteration counter used by the multisystem algorithms. As any iteration coun...
This class implements an iterator for the polymorphic linked list.
This class implements a linked list of unlimited polymorphic values.
These classes extends the list and list iterator to create a quantity list.
Systems (system_t) can expose quantities that can be used to calculate interactions with other system...