1111module fnet_netstat
1212
1313 use h5lt
14- use hdf5
1514
1615 use dftbp_message, only : error
1716 use dftbp_charmanip, only : i2c, tolower
@@ -46,9 +45,6 @@ subroutine createNetstat(fname)
4645 ! ! auxiliary variable
4746 integer :: iErr
4847
49- ! open the hdf5 interface
50- call h5open_f(iErr)
51-
5248 ! create the netstat file
5349 call h5fcreate_f(fname, H5F_ACC_TRUNC_F, file_id, iErr)
5450
@@ -61,9 +57,6 @@ subroutine createNetstat(fname)
6157 ! close the netstat file
6258 call h5fclose_f(file_id, iErr)
6359
64- ! close the hdf5 interface
65- call h5close_f(iErr)
66-
6760 end subroutine createNetstat
6861
6962
@@ -82,9 +75,6 @@ subroutine inquireExtFeatures(fname, tExtFeatures)
8275 ! ! auxiliary variables
8376 integer :: iErr, tExist, tmp(1 )
8477
85- ! open the hdf5 interface
86- call h5open_f(iErr)
87-
8878 ! open the netstat file
8979 call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)
9080
@@ -116,9 +106,6 @@ subroutine inquireExtFeatures(fname, tExtFeatures)
116106 ! close the netstat file
117107 call h5fclose_f(file_id, iErr)
118108
119- ! close the hdf5 interface
120- call h5close_f(iErr)
121-
122109 end subroutine inquireExtFeatures
123110
124111
@@ -138,9 +125,6 @@ subroutine inquireAcsf(fname, tAcsf)
138125 character (len= 100 ) :: tmpStr
139126 integer :: iErr, tExist
140127
141- ! open the hdf5 interface
142- call h5open_f(iErr)
143-
144128 ! open the netstat file
145129 call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)
146130
@@ -172,9 +156,6 @@ subroutine inquireAcsf(fname, tAcsf)
172156 ! close the netstat file
173157 call h5fclose_f(file_id, iErr)
174158
175- ! close the hdf5 interface
176- call h5close_f(iErr)
177-
178159 end subroutine inquireAcsf
179160
180161
@@ -193,9 +174,6 @@ subroutine readExtFeaturesConfig(fname, ext)
193174 ! ! auxiliary variables
194175 integer :: iErr, tExist, tmp(1 )
195176
196- ! open the hdf5 interface
197- call h5open_f(iErr)
198-
199177 ! open the netstat file
200178 call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)
201179
@@ -230,9 +208,6 @@ subroutine readExtFeaturesConfig(fname, ext)
230208 ! close the netstat file
231209 call h5fclose_f(file_id, iErr)
232210
233- ! close the hdf5 interface
234- call h5close_f(iErr)
235-
236211 end subroutine readExtFeaturesConfig
237212
238213
@@ -273,9 +248,6 @@ subroutine readSubnetArchitecture(fname, type, activation, topology)
273248 ! currently only the BPNN topology is supported
274249 type = ' bpnn'
275250
276- ! open the hdf5 interface
277- call h5open_f(iErr)
278-
279251 ! open the netstat file
280252 call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)
281253
@@ -333,9 +305,6 @@ subroutine readSubnetArchitecture(fname, type, activation, topology)
333305 ! close the netstat file
334306 call h5fclose_f(file_id, iErr)
335307
336- ! close the hdf5 interface
337- call h5close_f(iErr)
338-
339308 end subroutine readSubnetArchitecture
340309
341310
@@ -364,9 +333,6 @@ subroutine writeBpnnHeader(fname, bpnn, nGlobalTargets, nAtomicTargets)
364333 integer (hsize_t) :: dims(1 )
365334 integer :: iErr, iNet, iLayer
366335
367- ! open the hdf5 interface
368- call h5open_f(iErr)
369-
370336 ! open the netstat file
371337 call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr)
372338
@@ -433,9 +399,6 @@ subroutine writeBpnnHeader(fname, bpnn, nGlobalTargets, nAtomicTargets)
433399 ! close the netstat file
434400 call h5fclose_f(file_id, iErr)
435401
436- ! close the hdf5 interface
437- call h5close_f(iErr)
438-
439402 end subroutine writeBpnnHeader
440403
441404
@@ -455,9 +418,6 @@ subroutine writeExtFeaturesConfig(fname, ext)
455418 integer (hsize_t) :: dim
456419 integer :: iErr, tExist
457420
458- ! open the hdf5 interface
459- call h5open_f(iErr)
460-
461421 ! open the netstat file
462422 call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr)
463423
@@ -490,9 +450,6 @@ subroutine writeExtFeaturesConfig(fname, ext)
490450 ! close the netstat file
491451 call h5fclose_f(file_id, iErr)
492452
493- ! close the hdf5 interface
494- call h5close_f(iErr)
495-
496453 end subroutine writeExtFeaturesConfig
497454
498455end module fnet_netstat
0 commit comments