Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_k_hdf5_par_read_array.F90
Go to the documentation of this file.
1 integer(hid_t) :: plist_id
2 integer(hid_t) :: dset_id
3 integer(hid_t) :: memspace
4 integer(hid_t) :: filespace
5 integer(hsize_t) :: dimsfi(dspace_dims)
6 integer(hsize_t) :: block(dspace_dims)
7 integer(hsize_t) :: start(dspace_dims)
8 integer(hsize_t) :: count(dspace_dims)
9 integer(hsize_t) :: stride(dspace_dims)
10 sll_int32 :: rank
11 
12 ! Basic dataset parameters
13 rank = dspace_dims
14 count = 1
15 stride = 1
16 
17 ! Integer kind type conversions
18 dimsfi = int(global_size, hsize_t)
19 block = int(shape(array), hsize_t)
20 start = int(offset, hsize_t)
21 
22 !
23 ! Create dataspaces ('file space' and 'memory space').
24 !
25 call h5screate_simple_f(rank, global_size, filespace, error)
26 sll_assert_always(error == 0)
27 
28 call h5screate_simple_f(rank, block, memspace, error)
29 sll_assert_always(error == 0)
30 
31 !
32 ! Open dataset.
33 !
34 call h5pcreate_f(h5p_dataset_create_f, plist_id, error)
35 sll_assert_always(error == 0)
36 
37 ! call h5pset_chunk_f( plist_id, rank, block, error )
38 ! SLL_ASSERT_ALWAYS(error==0)
39 
40 call h5dopen_f(handle%file_id, dsetname, dset_id, error)
41 sll_assert_always(error == 0)
42 
43 call h5pclose_f(plist_id, error)
44 sll_assert_always(error == 0)
45 
46 call h5sclose_f(filespace, error)
47 sll_assert_always(error == 0)
48 
49 !
50 ! Select hyperslab in the file.
51 !
52 call h5dget_space_f(dset_id, filespace, error)
53 sll_assert_always(error == 0)
54 
55 call h5sselect_hyperslab_f(filespace, h5s_select_set_f, &
56  start, count, error, stride, block)
57 sll_assert_always(error == 0)
58 
59 !
60 ! Initialize data buffer with trivial data.
61 !
62 !
63 ! Create property list for collective dataset write
64 !
65 call h5pcreate_f(h5p_dataset_xfer_f, plist_id, error)
66 sll_assert_always(error == 0)
67 
68 call h5pset_dxpl_mpio_f(plist_id, h5fd_mpio_collective_f, error)
69 sll_assert_always(error == 0)
70 
71 !
72 ! Read the dataset collectively.
73 !
74 call h5dread_f(dset_id, datatype, array, dimsfi, error, &
75  file_space_id=filespace, mem_space_id=memspace, &
76  xfer_prp=plist_id)
77 sll_assert_always(error == 0)
78 
79 !
80 ! Close the property list.
81 !
82 call h5pclose_f(plist_id, error)
83 sll_assert_always(error == 0)
84 
85 !
86 ! Close dataspaces.
87 !
88 call h5sclose_f(filespace, error)
89 sll_assert_always(error == 0)
90 
91 call h5sclose_f(memspace, error)
92 sll_assert_always(error == 0)
93 
94 !
95 ! Close the dataset.
96 !
97 call h5dclose_f(dset_id, error)
98 sll_assert_always(error == 0)
    Report Typos and Errors