IO: Store an attribute indicating the domain periodicity.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2017-12-30 14:25:49 -02:00
parent 88434201bf
commit 198e6db77c

View File

@ -1274,7 +1274,7 @@ module io
use evolution , only : step, time, dt, dtn use evolution , only : step, time, dt, dtn
use hdf5 , only : hid_t use hdf5 , only : hid_t
use hdf5 , only : h5gcreate_f, h5gclose_f use hdf5 , only : h5gcreate_f, h5gclose_f
use mpitools , only : nprocs, nproc use mpitools , only : nprocs, nproc, periodic
use random , only : nseeds, get_seeds use random , only : nseeds, get_seeds
! local variables are not implicit by default ! local variables are not implicit by default
@ -1290,6 +1290,10 @@ module io
integer(hid_t) :: gid integer(hid_t) :: gid
integer :: err integer :: err
! local vectors
!
integer, dimension(3) :: per
! local allocatable arrays ! local allocatable arrays
! !
integer(kind=4), dimension(:), allocatable :: seeds integer(kind=4), dimension(:), allocatable :: seeds
@ -1318,6 +1322,10 @@ module io
end if end if
! convert periodic(:) to an integer vector
!
per(:) = merge(1, 0, periodic(:))
! store string attributes ! store string attributes
! !
call write_attribute(gid, 'eqsys' , eqsys ) call write_attribute(gid, 'eqsys' , eqsys )
@ -1325,21 +1333,22 @@ module io
! store the integer attributes ! store the integer attributes
! !
call write_attribute(gid, 'ndims' , NDIMS ) call write_attribute(gid, 'ndims' , NDIMS )
call write_attribute(gid, 'last_id', get_last_id()) call write_attribute(gid, 'last_id' , get_last_id())
call write_attribute(gid, 'mblocks', get_mblocks()) call write_attribute(gid, 'mblocks' , get_mblocks())
call write_attribute(gid, 'dblocks', get_dblocks()) call write_attribute(gid, 'dblocks' , get_dblocks())
call write_attribute(gid, 'nleafs' , get_nleafs() ) call write_attribute(gid, 'nleafs' , get_nleafs() )
call write_attribute(gid, 'ncells' , nc ) call write_attribute(gid, 'ncells' , nc )
call write_attribute(gid, 'nghosts', ng ) call write_attribute(gid, 'nghosts' , ng )
call write_attribute(gid, 'minlev' , minlev ) call write_attribute(gid, 'minlev' , minlev )
call write_attribute(gid, 'maxlev' , maxlev ) call write_attribute(gid, 'maxlev' , maxlev )
call write_attribute(gid, 'toplev' , toplev ) call write_attribute(gid, 'toplev' , toplev )
call write_attribute(gid, 'nprocs' , nprocs ) call write_attribute(gid, 'nprocs' , nprocs )
call write_attribute(gid, 'nproc' , nproc ) call write_attribute(gid, 'nproc' , nproc )
call write_attribute(gid, 'nseeds' , nseeds ) call write_attribute(gid, 'nseeds' , nseeds )
call write_attribute(gid, 'step' , step ) call write_attribute(gid, 'step' , step )
call write_attribute(gid, 'isnap' , isnap ) call write_attribute(gid, 'isnap' , isnap )
call write_attribute(gid, 'periodic', per(:) )
! store the real attributes ! store the real attributes
! !