43 integer,
private :: n_items = 0
62 integer,
intent(in) :: capacity
66 if (capacity <= 0)
then
67 call neko_error(
'Field series list capacity must be positive')
70 allocate(this%items(capacity))
80 if (
allocated(this%items))
then
81 do i = 1,
size(this%items)
82 if (
associated(this%items(i)%ptr))
then
83 nullify(this%items(i)%ptr)
86 deallocate(this%items)
99 if (.not.
allocated(this%items))
then
100 allocate(this%items(1))
104 if (this%n_items >=
size(this%items))
then
105 len =
size(this%items)
106 allocate(tmp(len + 1))
107 tmp(1:len) = this%items
108 call move_alloc(tmp, this%items)
111 this%n_items = this%n_items + 1
112 this%items(this%n_items)%ptr => fld_series
119 integer,
intent(in) :: index
122 if (index < 1 .or. index > this%n_items)
then
123 call neko_error(
'Field series list index out of bounds')
126 field_series_ptr => this%items(index)%ptr
Contains the field_series_list_t type for managing multiple field series.
pure integer function field_series_list_size(this)
Get the number of items in the list.
subroutine field_series_list_init(this, capacity)
Initialize a field series list with a given capacity.
type(field_series_t) function, pointer field_series_list_get(this, index)
Get a field series by index.
subroutine field_series_list_free(this)
Free the field series list.
subroutine field_series_list_append(this, fld_series)
Add a field series to the list.
Contains the field_serties_t type.
A wrapper for a pointer to a field_series_t.
Stores a series (sequence) of fields, logically connected to a base field, and arranged according to ...
A list of field series pointers, used for managing multiple scalar lag fields.