Merge branch 'master' into reconnection

This commit is contained in:
Grzegorz Kowal 2021-07-20 18:05:20 -03:00
commit 40b52165e8
2 changed files with 25 additions and 12 deletions

View File

@ -2745,10 +2745,10 @@ module io
! local arrays
!
integer(kind=4), dimension(:) , allocatable :: ids
integer(kind=4), dimension(:,:) , allocatable :: fields
real(kind=8) , dimension(:,:,:) , allocatable :: bounds
real(kind=8) , dimension(:,:,:,:,:), allocatable :: arrays
integer(kind=4), dimension(:) , allocatable :: ids
integer(kind=4), dimension(:,:) , allocatable :: fields
real(kind=8) , dimension(:,:,:) , allocatable :: bounds
real(kind=8) , dimension(:,:,:,:), allocatable :: array
! local parameters
!
@ -2955,9 +2955,9 @@ module io
if (nd > 0) then
#if NDIMS == 3
allocate(ids(nd), arrays(nv,nd,nn,nn,nn), stat = status)
allocate(ids(nd), array(nd,nn,nn,nn), stat = status)
#else /* NDIMS == 3 */
allocate(ids(nd), arrays(nv,nd,nn,nn, 1), stat = status)
allocate(ids(nd), array(nd,nn,nn, 1), stat = status)
#endif /* NDIMS == 3 */
if (status == 0) then
@ -2967,11 +2967,9 @@ module io
do while(associated(pdata))
l = l + 1
ids(l) = pdata%meta%id
arrays(:,l,:,:,:) = pdata%q(:,:,:,:)
ids(l) = pdata%meta%id
pdata => pdata%next
end do ! data blocks
write(fname,"(a,'_',a,'_',i6.6,a)") "datablock", "ids", &
@ -2983,17 +2981,28 @@ module io
dbytes, ddigest, cbytes, cdigest)
do p = 1, nv
l = 0
pdata => list_data
do while(associated(pdata))
l = l + 1
array(l,:,:,:) = pdata%q(p,:,:,:)
pdata => pdata%next
end do ! data blocks
write(fname,"(a,'_',a,'_',i6.6,a)") "datablock", trim(pvars(p)), &
nproc, trim(binary_file_suffix)
call write_binary_xml(trim(dname), trim(fname), &
transfer(arrays(p,:,:,:,:), [ 0_1 ]), &
transfer(array(:,:,:,:), [ 0_1 ]), &
dbytes, ddigest, cbytes, cdigest)
call write_attribute_xml(lun, trim(pvars(p)), trim(fname), &
dbytes, ddigest, cbytes, cdigest)
end do
if (allocated(ids)) deallocate(ids)
if (allocated(arrays)) deallocate(arrays)
if (allocated(ids)) deallocate(ids)
if (allocated(array)) deallocate(array)
else
write(error_unit,"('[',a,']: ',a)") trim(loc), &

View File

@ -2402,6 +2402,10 @@ module mesh
end if
end if ! pmeta belongs to the current process
! redistribute blocks equally among all processors
!
call redistribute_blocks()
#endif /* MPI */
end if ! leaf at current level selected for refinement