compile results module
This commit is contained in:
parent
35211a8468
commit
fb5b1bfd8e
|
@ -33,20 +33,24 @@ add_library(NUMERICS OBJECT "numerics.f90")
|
||||||
add_dependencies(NUMERICS IO)
|
add_dependencies(NUMERICS IO)
|
||||||
list(APPEND OBJECTFILES $<TARGET_OBJECTS:NUMERICS>)
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:NUMERICS>)
|
||||||
|
|
||||||
add_library(HDF5_UTILITIES OBJECT "HDF5_utilities.f90")
|
|
||||||
add_dependencies(HDF5_UTILITIES NUMERICS)
|
|
||||||
list(APPEND OBJECTFILES $<TARGET_OBJECTS:HDF5_UTILITIES>)
|
|
||||||
|
|
||||||
add_library(DEBUG OBJECT "debug.f90")
|
add_library(DEBUG OBJECT "debug.f90")
|
||||||
add_dependencies(DEBUG HDF5_UTILITIES)
|
add_dependencies(DEBUG NUMERICS)
|
||||||
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DEBUG>)
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DEBUG>)
|
||||||
|
|
||||||
add_library(DAMASK_CONFIG OBJECT "config.f90")
|
add_library(DAMASK_CONFIG OBJECT "config.f90")
|
||||||
add_dependencies(DAMASK_CONFIG DEBUG)
|
add_dependencies(DAMASK_CONFIG DEBUG)
|
||||||
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_CONFIG>)
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_CONFIG>)
|
||||||
|
|
||||||
|
add_library(HDF5_UTILITIES OBJECT "HDF5_utilities.f90")
|
||||||
|
add_dependencies(HDF5_UTILITIES DAMASK_CONFIG)
|
||||||
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:HDF5_UTILITIES>)
|
||||||
|
|
||||||
|
add_library(RESULTS OBJECT "results.f90")
|
||||||
|
add_dependencies(RESULTS HDF5_UTILITIES)
|
||||||
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:RESULTS>)
|
||||||
|
|
||||||
add_library(FEsolving OBJECT "FEsolving.f90")
|
add_library(FEsolving OBJECT "FEsolving.f90")
|
||||||
add_dependencies(FEsolving DEBUG)
|
add_dependencies(FEsolving RESULTS)
|
||||||
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEsolving>)
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEsolving>)
|
||||||
|
|
||||||
add_library(DAMASK_MATH OBJECT "math.f90")
|
add_library(DAMASK_MATH OBJECT "math.f90")
|
||||||
|
|
919
src/results.f90
919
src/results.f90
|
@ -4,7 +4,7 @@
|
||||||
!> @author Jennifer Nastola, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Jennifer Nastola, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module HDF5_Utilities
|
module results
|
||||||
use prec
|
use prec
|
||||||
use IO
|
use IO
|
||||||
use HDF5
|
use HDF5
|
||||||
|
@ -18,52 +18,9 @@ module HDF5_Utilities
|
||||||
integer(HID_T), private :: resultsFile, currentIncID, plist_id
|
integer(HID_T), private :: resultsFile, currentIncID, plist_id
|
||||||
integer(pInt), private :: currentInc
|
integer(pInt), private :: currentInc
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief reads pInt or pReal data of defined shape from file
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
interface HDF5_read
|
|
||||||
module procedure HDF5_read_pReal_1
|
|
||||||
module procedure HDF5_read_pReal_2
|
|
||||||
module procedure HDF5_read_pReal_3
|
|
||||||
module procedure HDF5_read_pReal_4
|
|
||||||
module procedure HDF5_read_pReal_5
|
|
||||||
module procedure HDF5_read_pReal_6
|
|
||||||
module procedure HDF5_read_pReal_7
|
|
||||||
|
|
||||||
module procedure HDF5_read_pInt_1
|
|
||||||
module procedure HDF5_read_pInt_2
|
|
||||||
module procedure HDF5_read_pInt_3
|
|
||||||
module procedure HDF5_read_pInt_4
|
|
||||||
module procedure HDF5_read_pInt_5
|
|
||||||
module procedure HDF5_read_pInt_6
|
|
||||||
module procedure HDF5_read_pInt_7 !ABOVE 8 DIMENSIONS IT GIVES ERROR: THE CALL TO H5DREAD_F DOESNT WORK
|
|
||||||
|
|
||||||
end interface HDF5_read
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief writes pInt or pReal data of defined shape to file
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
interface HDF5_write
|
|
||||||
module procedure HDF5_write_pReal1
|
|
||||||
module procedure HDF5_write_pReal2
|
|
||||||
module procedure HDF5_write_pReal3
|
|
||||||
module procedure HDF5_write_pReal4
|
|
||||||
module procedure HDF5_write_pReal5
|
|
||||||
module procedure HDF5_write_pReal6
|
|
||||||
module procedure HDF5_write_pReal7
|
|
||||||
|
|
||||||
module procedure HDF5_write_pInt1
|
|
||||||
module procedure HDF5_write_pInt2
|
|
||||||
module procedure HDF5_write_pInt3
|
|
||||||
module procedure HDF5_write_pInt4
|
|
||||||
module procedure HDF5_write_pInt5
|
|
||||||
module procedure HDF5_write_pInt6
|
|
||||||
module procedure HDF5_write_pInt7 !ABOVE 8 DIMENSIONS IT GIVES ERROR: THE CALL TO H5DREAD_F DOESNT WORK
|
|
||||||
|
|
||||||
end interface HDF5_write
|
|
||||||
|
|
||||||
public :: &
|
public :: &
|
||||||
HDF5_Utilities_init, &
|
results_init, &
|
||||||
HDF5_mappingPhase, &
|
HDF5_mappingPhase, &
|
||||||
HDF5_mappingHomog, &
|
HDF5_mappingHomog, &
|
||||||
HDF5_mappingCrystallite, &
|
HDF5_mappingCrystallite, &
|
||||||
|
@ -83,38 +40,21 @@ module HDF5_Utilities
|
||||||
HDF5_removeLink, &
|
HDF5_removeLink, &
|
||||||
HDF5_createFile, &
|
HDF5_createFile, &
|
||||||
HDF5_closeFile, &
|
HDF5_closeFile, &
|
||||||
HDF5_addGroup2, &
|
HDF5_addGroup2
|
||||||
HDF5_openFile, &
|
|
||||||
HDF5_read, &
|
|
||||||
HDF5_write
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine HDF5_Utilities_init
|
subroutine results_init
|
||||||
use, intrinsic :: &
|
use, intrinsic :: &
|
||||||
iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer :: hdferr
|
|
||||||
integer(SIZE_T) :: typeSize
|
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- HDF5_Utilities init -+>>>'
|
write(6,'(/,a)') ' <<<+- HDF5_Utilities init -+>>>'
|
||||||
#include "compilation_info.f90"
|
#include "compilation_info.f90"
|
||||||
|
|
||||||
!currentInc = -1_pInt ToDo
|
currentInc = -1_pInt
|
||||||
!call HDF5_createJobFile ToDo
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
end subroutine results_init
|
||||||
!initialize HDF5 library and check if integer and float type size match
|
|
||||||
call h5open_f(hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_Utilities_init: h5open_f')
|
|
||||||
call h5tget_size_f(H5T_NATIVE_INTEGER,typeSize, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_Utilities_init: h5tget_size_f (int)')
|
|
||||||
if (int(pInt,SIZE_T)/=typeSize) call IO_error(0_pInt,ext_msg='pInt does not match H5T_NATIVE_INTEGER')
|
|
||||||
call h5tget_size_f(H5T_NATIVE_DOUBLE,typeSize, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_Utilities_init: h5tget_size_f (double)')
|
|
||||||
if (int(pReal,SIZE_T)/=typeSize) call IO_error(0_pInt,ext_msg='pReal does not match H5T_NATIVE_DOUBLE')
|
|
||||||
|
|
||||||
end subroutine HDF5_Utilities_init
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief creates and initializes HDF5 output files
|
!> @brief creates and initializes HDF5 output files
|
||||||
|
@ -1435,851 +1375,6 @@ subroutine HDF5_writeScalarDataset(group,dataset,label,SIunit,dataspace_size,mpi
|
||||||
|
|
||||||
end subroutine HDF5_writeScalarDataset
|
end subroutine HDF5_writeScalarDataset
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pReal with 1 dimension
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pReal_1(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape1: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape1: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape1: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pReal_1
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pReal with 2 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pReal_2(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape2: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape2: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape2: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pReal_2
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pReal with 3 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pReal_3(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape3: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape3: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape3: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pReal_3
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pReal with 4 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pReal_4(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape4: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape4: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape4: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pReal_4
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pReal with 5 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pReal_5(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape5: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape5: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape5: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pReal_5
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pReal with 6 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pReal_6(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape6: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape6: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape6: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pReal_6
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pReal with 7 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pReal_7(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape7: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape7: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pReal_shape7: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pReal_7
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pInt with 1 dimension
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pInt_1(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape1: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape1: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape1: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pInt_1
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pInt with 2 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pInt_2(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape2: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape2: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape2: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pInt_2
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pInt with 3 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pInt_3(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape3: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape3: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape3: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pInt_3
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pInt with 4 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pInt_4(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape4: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape4: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape4: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pInt_4
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pInt with 5 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pInt_5(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape5: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape5: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape5: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pInt_5
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pInt with 6 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pInt_6(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape6: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape6: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape6: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pInt_6
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for reading dataset of the type pInt with 7 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_read_pInt_7(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
integer(pInt),dimension(:), allocatable :: myShape
|
|
||||||
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id
|
|
||||||
myShape = shape(dataset)
|
|
||||||
|
|
||||||
call h5dopen_f(loc_id,datasetName,dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape7: h5dopen_f')
|
|
||||||
call h5dread_f(dset_id,H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T),hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape7: h5dread_f')
|
|
||||||
call h5dclose_f(dset_id,hdferr)
|
|
||||||
if (hdferr /= 0) call IO_error(0_pInt,ext_msg='HDF5_read_pInt__shape7: h5dclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_read_pInt_7
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pReal with 1 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pReal1(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal1: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_DOUBLE, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal1: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal1: h5dcreate_f')
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal1: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal1: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pReal1
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pReal with 2 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pReal2(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal2: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_DOUBLE, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal2: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal2: h5dcreate_f')
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal2: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal2: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pReal2
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pReal with 3 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pReal3(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal3: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_DOUBLE, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal3: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal3: h5dcreate_f')
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal3: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal3: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pReal3
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pReal with 4 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pReal4(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal4: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_DOUBLE, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal4: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal4: h5dcreate_f')
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal4: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal4: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pReal4
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pReal with 5 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pReal5(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal5: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_DOUBLE, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal5: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal5: h5dcreate_f')
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal5: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal5: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pReal5
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pReal with 6 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pReal6(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal6: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_DOUBLE, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal6: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal6: h5dcreate_f')
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal6: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal6: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pReal6
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pReal with 7 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pReal7(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
real(pReal), intent(out), dimension(:,:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal7: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_DOUBLE, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal7: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_DOUBLE,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pReal7: h5dcreate_f')
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal7: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pReal7: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pReal7
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pInt with 1 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pInt1(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt1: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_INTEGER, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt1: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt1: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt1: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pInt1
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pInt with 2 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pInt2(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt2: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_INTEGER, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt2: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt2: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt2: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pInt2
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pInt with 3 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pInt3(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt3: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_INTEGER, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt3: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt3: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt3: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pInt3
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pInt with 4 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pInt4(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt4: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_INTEGER, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt4: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt4: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt4: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pInt4
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pInt with 5 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pInt5(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt5: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_INTEGER, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt5: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt5: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt5: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pInt5
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pInt with 6 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pInt6(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt6: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_INTEGER, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt6: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt6: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt6: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pInt6
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!> @brief subroutine for writing dataset of the type pInt with 7 dimensions
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
subroutine HDF5_write_pInt7(dataset,loc_id,datasetName)
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
integer(pInt), intent(out), dimension(:,:,:,:,:,:,:) :: dataset
|
|
||||||
integer(HID_T), intent(in) :: loc_id !< file or group handle
|
|
||||||
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
|
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable :: myShape !<shape of the dataset
|
|
||||||
integer :: hdferr
|
|
||||||
integer(HID_T) :: dset_id, space_id
|
|
||||||
|
|
||||||
myShape = shape(dataset)
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataspace
|
|
||||||
call h5screate_simple_f(size(myShape), int(myShape,HSIZE_T), space_id, hdferr, &
|
|
||||||
int(myShape,HSIZE_T))
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt7: h5screate_simple_f')
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! create dataset
|
|
||||||
call h5dcreate_f(loc_id, trim(datasetName), H5T_NATIVE_INTEGER, space_id, dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_write_pInt7: h5dcreate_f')
|
|
||||||
|
|
||||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER,dataset,int(myShape,HSIZE_T), hdferr)
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
!close types, dataspaces
|
|
||||||
call h5dclose_f(dset_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt7: h5dclose_f')
|
|
||||||
call h5sclose_f(space_id, hdferr)
|
|
||||||
if (hdferr < 0) call IO_error(1_pInt,ext_msg='HDF5_HDF5_write_pInt7: h5sclose_f')
|
|
||||||
|
|
||||||
end subroutine HDF5_write_pInt7
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief adds a new scalar dataset to the given group location
|
!> @brief adds a new scalar dataset to the given group location
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -2338,4 +1433,4 @@ subroutine HDF5_forwardResults(time)
|
||||||
|
|
||||||
end subroutine HDF5_forwardResults
|
end subroutine HDF5_forwardResults
|
||||||
|
|
||||||
end module HDF5_Utilities
|
end module results
|
||||||
|
|
Loading…
Reference in New Issue