Skip to content

Commit

Permalink
comment debug statements, add fletcher32
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 15, 2020
1 parent bebf066 commit 71b2a2f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
project(h5fortran
LANGUAGES C Fortran
VERSION 2.8.1
VERSION 2.8.2
DESCRIPTION "thin, light, easy HDF5 Fortran interface"
HOMEPAGE_URL https://github.com/scivision/h5fortran)
enable_testing()
Expand Down
8 changes: 0 additions & 8 deletions cmake/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ set(HDF5_USE_STATIC_LIBRARIES true)
if(WIN32 AND CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
set(HDF5_NO_FIND_PACKAGE_CONFIG_FILE true)
set(HDF5_USE_STATIC_LIBRARIES false)

if(NOT HDF5_ROOT)
# help CMake find binary HDF5
file(GLOB _h5guess "c:/Program Files/HDF_Group/HDF5/1.1*/")
if(EXISTS ${_h5guess})
set(HDF5_ROOT ${_h5guess})
endif()
endif()
endif()

find_package(HDF5 COMPONENTS Fortran HL)
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('h5fortran', 'fortran',
meson_version : '>=0.52.0',
version : '2.8.1',
version : '2.8.2',
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])

subdir('meson')
Expand Down
8 changes: 6 additions & 2 deletions src/write.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use hdf5, only: &
h5screate_f, H5S_SCALAR_F, &
h5dcreate_f, &
h5pset_chunk_f, h5pset_deflate_f, h5pset_shuffle_f, h5pcreate_f, H5P_DATASET_CREATE_F, h5pclose_f, &
h5pset_chunk_f, h5pset_deflate_f, h5pset_shuffle_f, h5pset_fletcher32_f, h5pcreate_f, H5P_DATASET_CREATE_F, h5pclose_f, &
h5gopen_f, h5gclose_f

use H5LT, only: h5ltpath_valid_f, h5ltset_attribute_string_f, h5ltmake_dataset_string_f
Expand Down Expand Up @@ -125,6 +125,9 @@ subroutine hdf_set_deflate(self, dims, pid, ierr, chunk_size)
call h5pset_shuffle_f(pid, ierr)
if (check(ierr, 'ERROR: enable Shuffle ' // self%filename)) return

call h5pset_fletcher32_f(pid, ierr)
if (check(ierr, 'ERROR: enable Fletcher32 checksum ' // self%filename)) return

call h5pset_deflate_f(pid, self%comp_lvl, ierr)
if (check(ierr, 'ERROR: enable Deflate compression ' // self%filename)) return

Expand Down Expand Up @@ -158,7 +161,8 @@ subroutine guess_chunk_size(dims, chunk_size)
dset_size = product(chunk_size) * TYPESIZE
target_size = int(CHUNK_BASE * (2**log10(real(dset_size) / 1e6)), hsize_t)
if (target_size > CHUNK_MAX) target_size = CHUNK_MAX
print *,'target_size [bytes]: ',target_size

! print *,'target_size [bytes]: ',target_size

i = 0
do
Expand Down

0 comments on commit 71b2a2f

Please sign in to comment.