Return the number of cells.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(block_signature_object), | intent(in) | :: | self | Block. |
||
logical, | intent(in), | optional | :: | with_ghosts | Take into account ghost cells. |
Number of cells.
elemental function cells_number(self, with_ghosts) result(cells_number_)
!< Return the number of cells.
class(block_signature_object), intent(in) :: self !< Block.
logical, intent(in), optional :: with_ghosts !< Take into account ghost cells.
integer(I4P) :: cells_number_ !< Number of cells.
logical :: with_ghosts_ !< Take into account ghost cells, local variable.
with_ghosts_ = .true. ; if (present(with_ghosts)) with_ghosts_ = with_ghosts
if (with_ghosts_) then
cells_number_ = (self%ni + self%gc(1) + self%gc(2)) &
* (self%nj + self%gc(3) + self%gc(4)) &
* (self%nk + self%gc(5) + self%gc(6))
else
cells_number_ = (self%ni) &
* (self%nj) &
* (self%nk)
endif
endfunction cells_number