mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Get rid of most of hdf5_initialize (no longer needed)
This commit is contained in:
parent
73b50e1e17
commit
d8c30b7f62
3 changed files with 5 additions and 47 deletions
|
|
@ -2,7 +2,7 @@ module openmc_api
|
|||
|
||||
use, intrinsic :: ISO_C_BINDING
|
||||
|
||||
use hdf5, only: HID_T, h5tclose_f, h5close_f
|
||||
use hdf5, only: h5close_f
|
||||
|
||||
use bank_header, only: openmc_source_bank
|
||||
use constants, only: K_BOLTZMANN
|
||||
|
|
@ -169,9 +169,6 @@ contains
|
|||
! Deallocate arrays
|
||||
call free_memory()
|
||||
|
||||
! Release compound datatypes
|
||||
call h5tclose_f(hdf5_bank_t, err)
|
||||
|
||||
! Close FORTRAN interface.
|
||||
call h5close_f(err)
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@ module hdf5_interface
|
|||
implicit none
|
||||
private
|
||||
|
||||
integer(HID_T), public :: hdf5_bank_t ! Compound type for Bank
|
||||
integer(HID_T), public :: hdf5_integer8_t ! type for integer(8)
|
||||
|
||||
interface write_dataset
|
||||
module procedure write_double_0D
|
||||
module procedure write_double_1D
|
||||
|
|
|
|||
|
|
@ -13,8 +13,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, &
|
||||
hdf5_bank_t, hdf5_integer8_t
|
||||
use hdf5_interface, only: file_open, read_attribute, file_close
|
||||
use input_xml, only: read_input_xml
|
||||
use material_header, only: Material
|
||||
use message_passing
|
||||
|
|
@ -45,6 +44,7 @@ contains
|
|||
integer, intent(in), optional :: intracomm ! MPI intracommunicator
|
||||
integer(C_INT) :: err
|
||||
|
||||
integer :: hdf5_err
|
||||
#ifdef _OPENMP
|
||||
character(MAX_WORD_LEN) :: envvar
|
||||
#endif
|
||||
|
|
@ -87,8 +87,8 @@ contains
|
|||
end if
|
||||
#endif
|
||||
|
||||
! Initialize HDF5 interface
|
||||
call hdf5_initialize()
|
||||
! Initialize HDF5 Fortran interface.
|
||||
call h5open_f(hdf5_err)
|
||||
|
||||
! Read command line arguments
|
||||
call read_command_line()
|
||||
|
|
@ -160,42 +160,6 @@ contains
|
|||
end subroutine initialize_mpi
|
||||
#endif
|
||||
|
||||
!===============================================================================
|
||||
! HDF5_INITIALIZE
|
||||
!===============================================================================
|
||||
|
||||
subroutine hdf5_initialize()
|
||||
|
||||
type(Bank), target :: tmpb(2) ! temporary Bank
|
||||
integer :: hdf5_err
|
||||
integer(HID_T) :: coordinates_t ! HDF5 type for 3 reals
|
||||
integer(HSIZE_T) :: dims(1) = (/3/) ! size of coordinates
|
||||
|
||||
! Initialize FORTRAN interface.
|
||||
call h5open_f(hdf5_err)
|
||||
|
||||
! Create compound type for xyz and uvw
|
||||
call h5tarray_create_f(H5T_NATIVE_DOUBLE, 1, dims, coordinates_t, hdf5_err)
|
||||
|
||||
! Create the compound datatype for Bank
|
||||
call h5tcreate_f(H5T_COMPOUND_F, h5offsetof(c_loc(tmpb(1)), &
|
||||
c_loc(tmpb(2))), hdf5_bank_t, hdf5_err)
|
||||
call h5tinsert_f(hdf5_bank_t, "wgt", h5offsetof(c_loc(tmpb(1)), &
|
||||
c_loc(tmpb(1)%wgt)), H5T_NATIVE_DOUBLE, hdf5_err)
|
||||
call h5tinsert_f(hdf5_bank_t, "xyz", h5offsetof(c_loc(tmpb(1)), &
|
||||
c_loc(tmpb(1)%xyz)), coordinates_t, hdf5_err)
|
||||
call h5tinsert_f(hdf5_bank_t, "uvw", h5offsetof(c_loc(tmpb(1)), &
|
||||
c_loc(tmpb(1)%uvw)), coordinates_t, hdf5_err)
|
||||
call h5tinsert_f(hdf5_bank_t, "E", h5offsetof(c_loc(tmpb(1)), &
|
||||
c_loc(tmpb(1)%E)), H5T_NATIVE_DOUBLE, hdf5_err)
|
||||
call h5tinsert_f(hdf5_bank_t, "delayed_group", h5offsetof(c_loc(tmpb(1)), &
|
||||
c_loc(tmpb(1)%delayed_group)), H5T_NATIVE_INTEGER, hdf5_err)
|
||||
|
||||
! Determine type for integer(8)
|
||||
hdf5_integer8_t = h5kind_to_type(8, H5_INTEGER_KIND)
|
||||
|
||||
end subroutine hdf5_initialize
|
||||
|
||||
!===============================================================================
|
||||
! READ_COMMAND_LINE reads all parameters from the command line
|
||||
!===============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue