@@ -184,42 +184,49 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel)
184
184
logical , intent (in ), optional :: parallel
185
185
186
186
character :: m
187
- integer (HID_T) :: plist_id
187
+ integer (HID_T) :: p_access,p_create
188
188
integer :: hdferr
189
189
logical :: exist
190
190
191
191
192
192
m = misc_optional(mode,' r' )
193
193
194
- call H5Pcreate_f(H5P_FILE_ACCESS_F, plist_id, hdferr)
194
+ call H5Pcreate_f(H5P_FILE_CREATE_F, p_create, hdferr)
195
+ call HDF5_chkerr(hdferr)
196
+ call H5Pset_link_creation_order_f(p_create, ior (H5P_CRT_ORDER_INDEXED_F,H5P_CRT_ORDER_TRACKED_F), hdferr)
195
197
call HDF5_chkerr(hdferr)
196
198
199
+ call H5Pcreate_f(H5P_FILE_ACCESS_F, p_access, hdferr)
200
+ call HDF5_chkerr(hdferr)
197
201
#ifdef PETSC
198
202
if (misc_optional(parallel,.true. )) &
199
203
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY)
200
- call H5Pset_fapl_mpio_f(plist_id , PETSC_COMM_WORLD, MPI_INFO_NULL_F90, hdferr)
204
+ call H5Pset_fapl_mpio_f(p_access , PETSC_COMM_WORLD, MPI_INFO_NULL_F90, hdferr)
201
205
#else
202
- call H5Pset_fapl_mpio_f(plist_id , PETSC_COMM_WORLD, MPI_INFO_NULL, hdferr)
206
+ call H5Pset_fapl_mpio_f(p_access , PETSC_COMM_WORLD, MPI_INFO_NULL, hdferr)
203
207
#endif
204
208
call HDF5_chkerr(hdferr)
205
209
#endif
206
210
207
211
if (m == ' w' ) then
208
- call H5Fcreate_f(fileName,H5F_ACC_TRUNC_F,HDF5_openFile,hdferr,access_prp = plist_id)
212
+ call H5Fcreate_f(fileName,H5F_ACC_TRUNC_F,HDF5_openFile,hdferr,&
213
+ access_prp= p_access,creation_prp= p_create)
209
214
call HDF5_chkerr(hdferr)
210
215
elseif (m == ' a' ) then
211
- call H5Fopen_f(fileName,H5F_ACC_RDWR_F,HDF5_openFile,hdferr,access_prp = plist_id )
216
+ call H5Fopen_f(fileName,H5F_ACC_RDWR_F,HDF5_openFile,hdferr,access_prp= p_access )
212
217
call HDF5_chkerr(hdferr)
213
218
elseif (m == ' r' ) then
214
219
inquire (file= fileName,exist= exist)
215
220
if (.not. exist) call IO_error(100 ,trim (fileName))
216
- call H5Fopen_f(fileName,H5F_ACC_RDONLY_F,HDF5_openFile,hdferr,access_prp = plist_id )
221
+ call H5Fopen_f(fileName,H5F_ACC_RDONLY_F,HDF5_openFile,hdferr,access_prp= p_access )
217
222
call HDF5_chkerr(hdferr)
218
223
else
219
224
error stop ' unknown access mode'
220
225
end if
221
226
222
- call H5Pclose_f(plist_id, hdferr)
227
+ call H5Pclose_f(p_access, hdferr)
228
+ call HDF5_chkerr(hdferr)
229
+ call H5Pclose_f(p_create, hdferr)
223
230
call HDF5_chkerr(hdferr)
224
231
225
232
end function HDF5_openFile
0 commit comments