Return the IO position where nodes of block b-th are stored.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(grid_dimensions_object), | intent(in) | :: | self | Grid dimensions object. |
||
| integer(kind=I4P), | intent(in) | :: | b | Block index. |
IO position where nodes of block b-th are stored.
function iopos_block_nodes(self, b)
!< Return the IO position where nodes of block b-th are stored.
class(grid_dimensions_object), intent(in) :: self !< Grid dimensions object.
integer(I4P), intent(in) :: b !< Block index.
integer(I4P) :: iopos_block_nodes !< IO position where nodes of block b-th are stored.
type(vector) :: node !< A node coordinate prototype.
integer(I4P) :: node_iolength !< Node IO length storage.
integer(I4P) :: bb !< Counter.
inquire(iolength=node_iolength) node%x, node%y, node%z
iopos_block_nodes = self%iolength() ! file header length
if (self%blocks_number > 0) then
if (b > 1.and. b <= self%blocks_number) then
! b-th block, there are the file header and [1:b-1] blocks before its nodes
do bb=1, b-1
iopos_block_nodes = iopos_block_nodes + self%block_signature(bb)%nodes_number() * node_iolength
enddo
iopos_block_nodes = iopos_block_nodes + 1
else
! first block, there is only the file header before its nodes
iopos_block_nodes = iopos_block_nodes + 1
endif
endif
endfunction iopos_block_nodes