IO: Use new XML structure for binary files in write_restart_snapshot_xml().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
7867d9d062
commit
42951cd48c
@ -1970,7 +1970,6 @@ module io
|
||||
!
|
||||
logical :: test
|
||||
character(len=64) :: dname, fname
|
||||
character(len=22) :: digest_string
|
||||
integer(kind=8) :: digest, bytes
|
||||
integer(kind=4) :: lun = 103
|
||||
integer :: nd, nl, nm, nx, i, j, l, n, p
|
||||
@ -2112,7 +2111,7 @@ module io
|
||||
write(lun,"(a)") '<Snapshots>'
|
||||
call write_attribute_xml(lun, "isnap" , isnap)
|
||||
write(lun,"(a)") '</Snapshots>'
|
||||
write(lun,"(a)") '<Hashes>'
|
||||
write(lun,"(a)") '<BinaryFiles>'
|
||||
|
||||
! prepare and store metablocks
|
||||
!
|
||||
@ -2214,43 +2213,43 @@ module io
|
||||
|
||||
! store metablock data
|
||||
!
|
||||
call write_binary_xml(trim(dname), 'metablock_fields.bin', &
|
||||
write(fname,"(a,'.bin')") "metablock_fields"
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(fields, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "fields", digest_string)
|
||||
call write_attribute_xml(lun, "fields", trim(fname), bytes, digest)
|
||||
|
||||
call write_binary_xml(trim(dname), 'metablock_children.bin', &
|
||||
write(fname,"(a,'.bin')") "metablock_children"
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(children, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "children", digest_string)
|
||||
call write_attribute_xml(lun, "children", trim(fname), bytes, digest)
|
||||
|
||||
#if NDIMS == 3
|
||||
call write_binary_xml(trim(dname), 'metablock_faces.bin', &
|
||||
write(fname,"(a,'.bin')") "metablock_faces"
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(faces, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "faces", digest_string)
|
||||
call write_attribute_xml(lun, "faces", trim(fname), bytes, digest)
|
||||
#endif /* NDIMS == 3 */
|
||||
|
||||
call write_binary_xml(trim(dname), 'metablock_edges.bin', &
|
||||
write(fname,"(a,'.bin')") "metablock_edges"
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(edges, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "edges", digest_string)
|
||||
call write_attribute_xml(lun, "edges", trim(fname), bytes, digest)
|
||||
|
||||
call write_binary_xml(trim(dname), 'metablock_corners.bin', &
|
||||
write(fname,"(a,'.bin')") "metablock_corners"
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(corners, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "corners", digest_string)
|
||||
call write_attribute_xml(lun, "corners", trim(fname), bytes, digest)
|
||||
|
||||
call write_binary_xml(trim(dname), 'metablock_bounds.bin', &
|
||||
write(fname,"(a,'.bin')") "metablock_bounds"
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(bounds, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "bounds", digest_string)
|
||||
call write_attribute_xml(lun, "bounds", trim(fname), bytes, digest)
|
||||
|
||||
if (nmodes > 0) then
|
||||
call write_binary_xml(trim(dname), 'forcing_coefficients.bin', &
|
||||
write(fname,"(a,'.bin')") "forcing_coefficients"
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(fcoefs, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "forcing", digest_string)
|
||||
call write_attribute_xml(lun, "forcing", trim(fname), bytes, digest)
|
||||
end if
|
||||
|
||||
if (allocated(fields)) deallocate(fields)
|
||||
@ -2270,7 +2269,7 @@ module io
|
||||
end if ! allocation
|
||||
#if NDIMS == 3
|
||||
#endif /* NDIMS == 3 */
|
||||
write(lun,"(a)") '</Hashes>'
|
||||
write(lun,"(a)") '</BinaryFiles>'
|
||||
write(lun,"(a)") '</AMUNFile>'
|
||||
close(lun)
|
||||
|
||||
@ -2298,7 +2297,7 @@ module io
|
||||
call write_attribute_xml(lun, "gentype", gentype)
|
||||
call write_attribute_xml(lun, "nseeds" , nseeds)
|
||||
write(lun,"(a)") '</Random>'
|
||||
write(lun,"(a)") '<Hashes>'
|
||||
write(lun,"(a)") '<BinaryFiles>'
|
||||
|
||||
if (nd > 0) then
|
||||
|
||||
@ -2331,14 +2330,12 @@ module io
|
||||
write(fname,"(a,'_',a,'_',i6.6,'.bin')") "datablock", "ids", nproc
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(ids, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "ids", digest_string)
|
||||
call write_attribute_xml(lun, "ids", trim(fname), bytes, digest)
|
||||
|
||||
write(fname,"(a,'_',a,'_',i6.6,'.bin')") "datablock", "arrays", nproc
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(arrays, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "arrays", digest_string)
|
||||
call write_attribute_xml(lun, "arrays", trim(fname), bytes, digest)
|
||||
|
||||
if (allocated(ids)) deallocate(ids)
|
||||
if (allocated(arrays)) deallocate(arrays)
|
||||
@ -2365,8 +2362,7 @@ module io
|
||||
write(fname,"(a,'_',a,'_',i6.6,'.bin')") "random", "seeds", nproc
|
||||
call write_binary_xml(trim(dname), trim(fname), &
|
||||
transfer(seeds, [ 0_1 ]), bytes, digest)
|
||||
write(digest_string,"('xxh64:', 1z0.16)") digest
|
||||
call write_attribute_xml(lun, "seeds", digest_string)
|
||||
call write_attribute_xml(lun, "seeds", trim(fname), bytes, digest)
|
||||
|
||||
if (allocated(seeds)) deallocate(seeds)
|
||||
|
||||
@ -2379,7 +2375,7 @@ module io
|
||||
|
||||
end if
|
||||
|
||||
write(lun,"(a)") '</Hashes>'
|
||||
write(lun,"(a)") '</BinaryFiles>'
|
||||
write(lun,"(a)") '</AMUNFile>'
|
||||
close(lun)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user