Remove remaining dependencies on Fortran HDF5 interface

This commit is contained in:
Paul Romano 2018-04-24 23:03:21 -05:00
parent 3acec3c093
commit 36dc4a59b1
7 changed files with 10 additions and 26 deletions

View file

@ -70,7 +70,7 @@ if(NOT DEFINED HDF5_PREFER_PARALLEL)
endif()
endif()
find_package(HDF5 COMPONENTS Fortran_HL)
find_package(HDF5 COMPONENTS HL)
if(NOT HDF5_FOUND)
message(FATAL_ERROR "Could not find HDF5")
endif()

View file

@ -2,8 +2,6 @@ module openmc_api
use, intrinsic :: ISO_C_BINDING
use hdf5, only: h5close_f
use bank_header, only: openmc_source_bank
use constants, only: K_BOLTZMANN
use eigenvalue, only: k_sum, openmc_get_keff
@ -169,9 +167,6 @@ contains
! Deallocate arrays
call free_memory()
! Close FORTRAN interface.
call h5close_f(err)
#ifdef OPENMC_MPI
! Free all MPI types
call MPI_TYPE_FREE(MPI_BANK, err)

View file

@ -12,8 +12,6 @@ module hdf5_interface
use, intrinsic :: ISO_C_BINDING
use hdf5
use error, only: fatal_error
#ifdef PHDF5
use message_passing, only: mpi_intracomm, MPI_INFO_NULL
@ -94,7 +92,9 @@ module hdf5_interface
public :: get_groups
public :: get_datasets
public :: get_name
public :: HID_T, HSIZE_T, SIZE_T
integer, public, parameter :: HID_T = C_INT64_T
integer, public, parameter :: HSIZE_T = C_LONG_LONG
interface
function attribute_typesize(obj_id, name) result(sz) bind(C)
@ -442,9 +442,8 @@ contains
! GET_NAME Obtains the name of the current group in group_id
!===============================================================================
function get_name(object_id, name_len_) result(name)
integer(HID_T), intent(in) :: object_id
integer(SIZE_T), optional, intent(in) :: name_len_
function get_name(object_id) result(name)
integer(HID_T), intent(in) :: object_id
character(150) :: name ! name of object
character(kind=C_CHAR) :: name_(150)

View file

@ -2,7 +2,6 @@ module initialize
use, intrinsic :: ISO_C_BINDING, only: c_loc
use hdf5
#ifdef _OPENMP
use omp_lib
#endif
@ -13,7 +12,7 @@ module initialize
use error, only: fatal_error, warning, write_message
use geometry_header, only: Cell, Universe, Lattice, RectLattice, HexLattice,&
root_universe
use hdf5_interface, only: file_open, read_attribute, file_close
use hdf5_interface, only: file_open, read_attribute, file_close, HID_T
use input_xml, only: read_input_xml
use material_header, only: Material
use message_passing
@ -87,9 +86,6 @@ contains
end if
#endif
! Initialize HDF5 Fortran interface.
call h5open_f(hdf5_err)
! Read command line arguments
call read_command_line()

View file

@ -246,7 +246,6 @@ contains
type(VectorInt), intent(out) :: temps_to_read ! Temperatures to read
integer, intent(out) :: order_dim ! Scattering data order size
integer(SIZE_T) :: name_len
integer(HID_T) :: kT_group
character(MAX_WORD_LEN), allocatable :: dset_names(:)
real(8), allocatable :: temps_available(:) ! temperatures available
@ -257,8 +256,7 @@ contains
integer :: ipol, iazi
! Get name of dataset from group
name_len = len(this % name)
this % name = get_name(xs_id, name_len)
this % name = get_name(xs_id)
! Get rid of leading '/'
this % name = trim(this % name(2:))

View file

@ -290,7 +290,6 @@ contains
integer(HID_T) :: total_nu
integer(HID_T) :: fer_group ! fission_energy_release group
integer(HID_T) :: fer_dset
integer(SIZE_T) :: name_len
integer(HSIZE_T) :: j
integer(HSIZE_T) :: dims(1)
character(MAX_WORD_LEN) :: temp_str
@ -304,8 +303,7 @@ contains
type(VectorInt) :: index_inelastic_scatter
! Get name of nuclide from group
name_len = len(this % name)
this % name = get_name(group_id, name_len)
this % name = get_name(group_id)
! Get rid of leading '/'
this % name = trim(this % name(2:))

View file

@ -100,7 +100,6 @@ contains
integer :: n_energy, n_energy_out, n_mu
integer :: i_closest
integer :: n_temperature
integer(SIZE_T) :: name_len
integer(HID_T) :: T_group
integer(HID_T) :: elastic_group
integer(HID_T) :: inelastic_group
@ -120,8 +119,7 @@ contains
type(VectorInt) :: temps_to_read
! Get name of table from group
name_len = len(this % name)
this % name = get_name(group_id, name_len)
this % name = get_name(group_id)
! Get rid of leading '/'
this % name = trim(this % name(2:))