Commit 8a323c0b authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

added finalization for type_aggregate_variable_list

parent 05528c16
......@@ -2239,6 +2239,7 @@ contains
end if
aggregate_variable => aggregate_variable%next
end do
call aggregate_variable_list%finalize()
! Count number of conserved quantities and allocate an array for them.
ncons = 0
......
......@@ -34,8 +34,9 @@ module fabm_coupling
type type_aggregate_variable_list
type (type_aggregate_variable), pointer :: first => null()
contains
procedure :: get => aggregate_variable_list_get
procedure :: print => aggregate_variable_list_print
procedure :: get => aggregate_variable_list_get
procedure :: print => aggregate_variable_list_print
procedure :: finalize => aggregate_variable_list_finalize
end type
contains
......@@ -448,6 +449,19 @@ contains
self%first => aggregate_variable
end function
subroutine aggregate_variable_list_finalize(self)
class (type_aggregate_variable_list), intent(inout) :: self
type (type_aggregate_variable), pointer :: current, next
current => self%first
do while (associated(current))
next => current%next
deallocate(current)
current => next
end do
end subroutine
function collect_aggregate_variables(self) result(list)
class (type_base_model), intent(in), target :: self
type (type_aggregate_variable_list) :: list
......@@ -558,6 +572,8 @@ contains
aggregate_variable_access => aggregate_variable_access%next
end do
call list%finalize()
! Process child models
child => self%children%first
do while (associated(child))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment