From 56ec194862ff5f9f764503b84f73aa22e9e0bf61 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Fri, 9 Feb 2018 15:25:39 -0200 Subject: [PATCH] IO: Store block IDs in coordinate group. Block IDs might be useful for block diagnostic purposes. Signed-off-by: Grzegorz Kowal --- src/io.F90 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/io.F90 b/src/io.F90 index f06669f..add981f 100644 --- a/src/io.F90 +++ b/src/io.F90 @@ -2653,7 +2653,7 @@ module io ! local allocatable arrays ! - integer(kind=4), dimension(:) , allocatable :: lev, ref + integer(kind=4), dimension(:) , allocatable :: ids, lev, ref integer(kind=4), dimension(:,:) , allocatable :: cor real (kind=8), dimension(:,:,:), allocatable :: bnd @@ -2688,6 +2688,7 @@ module io ! allocate arrays to store coordinates ! + allocate(ids(cm(1))) allocate(lev(cm(1))) allocate(ref(cm(1))) allocate(cor(cm(1),cm(2))) @@ -2699,6 +2700,10 @@ module io pdata => list_data do while(associated(pdata)) +! fill in the IDs array +! + ids(l) = pdata%meta%id + ! fill in the level array ! lev(l) = pdata%meta%level @@ -2728,6 +2733,7 @@ module io ! write the arrays to the HDF5 file ! + call write_array(gid, 'ids' , cm(1), ids) call write_array(gid, 'levels', cm(1), lev) call write_array(gid, 'refine', cm(1), ref) call write_array(gid, 'coords', cm(:), cor) @@ -2738,6 +2744,7 @@ module io ! deallocate temporary arrays ! + if (allocated(ids)) deallocate(ids) if (allocated(lev)) deallocate(lev) if (allocated(ref)) deallocate(ref) if (allocated(cor)) deallocate(cor)