Skip to content

Commit 97fd89c

Browse files
committed
drop is_part_of_state procedure in favor of part_of_state member variable
1 parent 964559e commit 97fd89c

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/c/fabm_c.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,11 @@ function get_variable_part_of_state(pmodel, category, index) bind(c) result(part
467467

468468
select case (category)
469469
case (INTERIOR_DIAGNOSTIC_VARIABLE)
470-
part_of_state = logical2int(model%p%is_part_of_state(model%p%interior_diagnostic_variables(index)))
470+
part_of_state = logical2int(model%p%interior_diagnostic_variables(index)%part_of_state)
471471
case (HORIZONTAL_DIAGNOSTIC_VARIABLE)
472-
part_of_state = logical2int(model%p%is_part_of_state(model%p%horizontal_diagnostic_variables(index)))
472+
part_of_state = logical2int(model%p%horizontal_diagnostic_variables(index)%part_of_state)
473473
case (SCALAR_DIAGNOSTIC_VARIABLE)
474-
part_of_state = logical2int(model%p%is_part_of_state(model%p%scalar_diagnostic_variables(index)))
474+
part_of_state = logical2int(model%p%scalar_diagnostic_variables(index)%part_of_state)
475475
end select
476476
end function get_variable_part_of_state
477477

src/fabm.F90

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ module fabm
419419
generic :: variable_needs_values => interior_variable_needs_values, interior_variable_needs_values_sn, &
420420
horizontal_variable_needs_values, horizontal_variable_needs_values_sn, &
421421
scalar_variable_needs_values, scalar_variable_needs_values_sn
422-
procedure :: is_part_of_state
423422
!> @}
424423
! ---------------------------------------------------------------------------------------------------------------------------
425424
procedure :: process_job
@@ -946,13 +945,13 @@ subroutine start(self)
946945
self%status = status_start_done
947946

948947
do ivar = 1, size(self%interior_diagnostic_variables)
949-
self%interior_diagnostic_variables(ivar)%part_of_state = self%is_part_of_state(self%interior_diagnostic_variables(ivar))
948+
self%interior_diagnostic_variables(ivar)%part_of_state = self%interior_diagnostic_variables(ivar)%target%part_of_state
950949
end do
951950
do ivar = 1, size(self%horizontal_diagnostic_variables)
952-
self%horizontal_diagnostic_variables(ivar)%part_of_state = self%is_part_of_state(self%horizontal_diagnostic_variables(ivar))
951+
self%horizontal_diagnostic_variables(ivar)%part_of_state = self%horizontal_diagnostic_variables(ivar)%target%part_of_state
953952
end do
954953
do ivar = 1, size(self%scalar_diagnostic_variables)
955-
self%scalar_diagnostic_variables(ivar)%part_of_state = self%is_part_of_state(self%scalar_diagnostic_variables(ivar))
954+
self%scalar_diagnostic_variables(ivar)%part_of_state = self%scalar_diagnostic_variables(ivar)%target%part_of_state
956955
end do
957956

958957
contains
@@ -1645,17 +1644,6 @@ function get_scalar_data(self, id) result(dat)
16451644
if (id%variable%catalog_index /= -1) dat => self%catalog%scalar(id%variable%catalog_index)%p
16461645
end function get_scalar_data
16471646

1648-
! ------------------------------------------------------------------------------------------------------------------------------
1649-
!> Returns whether this variable is part of the model state
1650-
! ------------------------------------------------------------------------------------------------------------------------------
1651-
logical function is_part_of_state(self, variable)
1652-
class (type_fabm_model), intent(in) :: self
1653-
class (type_fabm_diagnostic_variable), intent(in) :: variable !< diagnostic variable
1654-
1655-
_ASSERT_(self%status >= status_start_done, 'is_part_of_state', 'This routine can only be called after model start.')
1656-
is_part_of_state = variable%target%part_of_state
1657-
end function is_part_of_state
1658-
16591647
! ------------------------------------------------------------------------------------------------------------------------------
16601648
!> Initialize all interior state variables
16611649
! ------------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)