Skip to content

Commit

Permalink
Add support for HDF5 1.14.x
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderhe committed Dec 6, 2024
1 parent f7b64f1 commit 7948642
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 113 deletions.
13 changes: 0 additions & 13 deletions prog/fortnet/lib_descriptors/acsf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module fnet_acsf

use h5lt
use hdf5

use dftbp_accuracy, only : dp
use dftbp_message, only : error
Expand Down Expand Up @@ -1780,9 +1779,6 @@ subroutine TAcsf_toFile(this, fname)
!! auxiliary variables
integer :: iFunc, iErr, tmp, tExist

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr)

Expand Down Expand Up @@ -1905,9 +1901,6 @@ subroutine TAcsf_toFile(this, fname)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine TAcsf_toFile


Expand Down Expand Up @@ -1944,9 +1937,6 @@ subroutine TAcsf_fromFile(this, fname, tReduce, tStandardize, nRadial, nAngular)
real(dp), allocatable :: tmpRealArray1d(:)
integer :: iFunc, iErr, tExist, tmpInt(1)

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -2118,9 +2108,6 @@ subroutine TAcsf_fromFile(this, fname, tReduce, tStandardize, nRadial, nAngular)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

nRadial = 0
nAngular = 0
allocate(tmpAtomicNumbers(0))
Expand Down
2 changes: 1 addition & 1 deletion prog/fortnet/lib_fortnet/initprogram.F90
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ subroutine readDriverBlock(driver, analysis, driverNode, parent)

type(fnode), pointer :: child, child2, child3, child4, value1, field

type(string) :: buffer, buffer2, modifier
type(string) :: buffer, buffer2

!! string buffer instance
type(string) :: strBuffer
Expand Down
25 changes: 0 additions & 25 deletions prog/fortnet/lib_io/fnetdata.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module fnet_fnetdata

use h5lt
use hdf5

use dftbp_assert
use dftbp_accuracy, only: dp, mc
Expand Down Expand Up @@ -557,9 +556,6 @@ subroutine inquireStructures(fname, tStructures)
!! auxiliary variable
integer :: iErr

! open the hdf5 interface
call h5open_f(iErr)

! open the dataset file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand All @@ -573,9 +569,6 @@ subroutine inquireStructures(fname, tStructures)
! close the dataset file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine inquireStructures


Expand Down Expand Up @@ -606,9 +599,6 @@ subroutine inquireTargets(fname, tGlobalTargets, tAtomicTargets, nGlobalTargets,
!! auxiliary variables
integer :: iErr

! open the hdf5 interface
call h5open_f(iErr)

! open the dataset file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -639,9 +629,6 @@ subroutine inquireTargets(fname, tGlobalTargets, tAtomicTargets, nGlobalTargets,
! close the dataset file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine inquireTargets


Expand All @@ -666,9 +653,6 @@ subroutine inquireExtFeatures(fname, tFeatures, nFeatures)
!! auxiliary variables
integer :: iErr

! open the hdf5 interface
call h5open_f(iErr)

! open the dataset file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand All @@ -687,9 +671,6 @@ subroutine inquireExtFeatures(fname, tFeatures, nFeatures)
! close the dataset file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine inquireExtFeatures


Expand Down Expand Up @@ -1033,9 +1014,6 @@ subroutine readHdfDataset(fname, dataset)
!! auxiliary variables
integer :: iErr, iDatapoint, tExist

! open the hdf5 interface
call h5open_f(iErr)

! open the dataset file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -1232,9 +1210,6 @@ subroutine readHdfDataset(fname, dataset)
! close the dataset file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

! perform some basic consistency checks
call dataset%checkConsistency()

Expand Down
7 changes: 0 additions & 7 deletions prog/fortnet/lib_io/fnetout.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module fnet_fnetout

use h5lt
use hdf5

use dftbp_message, only : error
use dftbp_accuracy, only: dp
Expand Down Expand Up @@ -75,9 +74,6 @@ subroutine writeFnetout(fname, mode, globalTargets, atomicTargets, output, force
call error('Validation mode only valid in combination with target data.')
end if

! open the hdf5 interface
call h5open_f(iErr)

! create the fnetout file
call h5fcreate_f(fname, H5F_ACC_TRUNC_F, file_id, iErr)

Expand Down Expand Up @@ -159,9 +155,6 @@ subroutine writeFnetout(fname, mode, globalTargets, atomicTargets, output, force
! close the fnetout file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine writeFnetout

end module fnet_fnetout
43 changes: 0 additions & 43 deletions prog/fortnet/lib_io/netstat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module fnet_netstat

use h5lt
use hdf5

use dftbp_message, only : error
use dftbp_charmanip, only : i2c, tolower
Expand Down Expand Up @@ -46,9 +45,6 @@ subroutine createNetstat(fname)
!! auxiliary variable
integer :: iErr

! open the hdf5 interface
call h5open_f(iErr)

! create the netstat file
call h5fcreate_f(fname, H5F_ACC_TRUNC_F, file_id, iErr)

Expand All @@ -61,9 +57,6 @@ subroutine createNetstat(fname)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine createNetstat


Expand All @@ -82,9 +75,6 @@ subroutine inquireExtFeatures(fname, tExtFeatures)
!! auxiliary variables
integer :: iErr, tExist, tmp(1)

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -116,9 +106,6 @@ subroutine inquireExtFeatures(fname, tExtFeatures)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine inquireExtFeatures


Expand All @@ -138,9 +125,6 @@ subroutine inquireAcsf(fname, tAcsf)
character(len=100) :: tmpStr
integer :: iErr, tExist

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -172,9 +156,6 @@ subroutine inquireAcsf(fname, tAcsf)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine inquireAcsf


Expand All @@ -193,9 +174,6 @@ subroutine readExtFeaturesConfig(fname, ext)
!! auxiliary variables
integer :: iErr, tExist, tmp(1)

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -230,9 +208,6 @@ subroutine readExtFeaturesConfig(fname, ext)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine readExtFeaturesConfig


Expand Down Expand Up @@ -273,9 +248,6 @@ subroutine readSubnetArchitecture(fname, type, activation, topology)
! currently only the BPNN topology is supported
type = 'bpnn'

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -333,9 +305,6 @@ subroutine readSubnetArchitecture(fname, type, activation, topology)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine readSubnetArchitecture


Expand Down Expand Up @@ -364,9 +333,6 @@ subroutine writeBpnnHeader(fname, bpnn, nGlobalTargets, nAtomicTargets)
integer(hsize_t) :: dims(1)
integer :: iErr, iNet, iLayer

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr)

Expand Down Expand Up @@ -433,9 +399,6 @@ subroutine writeBpnnHeader(fname, bpnn, nGlobalTargets, nAtomicTargets)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine writeBpnnHeader


Expand All @@ -455,9 +418,6 @@ subroutine writeExtFeaturesConfig(fname, ext)
integer(hsize_t) :: dim
integer :: iErr, tExist

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr)

Expand Down Expand Up @@ -490,9 +450,6 @@ subroutine writeExtFeaturesConfig(fname, ext)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine writeExtFeaturesConfig

end module fnet_netstat
13 changes: 0 additions & 13 deletions prog/fortnet/lib_nn/bpnn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module fnet_bpnn

use h5lt
use hdf5

use dftbp_message, only : error
use dftbp_globalenv, only : stdOut
Expand Down Expand Up @@ -1077,9 +1076,6 @@ subroutine TBpnn_toFile(this, fname)
!! auxiliary variables
integer :: iErr, iNet, iLayer, tExist

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDWR_F, file_id, iErr)

Expand Down Expand Up @@ -1138,9 +1134,6 @@ subroutine TBpnn_toFile(this, fname)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine TBpnn_toFile


Expand Down Expand Up @@ -1181,9 +1174,6 @@ subroutine TBpnn_fromFile(this, fname)
!! auxiliary variables
integer :: iErr, iNet, iLayer

! open the hdf5 interface
call h5open_f(iErr)

! open the netstat file
call h5fopen_f(fname, H5F_ACC_RDONLY_F, file_id, iErr)

Expand Down Expand Up @@ -1295,9 +1285,6 @@ subroutine TBpnn_fromFile(this, fname)
! close the netstat file
call h5fclose_f(file_id, iErr)

! close the hdf5 interface
call h5close_f(iErr)

end subroutine TBpnn_fromFile

end module fnet_bpnn
Loading

0 comments on commit 7948642

Please sign in to comment.