@@ -194,6 +194,7 @@ module manager_hdf5
194194 interface h5_read_dataset_collect_hyperslab
195195 module procedure h5_read_dataset_1d_l_collect_hyperslab ! logical
196196 module procedure h5_read_dataset_1d_i_collect_hyperslab ! integer
197+ module procedure h5_read_dataset_1d_i64_collect_hyperslab ! integer 64-bit
197198 module procedure h5_read_dataset_2d_i_collect_hyperslab
198199 module procedure h5_read_dataset_3d_i_collect_hyperslab
199200 module procedure h5_read_dataset_4d_i_collect_hyperslab
@@ -2605,7 +2606,60 @@ subroutine h5_read_dataset_1d_i_collect_hyperslab(dataset_name, data, offset_in,
26052606 call h5_close_dataset()
26062607 end subroutine h5_read_dataset_1d_i_collect_hyperslab
26072608
2609+ !
2610+ !- ------------------------------------------------------------------------------
26082611!
2612+
2613+ subroutine h5_read_dataset_1d_i64_collect_hyperslab (dataset_name , data , offset_in , if_collective )
2614+ implicit none
2615+ character (len=* ), intent (in ) :: dataset_name
2616+ integer , dimension (:), intent (inout ), target :: data
2617+ integer (kind= 8 ), dimension (:), intent (in ) :: offset_in
2618+ logical , intent (in ) :: if_collective
2619+ ! local parameters
2620+ integer :: rank = 1
2621+ integer (HSIZE_T), dimension (1 ) :: dim
2622+ integer (HSIZE_T), dimension (1 ) :: count ! size of hyperslab
2623+ integer (HSSIZE_T), dimension (1 ) :: offset ! the position where the datablock is inserted
2624+
2625+ dim = shape (data )
2626+ offset = offset_in ! convert data type
2627+
2628+ ! open dataset
2629+ call h5_open_dataset2(trim (dataset_name))
2630+
2631+ ! select a place where data is inserted.
2632+ count (1 ) = dim (1 )
2633+
2634+ ! select hyperslab in the file
2635+ call h5screate_simple_f(rank,count, mem_dspace_id, error)
2636+ call check_error()
2637+ call h5dget_space_f(dataset_id, file_dspace_id, error)
2638+ call check_error()
2639+ call h5sselect_hyperslab_f(file_dspace_id, H5S_SELECT_SET_F, offset, count, error)
2640+ call check_error()
2641+ call h5_create_dataset_prop_list(if_collective)
2642+
2643+ call h5_check_arr_dim(dim)
2644+
2645+ ! write array using Fortran pointer
2646+ ! call h5dread_f(dataset_id, H5T_NATIVE_INTEGER, data, dim, error, &
2647+ ! file_space_id=file_dspace_id, mem_space_id=mem_dspace_id, xfer_prp=plist_id)
2648+ ! use F2003 API
2649+ f_ptr = c_loc(data (1 ))
2650+ call h5dread_f(dataset_id, H5T_NATIVE_INTEGER, f_ptr, error, &
2651+ file_space_id= file_dspace_id, mem_space_id= mem_dspace_id, xfer_prp= plist_id)
2652+ if (error /= 0 ) write (* ,* ) ' hdf5 dataset write failed for ' , dataset_name
2653+ call check_error()
2654+ call h5_close_prop_list(dataset_name)
2655+ call h5sclose_f(mem_dspace_id, error)
2656+ call check_error()
2657+ call h5sclose_f(file_dspace_id, error)
2658+ call check_error()
2659+ call h5_close_dataset()
2660+ end subroutine h5_read_dataset_1d_i64_collect_hyperslab
2661+
2662+
26092663!- ------------------------------------------------------------------------------
26102664!
26112665
0 commit comments