80 character(len=:),
allocatable,
public :: label
85 type(iteration_counter_t),
public :: iteration
93 logical,
public :: always_available = .false.
98 logical,
public :: updated_on_demand = .
true.
108 character(len=100),
allocatable,
public :: parents(:)
117 function quantity_constructor(label, always_available, updated_on_demand, iteration, parents)
result(quantity)
118 character(len=*),
intent(in) :: label
119 logical,
optional,
intent(in) :: always_available
120 logical,
optional,
intent(in) :: updated_on_demand
121 type(iteration_counter_t),
optional,
intent(in) :: iteration
122 character(len=*),
optional,
intent(in) :: parents(:)
123 type(quantity_t) :: quantity
127 quantity%label = trim(label)
128 if (
present(always_available))
then
129 quantity%always_available = always_available
131 if (
present(updated_on_demand))
then
132 quantity%updated_on_demand = updated_on_demand
134 if (
present(iteration))
then
135 quantity%iteration = iteration
137 if (
present(parents))
then
138 allocate(quantity%parents(
size(parents)))
139 do i = 1,
size(parents)
140 quantity%parents(i) = trim(parents(i))
143 allocate(quantity%parents(0))
152 class(quantity_list_t) :: this
155 call this%add_copy(quantity)
164 character(len=*),
intent(in) :: label
173 call iterator%start(this)
174 do while (iterator%has_next() .and. .not. have)
175 quantity => iterator%get_next()
176 have = trim(quantity%label) == trim(label)
189 character(len=*),
intent(in) :: labels(:)
190 logical :: always_available(size(labels))
195 do i = 1,
size(labels)
196 quantity => this%get(labels(i))
197 always_available(i) = quantity%always_available
206 character(len=*),
intent(in) :: labels(:)
208 logical :: equal(size(labels))
213 do i = 1,
size(labels)
214 quantity => this%get(labels(i))
216 equal(i) = quantity%iteration == iteration
228 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...