diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index 6f45516e6..88b8d960d 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -1831,6 +1831,21 @@ subroutine initialize_write(dset_id, filespace_id, memspace_id, plist_id, & call h5pclose_f(dcpl , hdferr) if(hdferr < 0) error stop 'HDF5 error' + contains + !------------------------------------------------------------------------------------------------ + !> @brief determine chunk layout + !------------------------------------------------------------------------------------------------ + pure function getChunks(totalShape,chunkSize) + + integer(HSIZE_T), dimension(:), intent(in) :: totalShape + integer(HSIZE_T), intent(in) :: chunkSize + integer(HSIZE_T), dimension(size(totalShape)) :: getChunks + + getChunks = [totalShape(1:size(totalShape)-1),& + chunkSize/product(totalShape(1:size(totalShape)-1))] + + end function getChunks + end subroutine initialize_write @@ -1854,18 +1869,4 @@ subroutine finalize_write(plist_id, dset_id, filespace_id, memspace_id) end subroutine finalize_write -!-------------------------------------------------------------------------------------------------- -!> @brief determine chunk layout -!-------------------------------------------------------------------------------------------------- -pure function getChunks(totalShape,chunkSize) - - integer(HSIZE_T), dimension(:), intent(in) :: totalShape - integer(HSIZE_T), intent(in) :: chunkSize - integer(HSIZE_T), dimension(size(totalShape)) :: getChunks - - getChunks = [totalShape(1:size(totalShape)-1),& - chunkSize/product(totalShape(1:size(totalShape)-1))] - -end function getChunks - end module HDF5_Utilities diff --git a/src/material.f90 b/src/material.f90 index 94548e052..223ea6ed8 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -403,7 +403,7 @@ function getKeys(dict) temp(i) = dict%getKey(i) l = max(len_trim(temp(i)),l) enddo - + allocate(character(l)::getKeys(dict%length)) do i=1, dict%length getKeys(i) = trim(temp(i))