Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fda65e5527 | |||
| 5d6a9a9ac9 | |||
| bdbeb061c5 | |||
| 6ff8067ba8 | |||
| 47c80a05b7 | |||
| 20d5b95d59 | |||
| 095df28103 | |||
| b16054d590 | |||
| 406375687b | |||
| bbf2cc335f | |||
| 13cc544fc1 | |||
| d8880dfcb9 | |||
| 26d8508984 | |||
| 0bb516ecbd | |||
| 72fa424a51 |
+51
-43
@@ -359,32 +359,71 @@ doc/tetrahedron_refinements/6-edges/edge_01-12-20-23-30-31_refined/buildlatex.ba
|
||||
doc/tetrahedron_refinements/6-edges/edge_01-12-20-23-30-31_refined/output_file.jpg -text
|
||||
doc/tetrahedron_refinements/README -text
|
||||
doc/tetrahedron_refinements/text2vtk.py -text
|
||||
examples/H5Block/BlockTestSpecs.txt -text
|
||||
examples/H5Block/H5BlockDissolveGhosts.c -text
|
||||
examples/H5Block/H5BlockParTestScalarField.c -text
|
||||
examples/H5Block/H5BlockParTestScalarField.pbs -text
|
||||
examples/H5Block/H5BlockParTestScalarFieldF.f90 -text
|
||||
examples/H5Block/H5BlockTestAttributes.c -text
|
||||
examples/H5Block/H5BlockTestAttributesF.f90 -text
|
||||
examples/H5Block/Makefile.am -text
|
||||
examples/H5Fed/Makefile.am -text
|
||||
examples/H5Fed/map_tet2globalid.c -text
|
||||
examples/H5Fed/map_triangle2globalid.c -text
|
||||
examples/H5Fed/tetmesh_adjacencies.c -text
|
||||
examples/H5Fed/tetmesh_read.c -text
|
||||
examples/H5Fed/tetmesh_read_tags.c -text
|
||||
examples/H5Fed/tetmesh_write.c -text
|
||||
examples/H5Fed/tetmesh_write1.c -text
|
||||
examples/H5Fed/tetmesh_write2.c -text
|
||||
examples/H5Fed/tetmesh_write_tags.c -text
|
||||
examples/H5Fed/trimesh_2gnuplot.c -text
|
||||
examples/H5Fed/trimesh_adjacencies.c -text
|
||||
examples/H5Fed/trimesh_read.c -text
|
||||
examples/H5Fed/trimesh_write.c -text
|
||||
examples/H5Fed/trimesh_write_dunetest.c -text
|
||||
examples/H5Fed/write_boundary.c -text
|
||||
examples/H5Part/Bench.c -text
|
||||
examples/H5Part/H5ParallelTest.cc -text
|
||||
examples/H5Part/H5PartAndreasTest.cc -text
|
||||
examples/H5Part/H5PartTest.cc -text
|
||||
examples/H5Part/H5PartTestParallel.cc -text
|
||||
examples/H5Part/H5test.cc -text
|
||||
examples/H5Part/H5testF.f -text
|
||||
examples/H5Part/H5testFpar.f90 -text
|
||||
examples/H5Part/Makefile.am -text
|
||||
/license.txt -text
|
||||
src/C++/H5Fed.cc -text
|
||||
src/C++/H5Fed.hh -text
|
||||
src/C++/Makefile.am -text
|
||||
src/C/H5.c -text
|
||||
src/C/H5Block.c -text
|
||||
src/C/H5Block_readwrite.c -text
|
||||
src/C/H5Part.c -text
|
||||
src/C/H5_attachments.c -text
|
||||
src/C/H5_attribs.c -text
|
||||
src/C/Makefile.am -text
|
||||
src/C/generate-h5b-readwrite.py -text
|
||||
src/Fortran/H5.c -text
|
||||
src/Fortran/H5.f90 -text
|
||||
src/Fortran/H5Block.c -text
|
||||
src/Fortran/H5Block.f90 -text
|
||||
src/Fortran/H5BlockF.f90 -text
|
||||
src/Fortran/H5Block_F.c -text
|
||||
src/Fortran/H5Block_attribs.c -text
|
||||
src/Fortran/H5Block_attribsF.f90 -text
|
||||
src/Fortran/H5Block_io.c -text
|
||||
src/Fortran/H5Block_ioF.f90 -text
|
||||
src/Fortran/H5Block_readwrite.f90 -text
|
||||
src/Fortran/H5Block_readwrite_F.c -text
|
||||
src/Fortran/H5F.f90 -text
|
||||
src/Fortran/H5Part.c -text
|
||||
src/Fortran/H5Part.f90 -text
|
||||
src/Fortran/H5PartF.f90 -text
|
||||
src/Fortran/H5Part_F.c -text
|
||||
src/Fortran/H5Part_io.c -text
|
||||
src/Fortran/H5Part_ioF.f90 -text
|
||||
src/Fortran/H5_F.c -text
|
||||
src/Fortran/H5_attribs.c -text
|
||||
src/Fortran/H5_attribs.f90 -text
|
||||
src/Fortran/H5_attribsF.f90 -text
|
||||
src/Fortran/H5_attribs_F.c -text
|
||||
src/Fortran/H5_constF.f90 -text
|
||||
src/Fortran/Makefile.am -text
|
||||
src/Fortran/TestUnderscore.f -text
|
||||
src/Fortran/TestUnderscoreC.c -text
|
||||
src/Fortran/generate-h5-attribs-f.py -text
|
||||
src/Fortran/h5_private.h -text
|
||||
src/Makefile.am -text
|
||||
src/h5core/Makefile.am -text
|
||||
src/h5core/h5_attach.c -text
|
||||
@@ -475,7 +514,9 @@ src/include/H5Part.h -text
|
||||
src/include/H5_attachments.h -text
|
||||
src/include/H5_attribs.h -text
|
||||
src/include/H5hut.h -text
|
||||
src/include/Makefile.am -text
|
||||
src/include/grephdr -text
|
||||
src/include/h5core/Makefile.am -text
|
||||
src/include/h5core/h5_attach.h -text
|
||||
src/include/h5core/h5_attribs.h -text
|
||||
src/include/h5core/h5_core.h -text
|
||||
@@ -502,39 +543,6 @@ src/include/h5core/h5t_storemesh.h -text
|
||||
src/include/h5core/h5t_tags.h -text
|
||||
src/include/h5core/h5u_model.h -text
|
||||
src/include/h5core/h5u_readwrite.h -text
|
||||
test/H5Block/BlockTestSpecs.txt -text
|
||||
test/H5Block/H5BlockDissolveGhosts.c -text
|
||||
test/H5Block/H5BlockParTestScalarField.c -text
|
||||
test/H5Block/H5BlockParTestScalarField.pbs -text
|
||||
test/H5Block/H5BlockParTestScalarFieldF.f90 -text
|
||||
test/H5Block/H5BlockTestAttributes.c -text
|
||||
test/H5Block/H5BlockTestAttributesF.f90 -text
|
||||
test/H5Block/Makefile.am -text
|
||||
test/H5Fed/Makefile.am -text
|
||||
test/H5Fed/map_tet2globalid.c -text
|
||||
test/H5Fed/map_triangle2globalid.c -text
|
||||
test/H5Fed/tetmesh_adjacencies.c -text
|
||||
test/H5Fed/tetmesh_read.c -text
|
||||
test/H5Fed/tetmesh_read_tags.c -text
|
||||
test/H5Fed/tetmesh_write.c -text
|
||||
test/H5Fed/tetmesh_write1.c -text
|
||||
test/H5Fed/tetmesh_write2.c -text
|
||||
test/H5Fed/tetmesh_write_tags.c -text
|
||||
test/H5Fed/trimesh_2gnuplot.c -text
|
||||
test/H5Fed/trimesh_adjacencies.c -text
|
||||
test/H5Fed/trimesh_read.c -text
|
||||
test/H5Fed/trimesh_write.c -text
|
||||
test/H5Fed/trimesh_write_dunetest.c -text
|
||||
test/H5Fed/write_boundary.c -text
|
||||
test/H5Part/Bench.c -text
|
||||
test/H5Part/H5ParallelTest.cc -text
|
||||
test/H5Part/H5PartAndreasTest.cc -text
|
||||
test/H5Part/H5PartTest.cc -text
|
||||
test/H5Part/H5PartTestParallel.cc -text
|
||||
test/H5Part/H5test.cc -text
|
||||
test/H5Part/H5testF.f -text
|
||||
test/H5Part/H5testFpar.f90 -text
|
||||
test/H5Part/Makefile.am -text
|
||||
test/Makefile.am -text
|
||||
test/h5_attach_test.c -text
|
||||
test/h5b_read.c -text
|
||||
|
||||
+40
-29
@@ -15,14 +15,39 @@
|
||||
/depcomp
|
||||
doc/Makefile
|
||||
doc/Makefile.in
|
||||
examples/H5Block/H5BlockParTestScalarField
|
||||
examples/H5Block/H5BlockTestAttributes
|
||||
examples/H5Block/Makefile
|
||||
examples/H5Block/Makefile.in
|
||||
examples/H5Fed/.deps
|
||||
examples/H5Fed/Makefile
|
||||
examples/H5Fed/Makefile.in
|
||||
examples/H5Fed/large_tet.h5
|
||||
examples/H5Fed/simple_tet.h5
|
||||
examples/H5Fed/simple_triangle.h5
|
||||
examples/H5Fed/small_tet.h5
|
||||
examples/H5Fed/tetmesh_adjacencies
|
||||
examples/H5Fed/tetmesh_read
|
||||
examples/H5Fed/tetmesh_read_tags
|
||||
examples/H5Fed/tetmesh_write
|
||||
examples/H5Fed/tetmesh_write2
|
||||
examples/H5Fed/tetmesh_write_tags
|
||||
examples/H5Fed/trimesh_adjacencies
|
||||
examples/H5Fed/trimesh_read
|
||||
examples/H5Fed/trimesh_write
|
||||
examples/H5Fed/trimesh_write_dunetest
|
||||
examples/H5Part/Bench
|
||||
examples/H5Part/H5PartAndreasTest
|
||||
examples/H5Part/H5PartTestP
|
||||
examples/H5Part/H5test
|
||||
examples/H5Part/Makefile
|
||||
examples/H5Part/Makefile.in
|
||||
/install-sh
|
||||
/libtool
|
||||
/ltmain.sh
|
||||
/m4
|
||||
/missing
|
||||
src/.deps
|
||||
src/C++/Makefile
|
||||
src/C++/Makefile.in
|
||||
src/C/.deps
|
||||
src/C/Makefile
|
||||
src/C/Makefile.in
|
||||
@@ -30,6 +55,8 @@ src/C/libH5hutC.a
|
||||
src/Fortran/.deps
|
||||
src/Fortran/Makefile
|
||||
src/Fortran/Makefile.in
|
||||
src/Fortran/TestUnderscore
|
||||
src/Fortran/Underscore.h
|
||||
src/Makefile
|
||||
src/Makefile.in
|
||||
src/h5core/.deps
|
||||
@@ -37,37 +64,15 @@ src/h5core/Makefile
|
||||
src/h5core/Makefile.in
|
||||
src/h5core/libH5hut.a
|
||||
src/include/H5hutF.h
|
||||
src/include/Makefile
|
||||
src/include/Makefile.in
|
||||
src/include/h5core/Makefile
|
||||
src/include/h5core/Makefile.in
|
||||
src/lib
|
||||
/stamp-h1
|
||||
/svn-prop.tmp
|
||||
/test-driver
|
||||
test/.deps
|
||||
test/H5Block/H5BlockParTestScalarField
|
||||
test/H5Block/H5BlockTestAttributes
|
||||
test/H5Block/Makefile
|
||||
test/H5Block/Makefile.in
|
||||
test/H5Fed/.deps
|
||||
test/H5Fed/Makefile
|
||||
test/H5Fed/Makefile.in
|
||||
test/H5Fed/large_tet.h5
|
||||
test/H5Fed/simple_tet.h5
|
||||
test/H5Fed/simple_triangle.h5
|
||||
test/H5Fed/small_tet.h5
|
||||
test/H5Fed/tetmesh_adjacencies
|
||||
test/H5Fed/tetmesh_read
|
||||
test/H5Fed/tetmesh_read_tags
|
||||
test/H5Fed/tetmesh_write
|
||||
test/H5Fed/tetmesh_write2
|
||||
test/H5Fed/tetmesh_write_tags
|
||||
test/H5Fed/trimesh_adjacencies
|
||||
test/H5Fed/trimesh_read
|
||||
test/H5Fed/trimesh_write
|
||||
test/H5Fed/trimesh_write_dunetest
|
||||
test/H5Part/Bench
|
||||
test/H5Part/H5PartAndreasTest
|
||||
test/H5Part/H5PartTestP
|
||||
test/H5Part/H5test
|
||||
test/H5Part/Makefile
|
||||
test/H5Part/Makefile.in
|
||||
test/Makefile
|
||||
test/Makefile.in
|
||||
test/h5_attach.h5
|
||||
@@ -80,3 +85,9 @@ tools/Makefile.in
|
||||
tools/h5PartDcToVtk
|
||||
tools/h5PartSurfaceToVtk
|
||||
tools/h5hutcc
|
||||
tools/vtk2h5grid/.deps
|
||||
tools/vtk2h5grid/Makefile
|
||||
tools/vtk2h5grid/Makefile.in
|
||||
tools/vtk2h5grid/cgun_full.h5
|
||||
tools/vtk2h5grid/cgun_full.vtk
|
||||
tools/vtk2h5grid/vtk2h5grid
|
||||
|
||||
+3
-1
@@ -1,9 +1,11 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
EXTRA_DIST = autogen.sh
|
||||
|
||||
SUBDIRS = \
|
||||
src \
|
||||
test \
|
||||
tools
|
||||
tools \
|
||||
doc
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
config.h \
|
||||
|
||||
+116
-180
@@ -1,53 +1,55 @@
|
||||
# Every configure script must call AC_INIT before doing anything else.
|
||||
# AC_INIT (package, version, [bug-report], [tarname])
|
||||
AC_INIT([H5hut], [1.99.6], [h5part@lists.psi.ch], H5hut)
|
||||
|
||||
|
||||
# Ensure that a recent enough version of Autoconf is being used.
|
||||
# If the version of Autoconf being used to create configure is earlier than version,
|
||||
# print an error message to the standard error output and do not create configure.
|
||||
AC_INIT([H5hut], [1.99.12], [h5part@lists.psi.ch], H5hut)
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
# should be called right after AC_INIT.
|
||||
# configure scripts can create a C header file containing `#define' directives.
|
||||
# The AC_CONFIG_HEADERS macro selects this kind of output.
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# AM_INIT_AUTOMAKE is required to use autoconf with automake
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
BUILD_LIBS='libH5hut'
|
||||
USE_C='yes'
|
||||
ENABLE_DEBUG='no'
|
||||
ENABLE_C='yes'
|
||||
ENABLE_FORTRAN='no'
|
||||
ENABLE_PARALLEL='no'
|
||||
|
||||
###############################################################################
|
||||
################# --enable-xxx and --with-xxx Argument ########################
|
||||
###############################################################################
|
||||
|
||||
# --enable-xxx and --with-xxx Arguments
|
||||
AC_ARG_ENABLE(
|
||||
[debug],
|
||||
[AC_HELP_STRING([--enable-debug],
|
||||
[Compile with debug flags [default=no]])],
|
||||
[USE_DEBUG=$enableval])
|
||||
[AS_HELP_STRING([--enable-debug], [Compile with debug flags [default=no]])],
|
||||
[ENABLE_DEBUG=$enableval])
|
||||
AM_CONDITIONAL([ENABLE_DEBUG], [test "$ENABLE_DEBUG" = "yes"])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[c],
|
||||
[AC_HELP_STRING([--enable-c],
|
||||
[AS_HELP_STRING([--enable-c],
|
||||
[Compile the C interface [default=yes]])],
|
||||
[USE_C=$enableval])
|
||||
[ENABLE_C=$enableval])
|
||||
AM_CONDITIONAL([ENABLE_C], [test "$ENABLE_C" = "yes"])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[fortran],
|
||||
[AC_HELP_STRING([--enable-fortran],
|
||||
[AS_HELP_STRING([--enable-fortran],
|
||||
[Compile the Fortran interface [default=no]])],
|
||||
[USE_FORTRAN=$enableval])
|
||||
[ENABLE_FORTRAN=$enableval])
|
||||
AM_CONDITIONAL([ENABLE_FORTRAN], [test "$ENABLE_FORTRAN" = "yes"])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[parallel],
|
||||
[AC_HELP_STRING([--enable-parallel],
|
||||
[AS_HELP_STRING([--enable-parallel],
|
||||
[Compile the MPI/IO interface [default=no]])],
|
||||
[USE_PARALLEL=$enableval])
|
||||
[ENABLE_PARALLEL=$enableval])
|
||||
AM_CONDITIONAL([ENABLE_PARALLEL], [test "$ENABLE_PARALLEL" = "yes"])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[large-indices],
|
||||
[AC_HELP_STRING([--enable-large-indices],
|
||||
[Compile with 64bit local IDs and indices [default=no]])],
|
||||
[USE_LARGE_INDICES=$enableval])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[experimental],
|
||||
[AS_HELP_STRING([--enable-experimental],
|
||||
[Compile experimental code [default=no]])],
|
||||
[ENABLE_EXPERIMENTAL=$enableval])
|
||||
AM_CONDITIONAL([ENABLE_EXPERIMENTAL], [test "$ENABLE_EXPERIMENTAL" = "yes"])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[vtkconverter],
|
||||
@@ -58,27 +60,28 @@ AM_CONDITIONAL([ENABLE_VTKCONVERTER], [test "$ENABLE_VTKCONVERTER" = "yes"])
|
||||
|
||||
AC_ARG_WITH(
|
||||
[hdf5],
|
||||
[AC_HELP_STRING([--with-hdf5],
|
||||
[AS_HELP_STRING([--with-hdf5],
|
||||
[path to HDF5 installation [default=""]])],
|
||||
[HDF5PATH=$withval], [HDF5PATH=""])
|
||||
[HDF5_PREFIX=$withval], [])
|
||||
|
||||
AC_ARG_WITH(
|
||||
[mpi],
|
||||
[AC_HELP_STRING([--with-mpi],
|
||||
[AS_HELP_STRING([--with-mpi],
|
||||
[path to MPI installation [default=""]])],
|
||||
[MPIPATH=$withval;PATH=$MPIPATH/bin:$PATH], [MPIPATH=""])
|
||||
[PATH=$MPI_PREFIX/bin:$PATH])
|
||||
|
||||
AC_ARG_WITH(
|
||||
[lustre],
|
||||
[AC_HELP_STRING([--with-lustre],
|
||||
[AS_HELP_STRING([--with-lustre],
|
||||
[path to lustre user API [default=""]])],
|
||||
[LUSTREPATH=$withval], [LUSTREPATH=""])
|
||||
|
||||
AC_ARG_WITH(
|
||||
[vtk],
|
||||
[AS_HELP_STRING([--with-vtk],
|
||||
[path to VTK installation [default=""]])],
|
||||
[VTK_PREFIX=$withval], [VTK_PREFIX=""])
|
||||
[parmetis],
|
||||
[AC_HELP_STRING([--with-parmetis],
|
||||
[path to ParMETIS API [default=""]])],
|
||||
[PARMETISPATH=$withval], [PARMETISPATH=""])
|
||||
|
||||
|
||||
###############################################################################
|
||||
############### PATH SERACH FUNCTION - to be used later... ####################
|
||||
@@ -111,33 +114,27 @@ PATH_Search() {
|
||||
return
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# MISC SETTINGS INCLUDING C & C++ COMPILER SETTING
|
||||
|
||||
###############################################################################
|
||||
############# MISC SETTINGS INCLUDING C & C++ COMPILER SETTING ################
|
||||
###############################################################################
|
||||
# Compute the canonical host-system type variable, host, and its three
|
||||
# individual parts host_cpu, host_vendor, and host_os.
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
# debug enabled?
|
||||
AC_MSG_CHECKING([if debug is enabled])
|
||||
|
||||
if test "X$USE_DEBUG" = "Xyes"; then
|
||||
if test "X$ENABLE_DEBUG" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
CFLAGS="$CFLAGS -g"
|
||||
CFLAGS="$CFLAGS -g -Wall"
|
||||
CXXFLAGS="$CFLAGS -g -Wall"
|
||||
FFLAGS="$FFLAGS -g"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
# Determine a C/C++ compiler to use.
|
||||
# If CC is not already set in the environment, check for gcc and cc, then
|
||||
# for other C compilers.
|
||||
# Set output variable CC to the name of the compiler found.
|
||||
if test "x$USE_PARALLEL" = "xyes"; then
|
||||
CCOMPILERS="mpicc cc"
|
||||
CXXCOMPILERS="mpic++ c++"
|
||||
if test "x$ENABLE_PARALLEL" = "xyes"; then
|
||||
CCOMPILERS="mpicc"
|
||||
CXXCOMPILERS="mpic++"
|
||||
else
|
||||
CCOMPILERS="pgcc pathcc icc gcc cc_r cc"
|
||||
CXXCOMPILERS="pgcc pathcc icc g++ cc_r c++"
|
||||
@@ -148,17 +145,12 @@ CC=`which $CC`
|
||||
AC_PROG_CXX($CXXCOMPILERS)
|
||||
CXX=`which $CXX`
|
||||
|
||||
# Use macro to set C99 mode instead of checking for gcc, which breaks with
|
||||
# parallel builds.
|
||||
AC_PROG_CC_C99
|
||||
if test "x$ac_cv_prog_cc_c99" = "xno"; then
|
||||
AC_MSG_ERROR([Cannot set C compiler to use C99 standard!])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set output variable INSTALL to the path of a BSD-compatible install program,
|
||||
# if one is found in the current PATH.
|
||||
# Otherwise, set INSTALL to `dir/install-sh -c`
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_AWK
|
||||
|
||||
@@ -201,34 +193,27 @@ AC_DEFINE_UNQUOTED(MY_UNAME, "$uname", "")
|
||||
|
||||
|
||||
###############################################################################
|
||||
######################## CONFIGURE LINE OPTIONS ###############################
|
||||
###############################################################################
|
||||
# PROCESS ARGUMENTS
|
||||
|
||||
############################ fortran enabled ##################################
|
||||
# C enabled?
|
||||
AC_MSG_CHECKING([if C interface enabled])
|
||||
if test "X$USE_C" = "Xyes"; then
|
||||
if test "X$ENABLE_C" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
BINDINGS="$BINDINGS C"
|
||||
LIB_C="libH5hutC.la"
|
||||
BUILD_LIBS="$BUILD_LIBS libH5hutC"
|
||||
BUILD_TESTS="$BUILD_TESTS h5u_test h5b_test"
|
||||
BUILD_TOOLS="$BUILD_TOOLS h5hutcc"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
############################ fortran enabled ##################################
|
||||
# fortran enabled?
|
||||
AC_MSG_CHECKING([if fortran interface enabled])
|
||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||
if test "X$ENABLE_FORTRAN" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
BINDINGS="$BINDINGS Fortran"
|
||||
LIB_FORTRAN="libH5hutF.la"
|
||||
BUILD_LIBS="$BUILD_LIBS libH5hutF"
|
||||
|
||||
if test "X$USE_PARALLEL" = "Xyes"; then
|
||||
if test "X$ENABLE_PARALLEL" = "Xyes"; then
|
||||
AC_PROG_FC(mpif90 mpif77)
|
||||
else
|
||||
AC_PROG_FC(pgf90 ifort xlf_r pathf90 g95 g90 ftn gfortran)
|
||||
fi
|
||||
|
||||
FC=`which $FC`
|
||||
if test -z "$FC" ; then
|
||||
AC_MSG_ERROR([Cannot find a Fortran compiler!])
|
||||
exit 1
|
||||
@@ -249,12 +234,11 @@ if test "X$USE_FORTRAN" = "Xyes"; then
|
||||
`cd src/Fortran && ${FC} ${FFLAGS} -o TestUnderscore TestUnderscore.o TestUnderscoreC.o`
|
||||
|
||||
if test -f src/Fortran/TestUnderscore ; then
|
||||
UNDERSCORE_H=Underscore.h
|
||||
`cd src/Fortran && ./TestUnderscore > Underscore.h`
|
||||
AC_MSG_RESULT([ok])
|
||||
else
|
||||
AC_MSG_RESULT([nok])
|
||||
AC_MSG_ERROR([Cannot determine the symbon convention for Fortran object files!])
|
||||
AC_MSG_ERROR([Cannot determine the symbol convention for Fortran object files!])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -262,91 +246,60 @@ else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
######################## large indices enabled ###########################
|
||||
AC_MSG_CHECKING([if large indices are enabled])
|
||||
if test "X$USE_LARGE_INDICES" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
CFLAGS="${CFLAGS} -DUSE_LARGE_INDICES"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
######################## parallel interface enabled ###########################
|
||||
AC_MSG_CHECKING([if parallel interface enabled])
|
||||
if test "X$USE_PARALLEL" = "Xyes"; then
|
||||
if test "X$ENABLE_PARALLEL" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
CPPFLAGS="${CPPFLAGS} -DPARALLEL_IO -DMPICH_IGNORE_CXX_SEEK"
|
||||
|
||||
CFLAGS="${CFLAGS} -DPARALLEL_IO -DMPICH_IGNORE_CXX_SEEK"
|
||||
if test "X$ENABLE_EXPERIMENTAL" = "Xyes"; then
|
||||
AC_MSG_CHECKING([for ParMETIS])
|
||||
if test "X$PARMETISPATH" != "X"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$PARMETISPATH/include"
|
||||
LDFLAGS="$LDFLAGS -L$PARMETISPATH/lib"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if we can compile MPI code without setting flags])
|
||||
AC_TRY_LINK([#include "mpi.h"], [
|
||||
MPI_Comm comm;
|
||||
int n;
|
||||
MPI_Comm_size( comm, &n ); ],
|
||||
[AC_MSG_RESULT([yes]); r='yes'], [AC_MSG_RESULT([no]); r='no'] )
|
||||
|
||||
if test "X$r" = "Xno"; then
|
||||
AC_MSG_ERROR([MPI wrapper can't compile or link MPI program! Please set the INCLUDE and LIBS variables manually.])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TPTARGET="${TPTARGET} H5PartTestP H5PartAndreasTest Bench"
|
||||
TBTARGET="${TBTARGET} H5BlockTestAttributes"
|
||||
TBTARGET="${TBTARGET} H5BlockParTestScalarField"
|
||||
|
||||
# parallel + fortran
|
||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||
TPTARGET="${TPTARGET} H5testFpar"
|
||||
TBTARGET="${TBTARGET} H5BlockParTestScalarFieldF"
|
||||
fi
|
||||
LIBS="$LIBS -lparmetis -lmetis"
|
||||
AC_TRY_LINK([#include <parmetis.h>], [
|
||||
ParMETIS_V3_PartGeom (NULL, NULL, NULL, NULL, NULL);],
|
||||
[AC_MSG_RESULT([yes]); r='yes'], [AC_MSG_RESULT([no]); r='no'] )
|
||||
|
||||
if test "X$r" = "Xno"; then
|
||||
AC_MSG_ERROR([ParMETIS])
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
else # --enable-parallel=no
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
TPTARGET="${TPTARGET} H5test"
|
||||
TBTARGET="${TBTARGET} H5BlockTestAttributes"
|
||||
|
||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||
TPTARGET="${TPTARGET} H5testF"
|
||||
TBTARGET="${TBTARGET} H5BlockTestAttributesF"
|
||||
fi
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
######################### PATH CHECKING & SETTING #############################
|
||||
###############################################################################
|
||||
|
||||
AC_MSG_CHECKING([for HDF5 root ])
|
||||
AC_MSG_RESULT([])
|
||||
if test -n "${HDF5PATH}" ; then
|
||||
P=${HDF5PATH}
|
||||
elif test -n "${HDF5ROOT}"; then
|
||||
P=${HDF5ROOT}
|
||||
elif test -n "${HDF5HOME}" ; then
|
||||
P=${HDF5HOME}
|
||||
elif test -n "${HDF5_DIR}" ; then
|
||||
P=${HDF5_DIR}
|
||||
else
|
||||
P=''
|
||||
P="$P /usr"
|
||||
P="$P /usr/local"
|
||||
P="$P /usr/local/hdf5"
|
||||
P="$P /usr/local/packages/hdf5"
|
||||
P="$P /apps/hdf5"
|
||||
P="$P /opt/hdf5"
|
||||
fi
|
||||
PATH_Search HDF5ROOT "$P" include/hdf5.h
|
||||
if test -z "$HDF5ROOT"; then
|
||||
AC_MSG_ERROR([Cannot find an HDF5 library!])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AM_CPPFLAGS="$AM_CPPFLAGS -I$HDF5ROOT/include"
|
||||
LDFLAGS="$LDFLAGS -L$HDF5ROOT/lib"
|
||||
LIBS="$LIBS -lhdf5"
|
||||
|
||||
AC_MSG_CHECKING([if we need to link to libsz ])
|
||||
if test -n "$HDF5ROOT"; then
|
||||
if test -f $HDF5ROOT/lib/libsz.a; then
|
||||
AC_MSG_RESULT([yes])
|
||||
LDFLAGS="$LDFLAGS -L$HDF5ROOT/lib"
|
||||
LIBS="$LIBS -lsz"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
# LIBRARY PATHS
|
||||
if test -z "${HDF5_PREFIX}"; then
|
||||
# alternatives to HDF5_PREFIX
|
||||
if test -n "${HDF5_DIR}"; then
|
||||
HDF5_PREFIX=${HDF5_DIR}
|
||||
fi
|
||||
fi
|
||||
if test -n "${HDF5_PREFIX}"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$HDF5_PREFIX/include"
|
||||
LDFLAGS="$LDFLAGS -L$HDF5_PREFIX/lib"
|
||||
fi
|
||||
AC_CHECK_LIB([z], [compress2])
|
||||
AC_CHECK_LIB([hdf5], [H5open])
|
||||
AS_IF([test "x$ac_cv_lib_hdf5_H5open" != xyes],
|
||||
[AC_MSG_ERROR([Cannot compile and link a HDF5 program]);
|
||||
exit 1])
|
||||
|
||||
|
||||
AC_MSG_CHECKING([for lustre API ])
|
||||
AC_MSG_RESULT([])
|
||||
@@ -370,12 +323,12 @@ if test -z "$LUSTREROOT"; then
|
||||
AC_MSG_WARN([Couldn't locate the lustre API... building without support for lustre striping!])
|
||||
else
|
||||
CFLAGS="$CFLAGS -DH5_USE_LUSTRE"
|
||||
AM_CPPFLAGS=="$AM_CPPFLAGS -I$LUSTREROOT/usr/include"
|
||||
CPPFLAGS="$CPPFLAGS -I$LUSTREROOT/usr/include"
|
||||
LDFLAGS="$LDFLAGS -L$LUSTREROOT/usr/lib"
|
||||
LIBS="$LIBS -llustreapi"
|
||||
fi
|
||||
|
||||
LIBS="$LIBS -lz -lm"
|
||||
LIBS="$LIBS -lm"
|
||||
|
||||
###############################################################################
|
||||
# TOOLS
|
||||
@@ -388,39 +341,26 @@ else
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
############## EXPORTING VARIABLES & CREATING OUTPUT FILES ####################
|
||||
###############################################################################
|
||||
# AC_SUBST (variable, [value])
|
||||
# Create an output variable from a shell variable. Make AC_OUTPUT substitute
|
||||
# the variable variable into output files (typically one or more `Makefile's).
|
||||
# This means that AC_OUTPUT will replace instances of `@variable@' in input
|
||||
# files with the value that the shell variable variable has when AC_OUTPUT is
|
||||
# called. This value of variable should not contain literal newlines. If
|
||||
# value is given, in addition assign it to variable.
|
||||
AC_SUBST(HDF5ROOT)
|
||||
AC_SUBST(LUSTREROOT)
|
||||
# EXPORTING VARIABLES & CREATING OUTPUT FILES
|
||||
AM_CPPFLAGS=$CPPFLAGS
|
||||
AM_LDFLAGS=$LDFLAGS
|
||||
|
||||
AC_SUBST(HDF5_PREFIX)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(FFLAGS)
|
||||
AC_SUBST(AM_CPPFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(LIBS)
|
||||
AC_SUBST(UNDERSCORE_H)
|
||||
AC_SUBST(LIB_C)
|
||||
AC_SUBST(LIB_FORTRAN)
|
||||
AC_SUBST(BINDINGS)
|
||||
AC_SUBST(BUILD_TESTS)
|
||||
AC_SUBST(BUILD_TOOLS)
|
||||
AC_SUBST(AM_LDFLAGS)
|
||||
|
||||
# Make AC_OUTPUT create each `file' by copying an input file (by default `file.in'),
|
||||
# substituting the output variable values.
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
src/Makefile
|
||||
src/C/Makefile
|
||||
src/h5core/Makefile
|
||||
src/include/Makefile
|
||||
src/include/h5core/Makefile
|
||||
src/C/Makefile
|
||||
src/Fortran/Makefile
|
||||
test/Makefile
|
||||
test/H5Fed/Makefile
|
||||
doc/Makefile
|
||||
tools/Makefile
|
||||
tools/h5hutcc
|
||||
tools/vtk2h5grid/Makefile
|
||||
@@ -429,25 +369,21 @@ AC_CONFIG_FILES([
|
||||
AC_OUTPUT
|
||||
|
||||
###############################################################################
|
||||
########################## PRINTING SUMMARY ###################################
|
||||
###############################################################################
|
||||
# PRINTING SUMMARY
|
||||
AC_MSG_RESULT([ ])
|
||||
AC_MSG_RESULT([Summary:])
|
||||
AC_MSG_RESULT([ ])
|
||||
AC_MSG_RESULT([Host OS: $host_os])
|
||||
AC_MSG_RESULT([Host CPU: $host_cpu])
|
||||
AC_MSG_RESULT([Host vendor: $host_vendor])
|
||||
AC_MSG_RESULT([Build libraries: $BUILD_LIBS])
|
||||
AC_MSG_RESULT([Build test programs: $BUILD_TESTS])
|
||||
AC_MSG_RESULT([Build tools: $BUILD_TOOLS])
|
||||
AC_MSG_RESULT([CC = $CC])
|
||||
AC_MSG_RESULT([CXX = $CXX])
|
||||
AC_MSG_RESULT([FC = $FC])
|
||||
AC_MSG_RESULT([CFLAGS = $CFLAGS])
|
||||
AC_MSG_RESULT([FFLAGS = $FFLAGS])
|
||||
AC_MSG_RESULT([INCLUDES = $INCLUDES])
|
||||
AC_MSG_RESULT([LDFLAGS = $LDFLAGS])
|
||||
AC_MSG_RESULT([AM_CPPFLAGS = $AM_CPPFLAGS])
|
||||
AC_MSG_RESULT([AM_LDFLAGS = $AM_LDFLAGS])
|
||||
AC_MSG_RESULT([LIBS = $LIBS])
|
||||
AC_MSG_RESULT([HDF5ROOT = $HDF5ROOT])
|
||||
AC_MSG_RESULT([HDF5_PREFIX = $HDF5_PREFIX])
|
||||
AC_MSG_RESULT([LUSTREROOT = $LUSTREROOT])
|
||||
AC_MSG_RESULT([ ])
|
||||
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
EXTRA_DIST = \
|
||||
Doxyfile \
|
||||
H5.dox
|
||||
EXTRA_DIST = \
|
||||
Doxyfile \
|
||||
H5.dox \
|
||||
Makefile.in
|
||||
|
||||
all:
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
# test level Makefile.am
|
||||
|
||||
OBJEXT = o
|
||||
|
||||
AM_LDFLAGS = -L../../src/lib @LDFLAGS@
|
||||
LIBS = -lH5hutC -lH5hut @LIBS@
|
||||
AM_CPPFLAGS = -I../../src/include @AM_CPPFLAGS@
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/src/include
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
tetmesh_write \
|
||||
@@ -1,193 +0,0 @@
|
||||
/*
|
||||
Implementation file for implementing the H5Fed application programming
|
||||
interface (API) in the C++ language.
|
||||
|
||||
Copyright 2006-2007
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Benedikt Oswald, Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
Some conventions:
|
||||
Functions:
|
||||
Name:
|
||||
ThisIsAFunction()
|
||||
Return values:
|
||||
-1 or NULL signals an error
|
||||
|
||||
\note
|
||||
In function names we use the words \b get and \b store insteed of
|
||||
\b read and \b write, because no I/O is actually done in these
|
||||
functions.
|
||||
*/
|
||||
|
||||
|
||||
/** include proprietary header files */
|
||||
#include "H5Fed.hh"
|
||||
|
||||
/** \brief make the C API functions available so that
|
||||
* we can used them in the implementation of the H5Fed class
|
||||
* member functions implementations.
|
||||
*/
|
||||
//extern "C"
|
||||
//{
|
||||
// #include "../../H5Fed.h"
|
||||
//}
|
||||
|
||||
|
||||
|
||||
/** activate namespaces */
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace H5Fed
|
||||
{
|
||||
/*!
|
||||
\defgroup h5fed_cpp_api H5Fed CPP API
|
||||
*/
|
||||
|
||||
|
||||
/** \brief implement constructor without arguments */
|
||||
H5Fed::H5Fed()
|
||||
{
|
||||
/** initialize internal variables */
|
||||
filename_.erase();
|
||||
}
|
||||
|
||||
|
||||
/** \brief implement constructor without arguments */
|
||||
H5Fed::H5Fed(std::string filename)
|
||||
{
|
||||
/** initialize internal variables */
|
||||
filename_.erase();
|
||||
filename_.append(filename);
|
||||
}
|
||||
|
||||
|
||||
/** \brief implement constructor */
|
||||
H5Fed::~H5Fed()
|
||||
{
|
||||
/** initialize internal variables */
|
||||
filename_.erase();
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set name of H5Fed file to be accessed */
|
||||
H5FED_RETURN_CODE H5Fed::filename(std::string filename)
|
||||
{
|
||||
/** initialize internal variables */
|
||||
filename_.erase();
|
||||
filename_.append(filename);
|
||||
|
||||
return(OKCODE);
|
||||
}
|
||||
|
||||
|
||||
/** \brief retrieve name of H5Fed file to be accessed */
|
||||
std::string H5Fed::filename()
|
||||
{
|
||||
return(filename_);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_cpp_api
|
||||
|
||||
Open file. This function is available in the paralell
|
||||
and serial version. In the serial case \c comm may have any value.
|
||||
|
||||
\return
|
||||
\return
|
||||
|
||||
\note
|
||||
File is always opened in read/writer mode!
|
||||
|
||||
\note
|
||||
Implement as wrapper of \c H5_open_file()!
|
||||
*/
|
||||
H5FED_RETURN_CODE H5Fed::open_file()
|
||||
{
|
||||
return(OKCODE);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_cpp_api
|
||||
|
||||
Close file. This function is available in the paralell
|
||||
and serial version. In the serial case \c comm may have
|
||||
any value.
|
||||
|
||||
\return
|
||||
\return
|
||||
|
||||
\note
|
||||
File is always opened in read/writer mode!
|
||||
|
||||
\note
|
||||
Implement as wrapper of \c H5_open_file()!
|
||||
*/
|
||||
H5FED_RETURN_CODE H5Fed::closeFile()
|
||||
{
|
||||
return(OKCODE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****** STORE routines*****************************************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the the coordinates of a specific vertex at level \c level
|
||||
with id \c vertex_id of the tetrahedral mesh.
|
||||
|
||||
\return value \c >=0 on success
|
||||
\return \c -1 on error
|
||||
*/
|
||||
H5FED_RETURN_CODE H5Fed::storeVertexCoordinate(
|
||||
unsigned int level, /*!< mesh level */
|
||||
unsigned int vertex_id, /*!< global vertex id */
|
||||
std::vector<double> /*!< 3-tuple of coordinates */
|
||||
)
|
||||
{
|
||||
return(OKCODE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the 4-tuple, that contains the specific indices describing
|
||||
a tetrahedron with id \c tet_id at level \c level of the tetrahedral
|
||||
mesh.
|
||||
|
||||
\return value \c >=0 on success
|
||||
\return \c -1 on error
|
||||
*/
|
||||
H5FED_RETURN_CODE H5Fed::H5FedStoreTetrahedron (
|
||||
const unsigned int level, /*!< mesh level */
|
||||
const unsigned int tet_id, /*!< global tetrahedron id */
|
||||
const unsigned int parent_id, /*!< parent id if level \c >0 else \x -1 */
|
||||
const std::vector<unsigned int> tet /*!< 4-tuple with vertex id's */
|
||||
)
|
||||
{
|
||||
return(OKCODE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
Header file for declaring the H5Fed application programming
|
||||
interface (API) in the C++ language. The header files follows
|
||||
the declaration of the C application programming interface.
|
||||
|
||||
Copyright 2006-2007
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Benedikt Oswald, Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
Some conventions:
|
||||
Functions:
|
||||
Name:
|
||||
ThisIsAFunction()
|
||||
Return values:
|
||||
-1 or NULL signals an error
|
||||
|
||||
\note
|
||||
In function names we use the words \b get and \b store insteed of
|
||||
\b read and \b write, because no I/O is actually done in these
|
||||
functions.
|
||||
*/
|
||||
|
||||
|
||||
/** include standard header files */
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <iterator>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
#include <complex>
|
||||
|
||||
/** include fundamental HDF5 header files */
|
||||
#include <hdf5.h>
|
||||
|
||||
|
||||
#ifndef H5FED_HH
|
||||
#define H5FED_HH
|
||||
|
||||
namespace H5Fed
|
||||
{
|
||||
/** \brief Define return codes */
|
||||
enum H5FED_RETURN_CODE{OKCODE=0,ERROR=-1};
|
||||
|
||||
|
||||
|
||||
class H5Fed
|
||||
{
|
||||
public:
|
||||
|
||||
/** \brief infrastructure routines */
|
||||
H5Fed(); /** \brief Constructor without argument */
|
||||
H5Fed(std::string filename); /** \brief Constructor without argument */
|
||||
~H5Fed(); /** \brief Class destructor */
|
||||
|
||||
H5FED_RETURN_CODE filename(std::string filename); /** \brief Set name of H5Fed file to be accessed */
|
||||
std::string filename(); /** \brief retrieve name of H5Fed file to be accessed */
|
||||
|
||||
/****** General routines *****************************************************/
|
||||
H5FED_RETURN_CODE open_file(); /** \brief open the file */
|
||||
H5FED_RETURN_CODE closeFile(); /** \brief close the file */
|
||||
|
||||
|
||||
/****** INQUIRY routines *****************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****** STORE routines*****************************************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the the coordinates of a specific vertex at level \c level
|
||||
with id \c vertex_id of the tetrahedral mesh.
|
||||
|
||||
\return value \c >=0 on success
|
||||
\return \c -1 on error
|
||||
*/
|
||||
H5FED_RETURN_CODE storeVertexCoordinate(
|
||||
unsigned int level, /*!< mesh level */
|
||||
unsigned int vertex_id, /*!< global vertex id */
|
||||
std::vector<double> /*!< 3-tuple of coordinates */
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the 4-tuple, that contains the specific indices describing
|
||||
a tetrahedron with id \c tet_id at level \c level of the tetrahedral
|
||||
mesh.
|
||||
|
||||
\return value \c >=0 on success
|
||||
\return \c -1 on error
|
||||
*/
|
||||
H5FED_RETURN_CODE H5FedStoreTetrahedron (
|
||||
const unsigned int level, /*!< mesh level */
|
||||
const unsigned int tet_id, /*!< global tetrahedron id */
|
||||
const unsigned int parent_id, /*!< parent id if level \c >0 else \x -1 */
|
||||
const std::vector<unsigned int> tet /*!< 4-tuple with vertex id's */
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****** UPWARD ADJACENCY routines *********************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/****** DOWNWARD ADJACENCY routines *********************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****** routines for accessing degrees of freedom DoF *************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
private:
|
||||
/** book keeping */
|
||||
std::string filename_; /** \brief Name of H5Fed file to be accessed */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif /** H5FED_HH */
|
||||
@@ -1,18 +0,0 @@
|
||||
# COMPILERS
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
|
||||
LIBS = @LIBS@
|
||||
AM_CPPFLAGS = -I../include @AM_CPPFLAGS@
|
||||
|
||||
OBJEXT = o
|
||||
|
||||
lib_LIBRARIES = libH5XX.a
|
||||
include_HEADERS = H5Fed.hh
|
||||
libH5XX_a_SOURCES = H5Fed.cc
|
||||
|
||||
libH5XX.a: $(libH5XX_a_OBJECTS)
|
||||
${AR} rucs $@ $^
|
||||
|
||||
%.o : %.cc
|
||||
$(CXX) $(CFLAGS) $(INC) -c $<
|
||||
-379
@@ -1,379 +0,0 @@
|
||||
/*
|
||||
Copyright 2007-2008
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
Some conventions:
|
||||
Functions:
|
||||
Name:
|
||||
thisIsAFunction()
|
||||
Return values:
|
||||
negative value or NULL signals an error
|
||||
|
||||
|
||||
Macros:
|
||||
UPPERCASE_WITH_UNDERSCORE
|
||||
\note
|
||||
In function names we use the words \b get and \b store insteed of
|
||||
\b read and \b write, because no I/O is actually done in these
|
||||
functions.
|
||||
*/
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5.h"
|
||||
|
||||
/****** General routines *****************************************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Open file with name \c filbename. This function is available in the parallel
|
||||
and serial version. In the serial case \c comm may have any value.
|
||||
|
||||
File mode flags are:
|
||||
- H5_O_RDONLY: only reading allowed
|
||||
- H5_O_WRONLY: create new file, dataset must not exist
|
||||
- H5_O_APPEND: allows to append a new datasets to an existing file
|
||||
- H5_O_RDWR: dataset may exist
|
||||
|
||||
You can also select a "virtual file driver" in the HDF5 layer using:
|
||||
- H5_VFD_INDEPENDENT: MPI-IO in independent (asynchronous) mode
|
||||
- H5_VFD_MPIPOSIX: parallel I/O implemented directly by HDF5, bypassing MPI-IO
|
||||
|
||||
\return File handle.
|
||||
\return NULL on error.
|
||||
*/
|
||||
h5_file_p
|
||||
H5OpenFile (
|
||||
const char* filename, /*!< file name */
|
||||
h5_int32_t flags, /*!< file open flags */
|
||||
MPI_Comm comm /*!< MPI communicator */
|
||||
) {
|
||||
H5_API_ENTER (h5_file_p, "filename='%s', flags=%d, ...",filename,flags);
|
||||
H5_API_RETURN (h5_open_file (filename, flags, comm, 0));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Close file and free all memory associated with the file handle.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5CloseFile (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_close_file (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Verify that the file handle points to a valid H5hut file structure.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5CheckFile (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_check_filehandle (f));
|
||||
}
|
||||
|
||||
|
||||
h5_err_t
|
||||
H5FlushStep (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_flush_step (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FlushFile (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_flush_file (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Define format of the step names.
|
||||
|
||||
Example: ==H5SetStepNameFormat( f, "Step", 6 )== defines step names
|
||||
like ==Step#000042==.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5SetStepNameFormat (
|
||||
h5_file_t* const f, /*!< Handle to file */
|
||||
const char* name, /*!< Prefix */
|
||||
const h5_int64_t width /*!< Width of the number */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', width=%lld",
|
||||
f, name, (long long) width);
|
||||
H5_API_RETURN (h5_set_stepname_fmt (f, name, width));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Get format of the step names.
|
||||
|
||||
\return value \c >=0 on success
|
||||
\return -1 on error
|
||||
*/
|
||||
h5_err_t
|
||||
H5GetStepNameFormat (
|
||||
h5_file_t* const f, /*!< Handle to file */
|
||||
char* name, /*!< OUT: Prefix */
|
||||
const h5_size_t l_name, /*!< length of buffer name */
|
||||
int* width /*!< OUT: Width of the number */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name=%p, l_name=%llu, width=%p",
|
||||
f, name, (unsigned long long)l_name, width);
|
||||
H5_API_RETURN (h5_get_stepname_fmt (f, name, l_name, width));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Set the current step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5SetStep (
|
||||
h5_file_t* const f, /*!< [in] Handle to open file */
|
||||
const h5_id_t step /*!< [in] Step to set. */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, step=%lld", f, (long long)step);
|
||||
H5_API_RETURN (h5_set_step (f, step));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Get current step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_id_t
|
||||
H5GetStep (
|
||||
h5_file_t* const f /*!< Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_step (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Get the number of processors.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return Number of processors.
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
int
|
||||
H5GetNumProcs (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_procs(f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Get the number of time-steps that are currently stored in the file
|
||||
\c f.
|
||||
|
||||
It works for both reading and writing of files, but is probably
|
||||
only typically used when you are reading.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return number of time-steps or error code
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5GetNumSteps (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_steps(f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_inquiry
|
||||
|
||||
Query whether a particular step already exists in the file.
|
||||
|
||||
\param[in] f File handle.
|
||||
\param[in] stepno Step number to query for existence
|
||||
|
||||
\return true or false
|
||||
*/
|
||||
h5_err_t
|
||||
H5HasStep (
|
||||
h5_file_t* const f,
|
||||
h5_id_t stepno
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, stepno=%lld",
|
||||
f, (long long)stepno);
|
||||
H5_API_RETURN (h5_has_step (f, stepno));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Start traversing steps.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5StartTraverseSteps (
|
||||
h5_file_t* const f /*!< Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_start_traverse_steps (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Traverse steps.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5TraverseSteps (
|
||||
h5_file_t* const f /*!< Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_traverse_steps (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Set the `throttle` factor, which causes HDF5 write and read
|
||||
calls to be issued in that number of batches.
|
||||
|
||||
This can prevent large concurrency parallel applications that
|
||||
use independent writes from overwhelming the underlying
|
||||
parallel file system.
|
||||
|
||||
Throttling only works with the H5_VFD_MPIPOSIX or
|
||||
H5_VFD_INDEPENDENT drivers and is only available in
|
||||
the parallel library.
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
#ifdef PARALLEL_IO
|
||||
h5_err_t
|
||||
H5SetThrottle (
|
||||
h5_file_t* f,
|
||||
int factor
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, factor=%d", f, factor);
|
||||
H5_API_RETURN (h5_set_throttle(f, factor));
|
||||
}
|
||||
#endif // PARALLEL_IO
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
Set verbosity level to \c level.
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
h5_err_t
|
||||
H5SetVerbosityLevel (
|
||||
const h5_id_t level
|
||||
) {
|
||||
return h5_set_debuglevel (level);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
Set error handler to \c handler.
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
h5_err_t
|
||||
H5SetErrorHandler (
|
||||
h5_errorhandler_t handler
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "handler=%p", handler);
|
||||
H5_API_RETURN (h5_set_errorhandler (handler));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
Get current error handler.
|
||||
|
||||
\return Pointer to error handler.
|
||||
*/
|
||||
h5_errorhandler_t
|
||||
H5GetErrorHandler (
|
||||
void
|
||||
) {
|
||||
H5_API_ENTER (h5_errorhandler_t, "%s", "void");
|
||||
H5_API_RETURN (h5_get_errorhandler());
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5ReportErrorhandler (
|
||||
const char* fmt,
|
||||
va_list ap
|
||||
) {
|
||||
return h5_report_errorhandler (fmt, ap);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5AbortErrorhandler (
|
||||
const char* fmt,
|
||||
va_list ap
|
||||
) {
|
||||
return h5_abort_errorhandler (fmt, ap);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
Get last error code.
|
||||
|
||||
\return error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5GetErrno (
|
||||
void
|
||||
) {
|
||||
return h5_get_errno ();
|
||||
}
|
||||
|
||||
|
||||
-676
@@ -1,676 +0,0 @@
|
||||
/*!
|
||||
\defgroup h5block_c_api H5Block C API
|
||||
*/
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
\defgroup h5block_kernel H5Block Kernel
|
||||
*/
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
\defgroup h5block_private H5Block Private
|
||||
*/
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
\defgroup h5block_model Setting up the Data Model
|
||||
*/
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
\defgroup h5block_data Reading and Writing Datasets
|
||||
*/
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
\defgroup h5block_attrib Reading and Writing Attributes
|
||||
*/
|
||||
|
||||
/*!
|
||||
\note
|
||||
Different field sizes are allowed in the same time-step.
|
||||
|
||||
\note
|
||||
The same layout can be used, if the size of the field matches the
|
||||
size of the layout. If the size of the layout doesn't match the
|
||||
size of the field, an error will be indicated.
|
||||
|
||||
\note
|
||||
In write mode partitions are shrinked to make them non-overlaping. This
|
||||
process may shrink the partitions more than required.
|
||||
|
||||
\note
|
||||
In read-mode partitions may not cross boundaries. This means, if the grid
|
||||
size is (X, Y, Z), all partitions must fit into this grid.
|
||||
|
||||
|
||||
\todo
|
||||
check whether layout is reasonable
|
||||
|
||||
API function names
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "h5core/h5_core.h"
|
||||
|
||||
/********************** defining the layout **********************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Tests whether a view has been set, either directly with
|
||||
\ref H5Block3dSetView or indirectly with \ref H5Block3dSetGrid.
|
||||
|
||||
\return 0 on false, 1 on true
|
||||
*/
|
||||
h5_int64_t
|
||||
H5Block3dHasView (
|
||||
h5_file_t *const f /*!< IN: File handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", f);
|
||||
H5_API_RETURN (h5b_3d_has_view (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Defines the partition of the field that this processor owns, using
|
||||
Fortran ordering: the fastest moving index is \c i.
|
||||
|
||||
This routine uses an MPI_Allgather, so at large concurrency it should
|
||||
be called as infrequently as possible. For instance, if several timesteps
|
||||
use the same field dimensions, set the layout only once before the
|
||||
first timestep.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dSetView (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_int64_t i_start, /*!< IN: start index of \c i */
|
||||
const h5_int64_t i_end, /*!< IN: end index of \c i */
|
||||
const h5_int64_t j_start, /*!< IN: start index of \c j */
|
||||
const h5_int64_t j_end, /*!< IN: end index of \c j */
|
||||
const h5_int64_t k_start, /*!< IN: start index of \c k */
|
||||
const h5_int64_t k_end /*!< IN: end index of \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%lld, i_end=%lld, "
|
||||
"j_start=%lld, j_end=%lld, "
|
||||
"k_start=%lld, k_end=%lld",
|
||||
f,
|
||||
(long long)i_start, (long long)i_end,
|
||||
(long long)j_start, (long long)j_end,
|
||||
(long long)k_start, (long long)k_end);
|
||||
H5_API_RETURN (h5b_3d_set_view(f, i_start, i_end, j_start, j_end, k_start, k_end));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Return the view of this processor.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dGetView (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
h5_size_t *i_start, /*!< OUT: start index of \c i */
|
||||
h5_size_t *i_end, /*!< OUT: end index of \c i */
|
||||
h5_size_t *j_start, /*!< OUT: start index of \c j */
|
||||
h5_size_t *j_end, /*!< OUT: end index of \c j */
|
||||
h5_size_t *k_start, /*!< OUT: start index of \c k */
|
||||
h5_size_t *k_end /*!< OUT: end index of \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
f,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
H5_API_RETURN (h5b_3d_get_view (f, i_start, i_end, j_start, j_end, k_start, k_end));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Return the reduced (ghost-zone free) view of this processor.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dGetReducedView (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
h5_size_t *const i_start, /*!< OUT: start index of \c i */
|
||||
h5_size_t *const i_end, /*!< OUT: end index of \c i */
|
||||
h5_size_t *const j_start, /*!< OUT: start index of \c j */
|
||||
h5_size_t *const j_end, /*!< OUT: end index of \c j */
|
||||
h5_size_t *const k_start, /*!< OUT: start index of \c j */
|
||||
h5_size_t *const k_end /*!< OUT: end index of \c j */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
f,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
H5_API_RETURN (h5b_3d_get_reduced_view(f, i_start, i_end, j_start, j_end, k_start, k_end));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Define the chunk dimensions and enable chunking in the underlying
|
||||
HDF5 dataset.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dSetChunk (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: size of \c i */
|
||||
const h5_size_t j, /*!< IN: size of \c j */
|
||||
const h5_size_t k /*!< IN: size of \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_chunk(f, i, j, k));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Lookup the chunk dimensions of the underlying HDF5 dataset.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dGetChunk (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const char *field_name, /*!< IN: name of dataset */
|
||||
h5_size_t *const i, /*!< OUT: size of \c i */
|
||||
h5_size_t *const j, /*!< OUT: size of \c j */
|
||||
h5_size_t *const k /*!< OUT: size of \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%p, j=%p, k=%p",
|
||||
f, i, j, k);
|
||||
H5_API_RETURN (h5b_3d_get_chunk(f, field_name, i, j, k));
|
||||
}
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Define an underlying 3D Cartesian grid on the processors with dimensions
|
||||
(\c i,\c j,\c k). You can look up a processor's index into the grid
|
||||
using \ref H5Block3dGetGridCoords.
|
||||
|
||||
This function can be used in conjunction with \ref H5Block3dSetDims
|
||||
to setup the view for a regular grid.
|
||||
|
||||
The product of the dimensions must equal the size of the MPI communicator.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dSetGrid (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: dimension in \c i */
|
||||
const h5_size_t j, /*!< IN: dimension in \c j */
|
||||
const h5_size_t k /*!< IN: dimension in \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_grid(f, i, j, k));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Look up the index (\c i, \c j, \c k) in the grid belonging to MPI processor
|
||||
\c proc.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dGetGridCoords (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const int proc, /*!< IN: MPI processor */
|
||||
h5_int64_t *i, /*!< OUT: index in \c i */
|
||||
h5_int64_t *j, /*!< OUT: index in \c j */
|
||||
h5_int64_t *k /*!< OUT: index in \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, proc=%d, i=%p, j=%p, k=%p",
|
||||
f, proc, i, j, k);
|
||||
H5_API_RETURN (h5b_3d_get_grid_coords(f, proc, i, j, k));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Set the dimensions of each processor's block when the field is a regular
|
||||
grid.
|
||||
|
||||
A grid must be already set with \ref H5Block3dSetGrid, and all processors
|
||||
must specify the same dimensions.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dSetDims (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: dimension in \c i */
|
||||
const h5_size_t j, /*!< IN: dimension in \c j */
|
||||
const h5_size_t k /*!< IN: dimension in \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_dims(f, i, j, k));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Sets the additional cells (\c i, \c j, \c k) in each direction to use as
|
||||
the `halo` region (or `ghost zone`) that overlaps between neighboring
|
||||
processors on the grid.
|
||||
|
||||
A grid with dimensions must already be set with \ref H5Block3dSetGrid and
|
||||
\ref H5Block3dSetDims, and all processors must specify the same halo radii.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dSetHalo (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: radius in \c i */
|
||||
const h5_size_t j, /*!< IN: radius in \c j */
|
||||
const h5_size_t k /*!< IN: radius in \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_halo(f, i, j, k));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Query number of fields in current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5BlockGetNumFields (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
H5_API_RETURN (h5b_get_num_fields(f));
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Get the name, rank and dimensions of the field specified by the
|
||||
index \c idx.
|
||||
|
||||
\c elem_rank reports the rank of the elements in the field
|
||||
(e.g. scalar or vector).
|
||||
|
||||
This function can be used to retrieve all fields bound to the
|
||||
current time-step by looping from \c 0 to the number of fields
|
||||
minus one. The number of fields bound to the current time-step
|
||||
can be queried by calling the function \ref H5BlockGetNumFields.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockGetFieldInfo (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const h5_size_t idx, /*!< IN: index of field */
|
||||
char *name, /*!< OUT: field name */
|
||||
const h5_size_t len_name, /*!< IN: buffer size */
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_size_t *field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, idx=%llu, "
|
||||
"name=%p, len_name=%llu, "
|
||||
"field_rank=%p, field_dims=%p, elem_rank=%p, type=%p",
|
||||
f, (long long unsigned)idx,
|
||||
name, (long long unsigned)len_name,
|
||||
field_rank, field_dims, elem_rank,
|
||||
type);
|
||||
H5_API_RETURN (
|
||||
h5b_get_field_info (
|
||||
f,
|
||||
idx,
|
||||
name,
|
||||
len_name,
|
||||
field_rank,
|
||||
field_dims,
|
||||
elem_rank,
|
||||
type));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Get the rank and dimensions of the field specified by its name.
|
||||
See \ref H5BlockGetFieldInfo.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockGetFieldInfoByName (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: field name */
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_size_t *field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', "
|
||||
"field_rank=%p, field_dims=%p, elem_rank=%p, type=%p",
|
||||
f, name, field_rank, field_dims, elem_rank, type);
|
||||
H5_API_RETURN (
|
||||
h5b_get_field_info_by_name (
|
||||
f,
|
||||
name,
|
||||
field_rank,
|
||||
field_dims,
|
||||
elem_rank,
|
||||
type));
|
||||
}
|
||||
|
||||
/********************** reading and writing attribute ************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write the string \c value as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockWriteFieldAttribString (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const char *buffer /*!< IN: attribute value */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer='%s'",
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
buffer);
|
||||
H5_API_RETURN (
|
||||
h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_CHAR,
|
||||
buffer,
|
||||
strlen(buffer) + 1));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read the string value from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockReadFieldAttribString (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
char *buffer /*!< OUT: attribute value */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer=%p",
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
buffer);
|
||||
H5_API_RETURN (
|
||||
h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Query the number of attributes of field \c field_name.
|
||||
|
||||
\return number of attributes or error code
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5BlockGetNumFieldAttribs (
|
||||
h5_file_t *const f, /*<! IN: file handle */
|
||||
const char *field_name /*<! IN: field name */
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p, field_name='%s'", f, field_name);
|
||||
H5_API_RETURN (h5b_get_num_field_attribs (f, field_name));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Gets the name, type and number of elements of the field attribute
|
||||
specified by its index.
|
||||
|
||||
This function can be used to retrieve all attributes bound to the
|
||||
specified field by looping from \c 0 to the number of attribute
|
||||
minus one. The number of attributes bound to the
|
||||
field can be queried by calling \ref H5BlockGetNumFieldAttribs.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockGetFieldAttribInfo (
|
||||
h5_file_t *const f, /*<! IN: Handle to open file */
|
||||
const char *field_name, /*<! IN: field name */
|
||||
const h5_size_t attrib_idx, /*<! IN: Index of attribute to
|
||||
get infos about */
|
||||
char *attrib_name, /*<! OUT: Name of attribute */
|
||||
const h5_size_t len_attrib_name,
|
||||
/*<! IN: length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*<! OUT: Type of value. */
|
||||
h5_size_t *attrib_nelem /*<! OUT: Number of elements */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p field_name='%s', "
|
||||
"attrib_idx=%llu, "
|
||||
"attrib_name=%p, len_attrib_name=%llu, "
|
||||
"attrib_type=%p, "
|
||||
"attrib_nelem=%p",
|
||||
f,
|
||||
field_name,
|
||||
(long long unsigned)attrib_idx,
|
||||
attrib_name, (long long unsigned)len_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem);
|
||||
H5_API_RETURN (
|
||||
h5b_get_field_attrib_info (
|
||||
f,
|
||||
field_name,
|
||||
attrib_idx,
|
||||
attrib_name,
|
||||
len_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem));
|
||||
}
|
||||
|
||||
#define H5BLOCK_FIELD_ORIGIN_NAME "__Origin__"
|
||||
#define H5BLOCK_FIELD_SPACING_NAME "__Spacing__"
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Get field origin.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dGetFieldOrigin (
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
h5_float64_t *x_origin, /*!< OUT: X origin */
|
||||
h5_float64_t *y_origin, /*!< OUT: Y origin */
|
||||
h5_float64_t *z_origin /*!< OUT: Z origin */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_origin=%p, y_origin=%p, z_origin=%p",
|
||||
f, field_name, x_origin, y_origin, z_origin);
|
||||
h5_float64_t origin[3];
|
||||
|
||||
TRY (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_ORIGIN_NAME,
|
||||
H5_FLOAT64_T,
|
||||
origin));
|
||||
|
||||
*x_origin = origin[0];
|
||||
*y_origin = origin[1];
|
||||
*z_origin = origin[2];
|
||||
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Set field origin.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dSetFieldOrigin (
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const h5_float64_t x_origin, /*!< IN: X origin */
|
||||
const h5_float64_t y_origin, /*!< IN: Y origin */
|
||||
const h5_float64_t z_origin /*!< IN: Z origin */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_origin=%g, y_origin=%g, z_origin=%g",
|
||||
f, field_name, x_origin, y_origin, z_origin);
|
||||
h5_float64_t origin[3] = { x_origin, y_origin, z_origin };
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_ORIGIN_NAME,
|
||||
(hid_t)H5_FLOAT64_T,
|
||||
origin,
|
||||
3));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Get field spacing for field \c field_name in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dGetFieldSpacing (
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
h5_float64_t *x_spacing, /*!< OUT: X spacing */
|
||||
h5_float64_t *y_spacing, /*!< OUT: Y spacing */
|
||||
h5_float64_t *z_spacing /*!< OUT: Z spacing */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_spacing=%p, y_spacing=%p, z_spacing=%p",
|
||||
f, field_name, x_spacing, y_spacing, z_spacing);
|
||||
h5_float64_t spacing[3];
|
||||
TRY (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_SPACING_NAME,
|
||||
H5_FLOAT64_T,
|
||||
spacing));
|
||||
*x_spacing = spacing[0];
|
||||
*y_spacing = spacing[1];
|
||||
*z_spacing = spacing[2];
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Set field spacing for field \c field_name in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dSetFieldSpacing (
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const h5_float64_t x_spacing, /*!< IN: X spacing */
|
||||
const h5_float64_t y_spacing, /*!< IN: Y spacing */
|
||||
const h5_float64_t z_spacing /*!< IN: Z spacing */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_spacing=%g, y_spacing=%g, z_spacing=%g",
|
||||
f, field_name, x_spacing, y_spacing, z_spacing);
|
||||
h5_float64_t spacing[3] = { x_spacing, y_spacing, z_spacing };
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_SPACING_NAME,
|
||||
(hid_t)H5_FLOAT64_T,
|
||||
spacing,
|
||||
3));
|
||||
}
|
||||
|
||||
@@ -1,625 +0,0 @@
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5Block_readwrite.h"
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
floating points (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteScalarFieldFloat64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float64_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
floating points (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadScalarFieldFloat64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_float64_t *buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteVector3dFieldFloat64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float64_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_float64_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_float64_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_write_vector3d_data(f, name,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadVector3dFieldFloat64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_float64_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_float64_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_float64_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
floating points (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteScalarFieldFloat32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float32_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_FLOAT ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
floating points (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadScalarFieldFloat32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_float32_t *const buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteVector3dFieldFloat32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float32_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_float32_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_float32_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_write_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadVector3dFieldFloat32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_float32_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_float32_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_float32_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
integers (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteScalarFieldInt64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int64_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_INT64 ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
integers (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadScalarFieldInt64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_int64_t *const buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteVector3dFieldInt64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int64_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_int64_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_int64_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN (h5b_write_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadVector3dFieldInt64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_int64_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_int64_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_int64_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN (h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
integers (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteScalarFieldInt32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int32_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_INT32 ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
integers (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadScalarFieldInt32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_int32_t *const buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dWriteVector3dFieldInt32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int32_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_int32_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_int32_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_write_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block3dReadVector3dFieldInt32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_int32_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_int32_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_int32_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write float64 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockWriteFieldAttribFloat64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_float64_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read float64 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockReadFieldAttribFloat64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_float64_t *buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
(void*)buffer ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write float32 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockWriteFieldAttribFloat32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_float32_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read float32 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockReadFieldAttribFloat32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_float32_t *const buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
buffer ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write int64 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockWriteFieldAttribInt64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_int64_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT64,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read int64 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockReadFieldAttribInt64 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_int64_t *const buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT64,
|
||||
buffer ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write int32 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockWriteFieldAttribInt32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_int32_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT32,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read int32 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockReadFieldAttribInt32 (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_int32_t *buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT32,
|
||||
(void*)buffer ));
|
||||
}
|
||||
-604
@@ -1,604 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h> /* va_arg - System dependent ?! */
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <hdf5.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#else /* WIN32 */
|
||||
#include <io.h>
|
||||
#define open _open
|
||||
#define close _close
|
||||
#endif /* WIN32 */
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5Part.h"
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Set the number of particles for the current time-step.
|
||||
After you call this subroutine, all subsequent
|
||||
operations will assume this number of particles will be written.
|
||||
|
||||
For the parallel library, the \c nparticles value is the number of
|
||||
particles that the \e individual task will write. You can use
|
||||
a different value on different tasks.
|
||||
This function uses an \c MPI_Allgather
|
||||
call to aggregate each tasks number of particles and determine
|
||||
the appropiate offsets. Because of the use of this MPI collective,
|
||||
it is advisable to call this function as
|
||||
few times as possible when running at large concurrency.
|
||||
|
||||
This function assumes that your particles' data fields are in stored in
|
||||
contiguous 1D arrays.
|
||||
For instance, the fields \e x and \e y for your particles are stored
|
||||
in separate arrays \c x[] and \c y[].
|
||||
|
||||
If instead you store your particles as tuples, so that the values
|
||||
are arranged \f$ x_1,y_1,x_2,y_2\f$... than you need to setup striding
|
||||
(in this case with value 2) using \ref H5PartSetNumParticlesStrided.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetNumParticles (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_size_t nparticles /*!< [in] Number of particles */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, nparticles=%llu",
|
||||
f, (long long unsigned)nparticles);
|
||||
h5_size_t stride = 1;
|
||||
H5_API_RETURN (h5u_set_num_particles(f, nparticles, stride));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Set the number of particles for the current time-step.
|
||||
After you call this subroutine, all subsequent
|
||||
operations will assume this number of particles will be written.
|
||||
|
||||
For the parallel library, the \c nparticles value is the number of
|
||||
particles that the \e individual task will write. You can use
|
||||
a different value on different tasks.
|
||||
This function uses an \c MPI_Allgather
|
||||
call to aggregate each tasks number of particles and determine
|
||||
the appropiate offsets. Because of the use of this MPI collective,
|
||||
it is advisable to call this function as
|
||||
few times as possible when running at large concurrency.
|
||||
|
||||
This function assumes that your particles' data fields are
|
||||
stored tuples. For instance, the fields \e x and \e y of your
|
||||
particles are arranged \f$x_1,y_1,x_2,y_2\f$... in a single data
|
||||
array. In this example, the stride value would be 2.
|
||||
|
||||
If you instead have a separate array for each fields,
|
||||
such as \c x[] and \c y[],
|
||||
use \ref H5PartSetNumParticles.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetNumParticlesStrided (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_size_t nparticles, /*!< [in] Number of particles */
|
||||
h5_size_t stride /*!< [in] Stride value (e.g. number of fields in the particle array) */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, nparticles=%llu, stride=%llu",
|
||||
f, (long long unsigned)nparticles,
|
||||
(long long unsigned)stride);
|
||||
H5_API_RETURN (h5u_set_num_particles (f, nparticles, stride));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Define the chunk \c size and enables chunking in the underlying
|
||||
HDF5 layer.
|
||||
|
||||
Note that this policy wastes disk space, but can improve write
|
||||
bandwidth on parallel filesystems that are sensitive to write alignment
|
||||
(e.g. lustre). It is only recommended when using the MPI-POSIX or MPI-IO
|
||||
independent VFDs (see \ref H5OpenFile).
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetChunk (
|
||||
h5_file_t *f,
|
||||
h5_size_t size
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, size=%llu", f, (long long unsigned)size);
|
||||
H5_API_RETURN (h5u_set_chunk (f, size));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 64 bit floating point data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartWriteDataFloat64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_float64_t *data /*!< [in] Array to commit to disk */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_write_data (f, name, (void*)data, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 32 bit floating point data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartWriteDataFloat32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_float32_t *data /*!< [in] Array to commit to disk */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
h5_err_t h5err = h5u_write_data( f, name, (void*)data, H5T_NATIVE_FLOAT );
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 64 bit integer data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartWriteDataInt64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_int64_t *data /*!< [in] Array to commit to disk */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_write_data (f, name, (void*)data, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 32 bit integer data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartWriteDataInt32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_int32_t *data /*!< [in] Array to commit to disk */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_write_data (f, name, (void*)data, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 64 bit floating point data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartReadDataFloat64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_float64_t *data /*!< [out] Array of data */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 32 bit floating point data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartReadDataFloat32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_float32_t *data /*!< [out] Array of data */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 64 bit integer data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartReadDataInt64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_int64_t *data /*!< [out] Array of data */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 32 bit integer data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartReadDataInt32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_int32_t *data /*!< [out] Array of data */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Get the number of datasets that are stored at the current time-step.
|
||||
|
||||
\return number of datasets in current timestep or error code
|
||||
*/
|
||||
|
||||
h5_ssize_t
|
||||
H5PartGetNumDatasets (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_get_num_datasets(f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
This reads the name of a dataset specified by it's index in the current
|
||||
time-step.
|
||||
|
||||
If the number of datasets is \c n, the range of \c _index is \c 0 to \c n-1.
|
||||
|
||||
\result \c H5_SUCCESS
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartGetDatasetName (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_id_t idx, /*!< [in] Index of the dataset */
|
||||
char *name, /*!< [out] Name of dataset */
|
||||
const h5_size_t len /*!< [in] Size of buffer \c name */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"idx=%lld, "
|
||||
"name='%p', len=%llu, ",
|
||||
f,
|
||||
(long long)idx,
|
||||
name, (unsigned long long)len);
|
||||
H5_API_RETURN (h5u_get_dataset_info(f, idx, name, len, NULL, NULL));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Gets the name, type and number of elements of a dataset based on its
|
||||
index in the current timestep.
|
||||
|
||||
Type is one of the following values:
|
||||
|
||||
- \c H5_FLOAT64_T (for \c h5_float64_t)
|
||||
- \c H5_FLOAT32_T (for \c h5_float32_t)
|
||||
- \c H5_INT64_T (for \c h5_int64_t)
|
||||
- \c H5_INT32_T (for \c h5_int32_t)
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartGetDatasetInfo (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_id_t idx, /*!< [in] Index of the dataset */
|
||||
char *dataset_name, /*!< [out] Name of dataset */
|
||||
const h5_size_t len_dataset_name,
|
||||
/*!< [in] Size of buffer \c dataset_name */
|
||||
h5_int64_t *type, /*!< [out] Type of data in dataset */
|
||||
h5_size_t *nelem /*!< [out] Number of elements. */
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, "
|
||||
"idx=%lld, "
|
||||
"dataset_name='%p', len_dataset_name=%llu, "
|
||||
"type=%p, nelem=%p",
|
||||
f,
|
||||
(long long)idx,
|
||||
dataset_name, (long long unsigned)len_dataset_name,
|
||||
type, nelem);
|
||||
H5_API_RETURN (h5u_get_dataset_info (
|
||||
f, idx, dataset_name, len_dataset_name, type, nelem));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
This function returns the number of particles in this processor's view,
|
||||
if a view has been set.
|
||||
|
||||
If not, it returns the total number of particles across all processors
|
||||
from the last \ref H5PartSetNumParticles call.
|
||||
|
||||
If you have neither set the number of particles
|
||||
nor set a view, then this returns the total number of
|
||||
particles in the first data set of the current time step.
|
||||
Note that H5Part assumes that all data sets within a given time step
|
||||
have the same number of particles (although the number particles can
|
||||
vary across time steps).
|
||||
|
||||
If none of these conditions are met, an error is thrown.
|
||||
|
||||
\return number of particles in current timestep or an error
|
||||
code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5PartGetNumParticles (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
CHECK_FILEHANDLE( f );
|
||||
H5_API_RETURN (h5u_get_num_particles (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Reset the view.
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartResetView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_reset_view (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Check whether a view has been set, either automatically with
|
||||
\ref H5PartSetNumParticles or manually with \ref H5PartSetView
|
||||
or \ref H5PartSetViewIndices.
|
||||
|
||||
\return 0 for false or 1 for true
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartHasView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_has_view (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
For parallel I/O or for subsetting operations on the datafile,
|
||||
this function allows you to define a subset of the total
|
||||
particle dataset to operate on.
|
||||
The concept of "view" works for both serial
|
||||
and for parallel I/O. The "view" will remain in effect until a new view
|
||||
is set, or the number of particles in a dataset changes, or the view is
|
||||
"unset" by calling \c H5PartSetView(file,-1,-1);
|
||||
|
||||
Before you set a view, \ref H5PartGetNumParticles will return the
|
||||
total number of particles in the current time-step (even for the parallel
|
||||
reads). However, after you set a view, it will return the number of
|
||||
particles contained in the view.
|
||||
|
||||
The range is \e inclusive: the end value is the last index of the
|
||||
data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetView (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t start, /*!< [in] Start particle */
|
||||
h5_int64_t end /*!< [in] End particle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, start=%lld, end=%lld",
|
||||
f, (long long)start, (long long)end);
|
||||
H5_API_RETURN (h5u_set_view (f, start, end));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
For parallel I/O or for subsetting operations on the datafile,
|
||||
this function allows you to define a subset of the total
|
||||
dataset to operate on by specifying a list of indices.
|
||||
The concept of "view" works for both serial
|
||||
and for parallel I/O. The "view" will remain in effect until a new view
|
||||
is set, or the number of particles in a dataset changes, or the view is
|
||||
"unset" by calling \c H5PartSetViewIndices(NULL,0);
|
||||
|
||||
When you perform a read or write on a view consisting of indices, it
|
||||
is assumed that your buffer is \b unpacked, meaning that there is room
|
||||
for all the intermediate values (which will not be touched by the read
|
||||
or write).
|
||||
|
||||
Before you set a view, the \c H5PartGetNumParticles() will return the
|
||||
total number of particles in the current time-step (even for the parallel
|
||||
reads). However, after you set a view, it will return the number of
|
||||
particles contained in the view.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetViewIndices (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_size_t *indices, /*!< [in] List of indices */
|
||||
h5_size_t nelems /*!< [in] Size of list */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, indices=%p, nelems=%llu",
|
||||
f, indices, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5u_set_view_indices (f, indices, nelems));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Allows you to query the current view. Start and End
|
||||
will be \c -1 if there is no current view established.
|
||||
Use \c H5PartHasView() to see if the view is smaller than the
|
||||
total dataset.
|
||||
|
||||
\return number of elements in the view or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartGetView (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t *start, /*!< [out] Start particle */
|
||||
h5_int64_t *end /*!< [out] End particle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, start=%p, end=%p",
|
||||
f, start, end);
|
||||
H5_API_RETURN (h5u_get_view (f, start, end));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
If it is too tedious to manually set the start and end coordinates
|
||||
for a view, the \c H5SetCanonicalView() will automatically select an
|
||||
appropriate domain decomposition of the data arrays for the degree
|
||||
of parallelism and set the "view" accordingly.
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5PartSetCanonicalView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_set_canonical_view (f));
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5hut.h"
|
||||
|
||||
h5_ssize_t
|
||||
H5GetNumAttachments (
|
||||
h5_file_t* const f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_attachments (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5GetAttachmentInfoByIdx (
|
||||
h5_file_t* const f,
|
||||
const h5_size_t idx, // IN
|
||||
char* const fname, // OUT
|
||||
h5_size_t len_fname, // IN
|
||||
h5_size_t* const fsize // OUT
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"idx=%llu, fname=%p, len_fname=%llu, fsize=%p",
|
||||
(long long unsigned)idx,
|
||||
fname, (long long unsigned)len_fname,
|
||||
fsize);
|
||||
H5_API_RETURN (h5_get_attachment_info_by_idx (
|
||||
f, idx, fname, len_fname, fsize));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5GetAttachmentInfoByName (
|
||||
h5_file_t* const f,
|
||||
char* const fname, // OUT
|
||||
h5_size_t* const fsize // OUT
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s', fsize=%p", fname, fsize);
|
||||
H5_API_RETURN (h5_get_attachment_info_by_name (
|
||||
f, fname, fsize));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5AddAttachment (
|
||||
h5_file_t* const f, /*!< [in] Handle to open file */
|
||||
const char* fname /*!< [in] Name of file to attach */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s'", fname);
|
||||
H5_API_RETURN (h5_add_attachment (f, fname));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5GetAttachment (
|
||||
h5_file_t* const f, /*!< [in] Handle to open file */
|
||||
const char* fname /*!< [in] Name of attachment */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s'", fname);
|
||||
H5_API_RETURN (h5_get_attachment (f, fname));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5DeleteAttachment (
|
||||
h5_file_t* const f,
|
||||
const char* const fname
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s'", fname);
|
||||
H5_API_RETURN (h5_delete_attachment (f, fname));
|
||||
}
|
||||
@@ -1,629 +0,0 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5hut.h"
|
||||
|
||||
|
||||
/*** WRITE ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with the string \c value to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const char *value /*!< [in] Value of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'", f, name, value);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_CHAR,
|
||||
value,
|
||||
strlen(value) + 1 ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with the string \c value to
|
||||
the current timestep.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const char *value /*!< [in] Value of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'", f, name, value);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_CHAR,
|
||||
value,
|
||||
strlen(value) + 1 ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float32 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
values,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float32 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
values,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float64 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float64 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int32 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_INT32,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int32 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_INT32,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int64 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_INT64,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int64 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5WriteStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_INT64,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
/*** READ ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read a string into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'", f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read a string into a \c buffer from an attribute \c name
|
||||
in the current timestep.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int32 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_INT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int32 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_INT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int64 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_INT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int64 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
h5_err_t h5err = h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_INT64_T,
|
||||
(void*)buffer);
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float32 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_FLOAT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float32 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_FLOAT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float64 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float64 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5ReadStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
/*** QUERY ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the number of attributes in the file's root ("/").
|
||||
|
||||
\return Number of attributes or error code.
|
||||
*/
|
||||
h5_int64_t
|
||||
H5GetNumFileAttribs (
|
||||
h5_file_t *const f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_attribs (f, H5_ATTRIB_FILE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the number of attributes bound to the current step.
|
||||
|
||||
\h5_err_t h5err = Number of attributes or error code.
|
||||
*/
|
||||
h5_int64_t
|
||||
H5GetNumStepAttribs (
|
||||
h5_file_t *const f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_attribs (f, H5_ATTRIB_STEP));
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the name, type and number of elements of the file attribute
|
||||
specified by its index.
|
||||
|
||||
This function can be used to retrieve all attributes bound to the
|
||||
file \c f by looping from \c 0 to the number of attribute minus
|
||||
one. The number of attributes bound to file \c f can be queried
|
||||
by calling \ref H5GetNumFileAttribs.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
|
||||
h5_err_t
|
||||
H5GetFileAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_size_t attrib_idx, /*!< [in] Index of attribute to get
|
||||
infos about */
|
||||
char *attrib_name, /*!< [out] Name of attribute */
|
||||
const h5_size_t len_of_attrib_name,
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"attrib_idx=%llu, attrib_name=%p, len_attrib_name=%llu, "
|
||||
"attrib_type=%p, attrib_nelem=%p",
|
||||
f,
|
||||
(long long unsigned)attrib_idx,
|
||||
attrib_name,
|
||||
(long long unsigned)len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem);
|
||||
H5_API_RETURN (h5_get_attrib_info (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
attrib_idx,
|
||||
attrib_name,
|
||||
len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the name, type and number of elements of the step attribute
|
||||
specified by its index.
|
||||
|
||||
This function can be used to retrieve all attributes bound to the
|
||||
current time-step by looping from \c 0 to the number of attribute
|
||||
minus one. The number of attributes bound to the current
|
||||
time-step can be queried by calling \ref H5GetNumStepAttribs.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5GetStepAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_size_t attrib_idx, /*!< [in] Index of attribute to
|
||||
get infos about */
|
||||
char *attrib_name, /*!< [out] Name of attribute */
|
||||
const h5_size_t len_of_attrib_name,
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"attrib_idx=%llu, attrib_name=%p, len_attrib_name=%llu, "
|
||||
"attrib_type=%p, attrib_nelem=%p",
|
||||
f,
|
||||
(unsigned long long)attrib_idx,
|
||||
attrib_name,
|
||||
(unsigned long long)len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem);
|
||||
H5_API_RETURN (h5_get_attrib_info (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
attrib_idx,
|
||||
attrib_name,
|
||||
len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem));
|
||||
}
|
||||
|
||||
+4
-24
@@ -1,15 +1,5 @@
|
||||
# src/C level Makefile.am
|
||||
|
||||
OBJEXT=o
|
||||
|
||||
AM_CPPFLAGS = -I../include @AM_CPPFLAGS@
|
||||
|
||||
# What to build... Will be determined by configure script.
|
||||
lib_LTLIBRARIES = @LIB_C@
|
||||
|
||||
# Listing of all possible targets that I may build.
|
||||
EXTRA_LTLIBRARIES = libH5hutC.la
|
||||
|
||||
if ENABLE_C
|
||||
# Header files that I wish to install in $(prefix)/include
|
||||
include_HEADERS = \
|
||||
../include/H5hut.h \
|
||||
@@ -29,19 +19,9 @@ include_HEADERS = \
|
||||
# Listing of all possible headers that I may include
|
||||
EXTRA_HEADERS =
|
||||
|
||||
# Listing of sources
|
||||
libH5hutC_la_SOURCES = \
|
||||
H5.c \
|
||||
H5_attribs.c \
|
||||
H5_attachments.c \
|
||||
H5Part.c \
|
||||
H5Block.c \
|
||||
H5Block_readwrite.c
|
||||
endif
|
||||
|
||||
libH5hutC_la_LDFLAGS = -version-info 2:0:0 -rpath '$(libdir)'
|
||||
|
||||
all-local:
|
||||
$(INSTALL) -m644 .libs/libH5hutC.a ../lib
|
||||
EXTRA_DIST = Makefile.in
|
||||
|
||||
clean-local:
|
||||
$(RM) ../lib/libH5hutC.a
|
||||
$(RM) *~
|
||||
|
||||
@@ -1,580 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
c_head = """
|
||||
#include "h5core/h5_core.h"
|
||||
"""
|
||||
|
||||
h_head = """
|
||||
#ifndef __H5BLOCK_READWRITE_H
|
||||
#define __H5BLOCK_READWRITE_H
|
||||
"""
|
||||
|
||||
h_tail = """
|
||||
#endif
|
||||
"""
|
||||
|
||||
fc_head = """
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "Underscore.h"
|
||||
|
||||
#if defined(F77_SINGLE_UNDERSCORE)
|
||||
#define F77NAME(a,b) a
|
||||
#elif defined(F77_CRAY_UNDERSCORE)
|
||||
#define F77NAME(a,b) b
|
||||
#elif defined(F77_NO_UNDERSCORE)
|
||||
#else
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
"""
|
||||
|
||||
write_scalar_h = """
|
||||
h5_err_t
|
||||
H5Block#DIM#dWriteScalarField#TYPE_ABV# (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_#TYPE_H5P#_t *buffer
|
||||
);
|
||||
"""
|
||||
|
||||
read_scalar_h = """
|
||||
h5_err_t
|
||||
H5Block#DIM#dReadScalarField#TYPE_ABV# (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_#TYPE_H5P#_t *buffer
|
||||
);
|
||||
"""
|
||||
|
||||
write_scalar_c = """
|
||||
/*!
|
||||
\\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \\c name from the buffer starting at \\c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
#TYPE_FULL#.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \\c data.
|
||||
|
||||
\\return \\c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block#DIM#dWriteScalarField#TYPE_ABV# (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_#TYPE_H5P#_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, #TYPE_HDF5# ));
|
||||
}
|
||||
"""
|
||||
|
||||
read_scalar_c = """
|
||||
/*!
|
||||
\\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \\c name into the buffer starting at \\c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
#TYPE_FULL#.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \\c data.
|
||||
|
||||
\\return \\c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block#DIM#dReadScalarField#TYPE_ABV# (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_#TYPE_H5P#_t *buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, #TYPE_HDF5#));
|
||||
}
|
||||
"""
|
||||
|
||||
write_scalar_fi = """
|
||||
!> \\ingroup h5block_data_f
|
||||
!! See \\ref H5Block#DIM#dWriteScalarField#TYPE_ABV#
|
||||
!! \\return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_#DIM#d_write_scalar_field_#TYPE_F90_ABV# ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
#TYPE_F90#, INTENT(IN) :: buffer(*) !< the array of data
|
||||
END FUNCTION
|
||||
"""
|
||||
|
||||
read_scalar_fi = """
|
||||
!> \\ingroup h5block_data_f
|
||||
!! See \\ref H5Block#DIM#dReadScalarField#TYPE_ABV#
|
||||
!! \\return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_#DIM#d_read_scalar_field_#TYPE_F90_ABV# ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
#TYPE_F90#, INTENT(OUT) :: buffer(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
"""
|
||||
|
||||
write_scalar_fc = """
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_#DIM#d_write_scalar_field_#TYPE_F90_ABV# F77NAME ( \\
|
||||
h5bl_#DIM#d_write_scalar_field_#TYPE_F90_ABV#_, \\
|
||||
H5BL_#DIM#D_WRITE_SCALAR_FIELD_#TYPE_F90_ABVC# )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_#DIM#d_write_scalar_field_#TYPE_F90_ABV# (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_#TYPE_H5P#_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
fh, name2, (void*)buffer, #TYPE_HDF5# );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
"""
|
||||
|
||||
read_scalar_fc = """
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_#TYPE_F90_ABV# F77NAME ( \\
|
||||
h5bl_3d_read_scalar_field_#TYPE_F90_ABV#_, \\
|
||||
H5BL_#DIM#D_READ_SCALAR_FIELD_#TYPE_F90_ABVC# )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_#DIM#d_read_scalar_field_#TYPE_F90_ABV# (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_#TYPE_H5P#_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
fh, name2, buffer, #TYPE_HDF5# );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
"""
|
||||
|
||||
write_vector_h = """
|
||||
h5_err_t
|
||||
H5Block#DIM#dWriteVector3dField#TYPE_ABV# (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_#TYPE_H5P#_t *x_buf,
|
||||
const h5_#TYPE_H5P#_t *y_buf,
|
||||
const h5_#TYPE_H5P#_t *z_buf
|
||||
);
|
||||
"""
|
||||
|
||||
read_vector_h = """
|
||||
h5_err_t
|
||||
H5Block#DIM#dReadVector3dField#TYPE_ABV# (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_#TYPE_H5P#_t *x_buf,
|
||||
h5_#TYPE_H5P#_t *y_buf,
|
||||
h5_#TYPE_H5P#_t *z_buf
|
||||
);
|
||||
"""
|
||||
|
||||
write_vector_c = """
|
||||
/*!
|
||||
\\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \\c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \\c x_buf, \\c y_buf and \\c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with #TYPE_FULL# values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \\c x_buf.
|
||||
|
||||
\\return \\c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block#DIM#dWriteVector3dField#TYPE_ABV# (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_#TYPE_H5P#_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_#TYPE_H5P#_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_#TYPE_H5P#_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_write_vector3d_data(f, name,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5#));
|
||||
}
|
||||
"""
|
||||
|
||||
read_vector_c = """
|
||||
/*!
|
||||
\\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \\c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \\c x_buf, \\c y_buf and \\c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with #TYPE_FULL# values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \\c data.
|
||||
|
||||
\\return \\c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5Block#DIM#dReadVector3dField#TYPE_ABV# (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_#TYPE_H5P#_t *x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
const h5_#TYPE_H5P#_t *y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
const h5_#TYPE_H5P#_t *z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_read_vector3d_data(f, name,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5#));
|
||||
}
|
||||
"""
|
||||
|
||||
write_vector_fi = """
|
||||
!> \\ingroup h5block_data_f
|
||||
!! See \\ref H5Block#DIM#dWriteVector3dField#TYPE_ABV#
|
||||
!! \\return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_#DIM#d_write_vector3d_field_#TYPE_F90_ABV# ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
#TYPE_F90#, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
#TYPE_F90#, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
#TYPE_F90#, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
"""
|
||||
|
||||
read_vector_fi = """
|
||||
!> \\ingroup h5block_data_f
|
||||
!! See \\ref H5Block#DIM#dReadVector3dField#TYPE_ABV#
|
||||
!! \\return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_#DIM#d_read_vector3d_field_#TYPE_F90_ABV# ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
#TYPE_F90#, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
#TYPE_F90#, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
#TYPE_F90#, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
"""
|
||||
|
||||
write_vector_fc = """
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_#DIM#d_write_vector3d_field_#TYPE_F90_ABV# F77NAME ( \\
|
||||
h5bl_#DIM#d_write_vector3d_field_#TYPE_F90_ABV#_, \\
|
||||
H5BL_#DIM#D_WRITE_VECTOR3D_FIELD_#TYPE_F90_ABVC# )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_#DIM#d_write_vector3d_field_#TYPE_F90_ABV# (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_#TYPE_H5P#_t *x_buf,
|
||||
const h5_#TYPE_H5P#_t *y_buf,
|
||||
const h5_#TYPE_H5P#_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5# );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
"""
|
||||
|
||||
read_vector_fc = """
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_#DIM#d_read_vector3d_field_#TYPE_F90_ABV# F77NAME ( \\
|
||||
h5bl_#DIM#d_read_vector3d_field_#TYPE_F90_ABV#_, \\
|
||||
H5BL_#DIM#D_READ_VECTOR3D_FIELD_#TYPE_F90_ABVC# )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_#DIM#d_read_vector3d_field_#TYPE_F90_ABV# (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_#TYPE_H5P#_t *x_buf,
|
||||
h5_#TYPE_H5P#_t *y_buf,
|
||||
h5_#TYPE_H5P#_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5# );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
"""
|
||||
|
||||
write_attr_h = """
|
||||
h5_err_t
|
||||
H5BlockWriteFieldAttrib#TYPE_ABV# (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_#TYPE_H5P#_t *buffer,
|
||||
const h5_size_t nelems
|
||||
);
|
||||
"""
|
||||
|
||||
write_attr_c = """
|
||||
/*!
|
||||
\\ingroup h5block_attrib
|
||||
|
||||
Write #TYPE_H5P# \\c values as attribute \\c attrib_name of field
|
||||
\\c field_name.
|
||||
|
||||
\\return \\c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockWriteFieldAttrib#TYPE_ABV# (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_#TYPE_H5P#_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
H5_API_ENTER5 (h5_err_t, "f=0x%p, field_name=\\"%s\\", attrib_name=\\"%s\\", "
|
||||
"buffer=0x%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN(h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
#TYPE_HDF5#,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
"""
|
||||
|
||||
write_attr_fi = """
|
||||
!> \\ingroup h5block_attrib_f
|
||||
!! See \\ref H5BlockWriteFieldAttrib#TYPE_ABV#
|
||||
!! \\return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_#TYPE_F90_ABV# ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute
|
||||
#TYPE_F90#, INTENT(IN) :: buffer(*) !< the array of data to write into the attribute
|
||||
INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array
|
||||
END FUNCTION
|
||||
"""
|
||||
|
||||
write_attr_fc = """
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_#TYPE_F90_ABV# F77NAME ( \\
|
||||
h5bl_writefieldattrib_#TYPE_F90_ABV#_, \\
|
||||
H5BL_WRITEFIELDATTRIB_#TYPE_F90_ABVC# )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_writefieldattrib_#TYPE_F90_ABV# (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_#TYPE_H5P#_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER7 (h5_err_t, "f=0x%p, field_name=\\"%s\\", attrib_name=\\"%s\\", "
|
||||
"buffer=0x%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_write_field_attrib (
|
||||
fh, field_name2, attrib_name2,
|
||||
#TYPE_HDF5#, buffer, *nelems );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
"""
|
||||
|
||||
read_attr_h = """
|
||||
h5_err_t
|
||||
H5BlockReadFieldAttrib#TYPE_ABV# (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_#TYPE_H5P#_t *buffer
|
||||
);
|
||||
"""
|
||||
|
||||
read_attr_c = """
|
||||
/*!
|
||||
\\ingroup h5block_attrib
|
||||
|
||||
Read #TYPE_H5P# values from attribute \\c attrib_name of field
|
||||
\\c field_name into a \\c buffer.
|
||||
|
||||
\\return \\c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5BlockReadFieldAttrib#TYPE_ABV# (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_#TYPE_H5P#_t *buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
|
||||
H5_API_ENTER4 (h5_err_t, "f=%p, field_name=\\\"%s\\", attrib_name=\\"%s\\", buffer=0x%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN(h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
#TYPE_HDF5#,
|
||||
(void*)buffer ));
|
||||
}
|
||||
"""
|
||||
|
||||
read_attr_fi = """
|
||||
!> \\ingroup h5block_attrib_f
|
||||
!! See \\ref H5BlockReadFieldAttrib#TYPE_ABV#
|
||||
!! \\return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_#TYPE_F90_ABV# ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute
|
||||
#TYPE_F90#, INTENT(IN) :: buffer(*) !< the buffer to read into
|
||||
END FUNCTION
|
||||
"""
|
||||
|
||||
read_attr_fc = """
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_readfieldattrib_#TYPE_F90_ABV# F77NAME ( \\
|
||||
h5bl_readfieldattrib_#TYPE_F90_ABV#_, \\
|
||||
H5BL_READFIELDATTRIB_#TYPE_F90_ABVC# )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_#TYPE_F90_ABV# (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_#TYPE_H5P#_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER6 (h5_err_t, "f=0x%p, field_name=\\"%s\\", attrib_name=\\"%s\\", "
|
||||
"values=0x%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_read_field_attrib (
|
||||
fh, field_name2, attrib_name2, #TYPE_HDF5#, buffer );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
dims = ["3"]
|
||||
types = [
|
||||
["floating points (64-bit)", "Float64", "float64", "H5T_NATIVE_DOUBLE", "REAL*8", "r8", "R8"],
|
||||
["floating points (32-bit)", "Float32", "float32", "H5T_NATIVE_FLOAT", "REAL*4", "r4", "R4"],
|
||||
["integers (64-bit)", "Int64", "int64", "H5T_NATIVE_INT64", "INTEGER*8", "i8", "I8"],
|
||||
["integers (32-bit)", "Int32", "int32", "H5T_NATIVE_INT32", "INTEGER*4", "i4", "I4"]
|
||||
]
|
||||
|
||||
def create_call(template, type, dim):
|
||||
fcn = template
|
||||
fcn = fcn.replace('#DIM#',dim)\
|
||||
.replace('#TYPE_FULL#',type[0])\
|
||||
.replace('#TYPE_ABV#',type[1])\
|
||||
.replace('#TYPE_H5P#',type[2])\
|
||||
.replace('#TYPE_HDF5#',type[3])\
|
||||
.replace('#TYPE_F90#',type[4])\
|
||||
.replace('#TYPE_F90_ABV#',type[5])\
|
||||
.replace('#TYPE_F90_ABVC#',type[6])
|
||||
return fcn
|
||||
|
||||
def write_calls():
|
||||
cfile = file('H5Block_readwrite.c','w')
|
||||
cfile.write(c_head)
|
||||
hfile = file('../include/H5Block_readwrite.h','w')
|
||||
hfile.write(h_head)
|
||||
fcfile = file('../Fortran/H5Block_readwrite_F.c','w')
|
||||
fcfile.write(fc_head)
|
||||
fifile = file('../Fortran/H5Block_readwrite.f90','w')
|
||||
for dim in dims:
|
||||
for type in types:
|
||||
cfile.write(create_call(write_scalar_c,type,dim));
|
||||
cfile.write(create_call(read_scalar_c,type,dim));
|
||||
hfile.write(create_call(write_scalar_h,type,dim));
|
||||
hfile.write(create_call(read_scalar_h,type,dim));
|
||||
fcfile.write(create_call(write_scalar_fc,type,dim));
|
||||
fcfile.write(create_call(read_scalar_fc,type,dim));
|
||||
fifile.write(create_call(write_scalar_fi,type,dim));
|
||||
fifile.write(create_call(read_scalar_fi,type,dim));
|
||||
cfile.write(create_call(write_vector_c,type,dim));
|
||||
cfile.write(create_call(read_vector_c,type,dim));
|
||||
hfile.write(create_call(write_vector_h,type,dim));
|
||||
hfile.write(create_call(read_vector_h,type,dim));
|
||||
fcfile.write(create_call(write_vector_fc,type,dim));
|
||||
fcfile.write(create_call(read_vector_fc,type,dim));
|
||||
fifile.write(create_call(write_vector_fi,type,dim));
|
||||
fifile.write(create_call(read_vector_fi,type,dim));
|
||||
for type in types:
|
||||
cfile.write(create_call(write_attr_c,type,""));
|
||||
hfile.write(create_call(write_attr_h,type,""));
|
||||
fifile.write(create_call(write_attr_fi,type,""));
|
||||
fcfile.write(create_call(write_attr_fc,type,""));
|
||||
cfile.write(create_call(read_attr_c,type,""));
|
||||
hfile.write(create_call(read_attr_h,type,""));
|
||||
fifile.write(create_call(read_attr_fi,type,""));
|
||||
fcfile.write(create_call(read_attr_fc,type,""));
|
||||
cfile.close()
|
||||
hfile.write(h_tail)
|
||||
hfile.close()
|
||||
fcfile.close()
|
||||
fifile.close()
|
||||
|
||||
write_calls()
|
||||
|
||||
@@ -0,0 +1,395 @@
|
||||
/*
|
||||
Copyright (c) 2006-2013, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include "h5_private.h"
|
||||
//#include "h5core/h5_model.h"
|
||||
|
||||
/* file handling interface */
|
||||
static inline h5_int64_t
|
||||
open_file (
|
||||
const char *name,
|
||||
const int l_name,
|
||||
h5_int32_t flags,
|
||||
MPI_Comm ccomm,
|
||||
h5_size_t align
|
||||
) {
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_file_t* f = h5_open_file ( name2, flags, ccomm, align );
|
||||
free ( name2 );
|
||||
return (h5_int64_t)f;
|
||||
}
|
||||
|
||||
#define h5_openr F77_NAME( \
|
||||
h5_openr, \
|
||||
h5_openr_, \
|
||||
H5_OPENR)
|
||||
h5_int64_t
|
||||
h5_openr (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%s'",
|
||||
file_name);
|
||||
H5_API_RETURN (open_file (file_name, l_file_name, H5_O_RDONLY, 0, 0));
|
||||
}
|
||||
|
||||
#define h5_openw F77_NAME( \
|
||||
h5_openw, \
|
||||
h5_openw_, \
|
||||
H5_OPENW)
|
||||
h5_int64_t
|
||||
h5_openw (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%s'",
|
||||
file_name);
|
||||
H5_API_RETURN (open_file (file_name, l_file_name, H5_O_WRONLY, 0, 0));
|
||||
}
|
||||
|
||||
#define h5_opena F77_NAME( \
|
||||
h5_opena, \
|
||||
h5_opena_, \
|
||||
H5_OPENA)
|
||||
h5_int64_t
|
||||
h5_opena (
|
||||
const char *file_name,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%s'",
|
||||
file_name);
|
||||
H5_API_RETURN (open_file (file_name, l_file_name, H5_O_APPEND, 0, 0));
|
||||
}
|
||||
|
||||
#define h5_openr_align F77_NAME( \
|
||||
h5_openr_align, \
|
||||
h5_openr_align_, \
|
||||
H5_OPENR_ALIGN)
|
||||
h5_int64_t
|
||||
h5_openr_align (
|
||||
const char *file_name,
|
||||
const h5_int64_t *align,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%s', align=%llu",
|
||||
file_name, (long long unsigned)align);
|
||||
H5_API_RETURN (open_file (file_name, l_file_name, H5_O_RDONLY, 0, *align));
|
||||
}
|
||||
|
||||
#define h5_openw_align F77_NAME( \
|
||||
h5_openw_align, \
|
||||
h5_openw_align_, \
|
||||
H5_OPENW_ALIGN)
|
||||
h5_int64_t
|
||||
h5_openw_align (
|
||||
const char *file_name,
|
||||
const h5_int64_t *align,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%s', align=%llu",
|
||||
file_name, (long long unsigned)align);
|
||||
H5_API_RETURN (open_file (file_name, l_file_name, H5_O_WRONLY, 0, *align));
|
||||
}
|
||||
|
||||
#define h5_opena_align F77_NAME( \
|
||||
h5_opena_align, \
|
||||
h5_opena_align_, \
|
||||
H5_OPENA_ALIGN)
|
||||
h5_int64_t
|
||||
h5_opena_align (
|
||||
const char *file_name,
|
||||
const h5_int64_t *align,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%s', align=%llu",
|
||||
file_name, (long long unsigned)align);
|
||||
H5_API_RETURN (open_file (file_name, l_file_name, H5_O_APPEND, 0, *align));
|
||||
}
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
h5_int32_t
|
||||
flagsfor2c (
|
||||
const char* flags,
|
||||
const int l_flags
|
||||
) {
|
||||
if (flags == NULL)
|
||||
return 0;
|
||||
|
||||
h5_int32_t fbits = 0;
|
||||
char* flags2 = h5_strdupfor2c (flags, l_flags);
|
||||
|
||||
flags2 = strtok (flags2, ",");
|
||||
while (flags != NULL) {
|
||||
if (strcmp (flags2, "vfd_mpiposix") == 0)
|
||||
fbits |= H5_VFD_MPIPOSIX;
|
||||
else if (strcmp (flags2, "vfd_core") == 0)
|
||||
fbits |= H5_VFD_CORE;
|
||||
else if (strcmp (flags2, "vfd_mpio_ind") == 0)
|
||||
fbits |= H5_VFD_MPIIO_IND;
|
||||
else if (strcmp (flags2, "fs_lustre") == 0)
|
||||
fbits |= H5_FS_LUSTRE;
|
||||
else {
|
||||
// :FIXME: ignore unknown strings!?
|
||||
}
|
||||
flags2 = strtok (NULL, ",");
|
||||
}
|
||||
free (flags2);
|
||||
return fbits;
|
||||
}
|
||||
|
||||
static inline h5_int64_t
|
||||
open_file_par (
|
||||
const char* file_name,
|
||||
const int l_file_name,
|
||||
MPI_Fint* fcomm,
|
||||
const h5_int32_t mode,
|
||||
const char* flags,
|
||||
const int l_flags,
|
||||
h5_int64_t align
|
||||
) {
|
||||
return open_file (
|
||||
file_name, l_file_name,
|
||||
mode | flagsfor2c (flags, l_flags),
|
||||
MPI_Comm_f2c (*fcomm),
|
||||
align);
|
||||
}
|
||||
|
||||
#define h5_openr_par F77_NAME( \
|
||||
h5_openr_par, \
|
||||
h5_openr_par_, \
|
||||
H5_OPENR_PAR)
|
||||
h5_int64_t
|
||||
h5_openr_par (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%*s', fcomm=%d",
|
||||
l_file_name, file_name, *fcomm);
|
||||
H5_API_RETURN (
|
||||
open_file_par (
|
||||
file_name, l_file_name,
|
||||
fcomm,
|
||||
H5_O_RDONLY,
|
||||
NULL, 0,
|
||||
0));
|
||||
}
|
||||
|
||||
#define h5_openw_par F77_NAME( \
|
||||
h5_openw_par, \
|
||||
h5_openw_par_, \
|
||||
H5_OPENW_PAR)
|
||||
h5_int64_t
|
||||
h5_openw_par (
|
||||
const char* file_name,
|
||||
MPI_Fint* fcomm,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%*s', fcomm=%d",
|
||||
l_file_name, file_name, *fcomm);
|
||||
H5_API_RETURN (
|
||||
open_file_par (
|
||||
file_name, l_file_name,
|
||||
fcomm,
|
||||
H5_O_WRONLY,
|
||||
NULL, 0,
|
||||
0));
|
||||
}
|
||||
|
||||
#define h5_opena_par F77_NAME( \
|
||||
h5_opena_par, \
|
||||
h5_opena_par_, \
|
||||
H5_OPENA_PAR)
|
||||
h5_int64_t
|
||||
h5_opena_par (
|
||||
const char* file_name,
|
||||
MPI_Fint* fcomm,
|
||||
const int l_file_name
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%*s', fcomm=%d",
|
||||
l_file_name, file_name, *fcomm);
|
||||
H5_API_RETURN (
|
||||
open_file_par (
|
||||
file_name, l_file_name,
|
||||
fcomm,
|
||||
H5_O_APPEND,
|
||||
NULL, 0,
|
||||
0));
|
||||
}
|
||||
|
||||
#define h5_openr_par_align F77_NAME( \
|
||||
h5_openr_par_align, \
|
||||
h5_openr_par_align_, \
|
||||
H5_OPENR_PAR_ALIGN)
|
||||
h5_int64_t
|
||||
h5_openr_par_align (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%*s', fcomm=%d, flags=%s, align=%lld",
|
||||
l_file_name, file_name, *fcomm, flags, (long long)align);
|
||||
H5_API_RETURN (
|
||||
open_file_par (
|
||||
file_name, l_file_name,
|
||||
fcomm,
|
||||
H5_O_RDONLY,
|
||||
flags, l_flags,
|
||||
*align));
|
||||
}
|
||||
|
||||
#define h5_openw_par_align F77_NAME( \
|
||||
h5_openw_par_align, \
|
||||
h5_openw_par_align_, \
|
||||
H5_OPENW_PAR_ALIGN)
|
||||
h5_int64_t
|
||||
h5_openw_par_align (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%*s', fcomm=%d, flags=%s, align=%lld",
|
||||
l_file_name, file_name, *fcomm, flags, (long long)align);
|
||||
H5_API_RETURN (
|
||||
open_file_par (
|
||||
file_name, l_file_name,
|
||||
fcomm,
|
||||
H5_O_WRONLY,
|
||||
flags, l_flags,
|
||||
*align));
|
||||
}
|
||||
|
||||
#define h5_opena_par_align F77_NAME( \
|
||||
h5_opena_par_align, \
|
||||
h5_opena_par_align_, \
|
||||
H5_OPENA_PAR_ALIGN)
|
||||
h5_int64_t
|
||||
h5_opena_par_align (
|
||||
const char *file_name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_file_name,
|
||||
const int l_flags
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "file_name='%*s', fcomm=%d, flags=%s, align=%lld",
|
||||
l_file_name, file_name, *fcomm, flags, (long long)align);
|
||||
H5_API_RETURN (
|
||||
open_file_par (
|
||||
file_name, l_file_name,
|
||||
fcomm,
|
||||
H5_O_APPEND,
|
||||
flags, l_flags,
|
||||
*align));
|
||||
}
|
||||
#endif
|
||||
|
||||
#define h5_close F77_NAME( \
|
||||
h5_close, \
|
||||
h5_close_, \
|
||||
H5_CLOSE)
|
||||
h5_int64_t
|
||||
h5_close (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
h5_file_t* fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
|
||||
H5_API_RETURN (h5_close_file (fh));
|
||||
}
|
||||
|
||||
#define h5_finalize F77_NAME( \
|
||||
h5_finalize, \
|
||||
h5_finalize_, \
|
||||
H5_FINALIZE)
|
||||
h5_int64_t
|
||||
h5_finalize (
|
||||
void
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "%s", "");
|
||||
H5_API_RETURN (h5_close_hdf5());
|
||||
}
|
||||
|
||||
#define h5_check F77_NAME( \
|
||||
h5_check, \
|
||||
h5_check_, \
|
||||
H5_CHECK)
|
||||
h5_int64_t
|
||||
h5_check (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t* fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
|
||||
H5_API_RETURN (h5_check_filehandle (fh));
|
||||
}
|
||||
|
||||
/* H5hut data model */
|
||||
#define h5_setstep F77_NAME( \
|
||||
h5_setstep, \
|
||||
h5_setstep_, \
|
||||
H5_SETSTEP)
|
||||
h5_int64_t
|
||||
h5_setstep (
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *step ) {
|
||||
|
||||
h5_file_t* fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p, step=%lld", (h5_file_p)fh, (long long)*step);
|
||||
H5_API_RETURN (h5_set_step (fh, (*step)-1));
|
||||
}
|
||||
|
||||
#define h5_getstep F77_NAME( \
|
||||
h5_getstep, \
|
||||
h5_getstep_, \
|
||||
H5_GETSTEP)
|
||||
h5_int64_t
|
||||
h5_getstep (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t* fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
|
||||
H5_API_RETURN (h5_get_step (fh) + 1);
|
||||
}
|
||||
|
||||
#define h5_getnsteps F77_NAME( \
|
||||
h5_getnsteps, \
|
||||
h5_getnsteps_, \
|
||||
H5_GETNSTEPS)
|
||||
h5_int64_t
|
||||
h5_getnsteps (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t* fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
|
||||
H5_API_RETURN (h5_get_num_steps (fh));
|
||||
}
|
||||
|
||||
|
||||
/* debug output */
|
||||
#define h5_set_verbosity_level F77_NAME( \
|
||||
h5_set_verbosity_level, \
|
||||
h5_set_verbosity_level_, \
|
||||
H5_SET_VERBOSITY_LEVEL)
|
||||
h5_int64_t
|
||||
h5_set_verbosity_level (
|
||||
const h5_int64_t *level
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_int64_t, "level=%lld", (long long)*level);
|
||||
H5_API_RETURN(h5_set_debuglevel (*level));
|
||||
}
|
||||
|
||||
Executable
+199
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
Copyright (c) 2006-2012, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include "h5_private.h"
|
||||
#include "h5core/h5b_model.h"
|
||||
|
||||
#define h5bl_3d_setview F77_NAME ( \
|
||||
h5bl_3d_setview, \
|
||||
h5bl_3d_setview_, \
|
||||
H5BL_3D_SETVIEW )
|
||||
h5_int64_t
|
||||
h5bl_3d_setview (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* const i_start, /*!< start index of i */
|
||||
const h5_int64_t* const i_end, /*!< end index of i */
|
||||
const h5_int64_t* const j_start, /*!< start index of j */
|
||||
const h5_int64_t* const j_end, /*!< end index of j */
|
||||
const h5_int64_t* const k_start, /*!< start index of k */
|
||||
const h5_int64_t* const k_end /*!< end index of k */
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, "
|
||||
"i_start=%lld, i_end=%lld, "
|
||||
"j_start=%lld, j_end=%lld, "
|
||||
"k_start=%lld, k_end=%lld",
|
||||
(h5_file_p)f,
|
||||
*i_start, (long long)i_end,
|
||||
(long long)j_start, (long long)j_end,
|
||||
(long long)k_start, (long long)k_end);
|
||||
H5_API_RETURN(h5b_3d_set_view (
|
||||
f,
|
||||
*i_start-1, *i_end-1,
|
||||
*j_start-1, *j_end-1,
|
||||
*k_start-1, *k_end-1 ));
|
||||
}
|
||||
|
||||
#define h5bl_3d_getview F77_NAME ( \
|
||||
h5bl_3d_getview, \
|
||||
h5bl_3d_getview_, \
|
||||
H5BL_3D_GETVIEW )
|
||||
h5_int64_t
|
||||
h5bl_3d_getview (
|
||||
const h5_int64_t* const fh,
|
||||
h5_int64_t* const i_start,
|
||||
h5_int64_t* const i_end,
|
||||
h5_int64_t* const j_start,
|
||||
h5_int64_t* const j_end,
|
||||
h5_int64_t* const k_start,
|
||||
h5_int64_t* const k_end
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
(h5_file_p)f,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
TRY (h5b_3d_get_view (
|
||||
f,
|
||||
(h5_size_t*)i_start, (h5_size_t*)i_end,
|
||||
(h5_size_t*)j_start, (h5_size_t*)j_end,
|
||||
(h5_size_t*)k_start, (h5_size_t*)k_end ));
|
||||
*i_start += 1;
|
||||
*i_end += 1;
|
||||
*j_start += 1;
|
||||
*j_end += 1;
|
||||
*k_start += 1;
|
||||
*k_end += 1;
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define h5bl_3d_getreducedview F77_NAME ( \
|
||||
h5bl_3d_getreducedview, \
|
||||
h5bl_3d_getreducedview_, \
|
||||
H5BL_3D_GETREDUCEDVIEW )
|
||||
h5_int64_t
|
||||
h5bl_3d_getreducedview (
|
||||
const h5_int64_t* const fh,
|
||||
h5_int64_t* const i_start,
|
||||
h5_int64_t* const i_end,
|
||||
h5_int64_t* const j_start,
|
||||
h5_int64_t* const j_end,
|
||||
h5_int64_t* const k_start,
|
||||
h5_int64_t* const k_end
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
(h5_file_p)f,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
TRY (h5b_3d_get_reduced_view (
|
||||
f,
|
||||
(h5_size_t*)i_start, (h5_size_t*)i_end,
|
||||
(h5_size_t*)j_start, (h5_size_t*)j_end,
|
||||
(h5_size_t*)k_start, (h5_size_t*)k_end));
|
||||
*i_start += 1;
|
||||
*i_end += 1;
|
||||
*j_start += 1;
|
||||
*j_end += 1;
|
||||
*k_start += 1;
|
||||
*k_end += 1;
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
#define h5bl_3d_hasview F77_NAME ( \
|
||||
h5bl_hasview, \
|
||||
h5bl_hasview_, \
|
||||
H5BL_HASVIEW )
|
||||
h5_int64_t
|
||||
h5bl_3d_hasview (
|
||||
const h5_int64_t* const fh
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p",
|
||||
(h5_file_p)f);
|
||||
H5_API_RETURN (h5b_3d_has_view ( f ));
|
||||
}
|
||||
|
||||
#define h5bl_3d_setchunk F77_NAME ( \
|
||||
h5bl_3d_setchunk, \
|
||||
h5bl_3d_setchunk_, \
|
||||
H5BL_3D_SETCHUNK )
|
||||
h5_int64_t
|
||||
h5bl_3d_setchunk (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* const i,
|
||||
const h5_int64_t* const j,
|
||||
const h5_int64_t* const k
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, i=%lld, j=%lld, k=%lld",
|
||||
(h5_file_p)f, (long long)i, (long long)j, (long long)k);
|
||||
H5_API_RETURN(h5b_3d_set_chunk ( f, *i, *j, *k ));
|
||||
}
|
||||
|
||||
#define h5bl_getnumfields F77_NAME ( \
|
||||
h5bl_getnumfields, \
|
||||
h5bl_getnumfields_, \
|
||||
H5BL_GETNUMFIELDS )
|
||||
h5_int64_t
|
||||
h5bl_getnumfields (
|
||||
const h5_int64_t* const fh
|
||||
) {
|
||||
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p",
|
||||
(h5_file_p)f);
|
||||
H5_API_RETURN (h5b_get_num_fields (f));
|
||||
}
|
||||
|
||||
#define h5bl_getfieldinfo F77_NAME ( \
|
||||
h5bl_getfieldinfo, \
|
||||
h5bl_getfieldinfo_, \
|
||||
H5BL_GETFIELDINFO )
|
||||
h5_int64_t
|
||||
h5bl_getfieldinfo (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t *idx,
|
||||
char* const name,
|
||||
h5_size_t* const field_rank,
|
||||
h5_size_t* const field_dims,
|
||||
h5_size_t* const elem_rank,
|
||||
h5_int64_t* const type,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, idx=%lld, "
|
||||
"name=%*s,"
|
||||
"field_rank=%p, field_dims=%p, elem_rank=%p, type=%p",
|
||||
(h5_file_p)f, (long long)*idx, l_name, name,
|
||||
field_rank, field_dims, elem_rank, type);
|
||||
h5_int64_t herr = h5b_get_field_info (
|
||||
f, *idx - 1, name, (h5_size_t)l_name,
|
||||
field_rank, field_dims, elem_rank, type );
|
||||
h5_strc2for ( name, l_name );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
! _ _ _ _
|
||||
! __| | __ _| |_ __ _ _ __ ___ ___ __| | ___| |
|
||||
! / _` |/ _` | __/ _` | | '_ ` _ \ / _ \ / _` |/ _ \ |
|
||||
! | (_| | (_| | || (_| | | | | | | | (_) | (_| | __/ |
|
||||
! \__,_|\__,_|\__\__,_| |_| |_| |_|\___/ \__,_|\___|_|
|
||||
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_model_f
|
||||
!! See \ref H5Block3dSetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_setview ( filehandle, i_start, i_end, j_start, j_end, k_start, k_end )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: i_start
|
||||
INTEGER*8, INTENT(IN) :: i_end
|
||||
INTEGER*8, INTENT(IN) :: j_start
|
||||
INTEGER*8, INTENT(IN) :: j_end
|
||||
INTEGER*8, INTENT(IN) :: k_start
|
||||
INTEGER*8, INTENT(IN) :: k_end
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_model_f
|
||||
!! See \ref H5Block3dGetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_getview ( filehandle, i_start, i_end, j_start, j_end, k_start, k_end )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(OUT) :: i_start
|
||||
INTEGER*8, INTENT(OUT) :: i_end
|
||||
INTEGER*8, INTENT(OUT) :: j_start
|
||||
INTEGER*8, INTENT(OUT) :: j_end
|
||||
INTEGER*8, INTENT(OUT) :: k_start
|
||||
INTEGER*8, INTENT(OUT) :: k_end
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_model_f
|
||||
!! See \ref H5Block3dGetReducedView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_getreducedview ( filehandle, i_start, i_end, j_start, j_end, k_start, k_end )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(OUT) :: i_start
|
||||
INTEGER*8, INTENT(OUT) :: i_end
|
||||
INTEGER*8, INTENT(OUT) :: j_start
|
||||
INTEGER*8, INTENT(OUT) :: j_end
|
||||
INTEGER*8, INTENT(OUT) :: k_start
|
||||
INTEGER*8, INTENT(OUT) :: k_end
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_model_f
|
||||
!! See \ref H5Block3dHasView
|
||||
!! \return rank of processor error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_hasview ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_model_f
|
||||
!! See \ref H5Block3dSetChunk
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_setchunk ( filehandle, i, j, k )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: i
|
||||
INTEGER*8, INTENT(IN) :: j
|
||||
INTEGER*8, INTENT(IN) :: k
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_model_f
|
||||
!! See \ref H5BlockGetNumFields
|
||||
!! \return number of fields or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getnumfields ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_model_f
|
||||
!! See \ref H5BlockGetFieldInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getfieldinfo ( filehandle, idx, field_name, grid_rank, grid_dims, field_dims )
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
INTEGER*8, INTENT(IN) :: idx
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: field_name
|
||||
INTEGER*8, INTENT(OUT) :: grid_rank
|
||||
INTEGER*8, INTENT(OUT) :: grid_dims(*)
|
||||
INTEGER*8, INTENT(OUT) :: field_dims
|
||||
INTEGER*8, INTENT(OUT) :: type
|
||||
END FUNCTION
|
||||
|
||||
+177
-177
@@ -13,107 +13,107 @@
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
|
||||
#define h5bl_3d_setview F77NAME ( \
|
||||
h5bl_3d_setview_, \
|
||||
H5BL_3D_SETVIEW )
|
||||
#define h5bl_3d_getview F77NAME ( \
|
||||
h5bl_3d_getview_, \
|
||||
H5BL_3D_GETVIEW )
|
||||
#define h5bl_3d_setchunk F77NAME ( \
|
||||
h5bl_3d_setchunk_, \
|
||||
H5BL_3D_SETCHUNK )
|
||||
#define h5bl_3d_getreducedview F77NAME ( \
|
||||
h5bl_3d_getreducedview_,\
|
||||
H5BL_3D_GETREDUCEDVIEW )
|
||||
#define h5bl_3d_hasview F77NAME ( \
|
||||
h5bl_hasview_, \
|
||||
H5BL_HASVIEW )
|
||||
#define h5bl_getnumfields F77NAME ( \
|
||||
h5bl_getnumfields_, \
|
||||
H5BL_GETNUMFIELDS )
|
||||
#define h5bl_getfieldinfo F77NAME ( \
|
||||
h5bl_getfieldinfo_, \
|
||||
H5BL_GETFIELDINFO )
|
||||
#define h5bl_writefieldattrib_string F77NAME ( \
|
||||
h5bl_writefieldattrib_string_, \
|
||||
H5BL_WRITEFIELDATTRIB_STRING )
|
||||
#define h5bl_getnfieldattribs F77NAME ( \
|
||||
h5bl_getnfieldattribs_, \
|
||||
H5BL_GETNFIELDATTRIBS )
|
||||
#define h5bl_getfieldattribinfo F77NAME ( \
|
||||
h5bl_getfieldattribinfo_, \
|
||||
h5bl_getfieldattribinfo )
|
||||
#define h5bl_readfieldattrib_string F77NAME ( \
|
||||
h5bl_readfieldattrib_string_, \
|
||||
H5BL_READFIELDATTRIB_STRING )
|
||||
#define h5bl_3d_setview F77NAME ( \
|
||||
h5bl_3d_setview_, \
|
||||
H5BL_3D_SETVIEW )
|
||||
#define h5bl_3d_getview F77NAME ( \
|
||||
h5bl_3d_getview_, \
|
||||
H5BL_3D_GETVIEW )
|
||||
#define h5bl_3d_setchunk F77NAME ( \
|
||||
h5bl_3d_setchunk_, \
|
||||
H5BL_3D_SETCHUNK )
|
||||
#define h5bl_3d_getreducedview F77NAME ( \
|
||||
h5bl_3d_getreducedview_, \
|
||||
H5BL_3D_GETREDUCEDVIEW )
|
||||
#define h5bl_3d_hasview F77NAME ( \
|
||||
h5bl_hasview_, \
|
||||
H5BL_HASVIEW )
|
||||
#define h5bl_getnumfields F77NAME ( \
|
||||
h5bl_getnumfields_, \
|
||||
H5BL_GETNUMFIELDS )
|
||||
#define h5bl_getfieldinfo F77NAME ( \
|
||||
h5bl_getfieldinfo_, \
|
||||
H5BL_GETFIELDINFO )
|
||||
#define h5bl_writefieldattrib_string F77NAME ( \
|
||||
h5bl_writefieldattrib_string_, \
|
||||
H5BL_WRITEFIELDATTRIB_STRING )
|
||||
#define h5bl_getnfieldattribs F77NAME ( \
|
||||
h5bl_getnfieldattribs_, \
|
||||
H5BL_GETNFIELDATTRIBS )
|
||||
#define h5bl_getfieldattribinfo F77NAME ( \
|
||||
h5bl_getfieldattribinfo_, \
|
||||
h5bl_getfieldattribinfo )
|
||||
#define h5bl_readfieldattrib_string F77NAME ( \
|
||||
h5bl_readfieldattrib_string_, \
|
||||
H5BL_READFIELDATTRIB_STRING )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_setview (
|
||||
h5_int64_t *const f,
|
||||
const h5_int64_t *i_start, /*!< start index of i */
|
||||
const h5_int64_t *i_end, /*!< end index of i */
|
||||
const h5_int64_t *j_start, /*!< start index of j */
|
||||
const h5_int64_t *j_end, /*!< end index of j */
|
||||
const h5_int64_t *k_start, /*!< start index of k */
|
||||
const h5_int64_t *k_end /*!< end index of k */
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const h5_int64_t *i_start, /*!< start index of i */
|
||||
const h5_int64_t *i_end, /*!< end index of i */
|
||||
const h5_int64_t *j_start, /*!< start index of j */
|
||||
const h5_int64_t *j_end, /*!< end index of j */
|
||||
const h5_int64_t *k_start, /*!< start index of k */
|
||||
const h5_int64_t *k_end /*!< end index of k */
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%lld, i_end=%lld, "
|
||||
"j_start=%lld, j_end=%lld, "
|
||||
"k_start=%lld, k_end=%lld",
|
||||
fh,
|
||||
(long long)i_start, (long long)i_end,
|
||||
(long long)j_start, (long long)j_end,
|
||||
(long long)k_start, (long long)k_end);
|
||||
"f=%p, "
|
||||
"i_start=%lld, i_end=%lld, "
|
||||
"j_start=%lld, j_end=%lld, "
|
||||
"k_start=%lld, k_end=%lld",
|
||||
fh,
|
||||
(long long)i_start, (long long)i_end,
|
||||
(long long)j_start, (long long)j_end,
|
||||
(long long)k_start, (long long)k_end);
|
||||
H5_API_RETURN(h5b_3d_set_view (
|
||||
fh,
|
||||
*i_start-1, *i_end-1,
|
||||
*j_start-1, *j_end-1,
|
||||
*k_start-1, *k_end-1 ));
|
||||
fh,
|
||||
*i_start-1, *i_end-1,
|
||||
*j_start-1, *j_end-1,
|
||||
*k_start-1, *k_end-1 ));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_setchunk (
|
||||
h5_int64_t *const f,
|
||||
const h5_int64_t *i,
|
||||
const h5_int64_t *j,
|
||||
const h5_int64_t *k
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const h5_int64_t *i,
|
||||
const h5_int64_t *j,
|
||||
const h5_int64_t *k
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%lld, j=%lld, k=%lld",
|
||||
fh, (long long)i, (long long)j, (long long)k);
|
||||
"f=%p, i=%lld, j=%lld, k=%lld",
|
||||
fh, (long long)i, (long long)j, (long long)k);
|
||||
H5_API_RETURN(h5b_3d_set_chunk ( fh, *i, *j, *k ));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_getview (
|
||||
h5_int64_t *const f,
|
||||
h5_int64_t *const i_start,
|
||||
h5_int64_t *const i_end,
|
||||
h5_int64_t *const j_start,
|
||||
h5_int64_t *const j_end,
|
||||
h5_int64_t *const k_start,
|
||||
h5_int64_t *const k_end
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
h5_int64_t *const i_start,
|
||||
h5_int64_t *const i_end,
|
||||
h5_int64_t *const j_start,
|
||||
h5_int64_t *const j_end,
|
||||
h5_int64_t *const k_start,
|
||||
h5_int64_t *const k_end
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
fh,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
fh,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
H5_API_RETURN (h5b_3d_get_view (
|
||||
fh,
|
||||
(h5_size_t*)i_start, (h5_size_t*)i_end,
|
||||
@@ -123,25 +123,25 @@ h5bl_3d_getview (
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_getreducedview (
|
||||
h5_int64_t *const f,
|
||||
h5_int64_t *const i_start,
|
||||
h5_int64_t *const i_end,
|
||||
h5_int64_t *const j_start,
|
||||
h5_int64_t *const j_end,
|
||||
h5_int64_t *const k_start,
|
||||
h5_int64_t *const k_end
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
h5_int64_t *const i_start,
|
||||
h5_int64_t *const i_end,
|
||||
h5_int64_t *const j_start,
|
||||
h5_int64_t *const j_end,
|
||||
h5_int64_t *const k_start,
|
||||
h5_int64_t *const k_end
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
fh,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
fh,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
H5_API_RETURN(h5b_3d_get_reduced_view (
|
||||
fh,
|
||||
(h5_size_t*)i_start, (h5_size_t*)i_end,
|
||||
@@ -151,8 +151,8 @@ h5bl_3d_getreducedview (
|
||||
|
||||
h5_int64_t
|
||||
h5bl_3d_hasview (
|
||||
h5_int64_t *const f
|
||||
) {
|
||||
h5_int64_t *const f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", fh);
|
||||
@@ -161,8 +161,8 @@ h5bl_3d_hasview (
|
||||
|
||||
h5_err_t
|
||||
h5bl_getnumfields (
|
||||
h5_int64_t *const f
|
||||
) {
|
||||
h5_int64_t *const f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", fh);
|
||||
@@ -171,60 +171,60 @@ h5bl_getnumfields (
|
||||
|
||||
h5_err_t
|
||||
h5bl_getfieldinfo (
|
||||
h5_int64_t *const f,
|
||||
const h5_int64_t *idx,
|
||||
char *name,
|
||||
h5_size_t *field_rank,
|
||||
h5_size_t *field_dims,
|
||||
h5_size_t *elem_rank,
|
||||
h5_int64_t *type,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const h5_int64_t *idx,
|
||||
char *name,
|
||||
h5_size_t *field_rank,
|
||||
h5_size_t *field_dims,
|
||||
h5_size_t *elem_rank,
|
||||
h5_int64_t *type,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, idx=%lld, "
|
||||
"name=%p,"
|
||||
"field_rank=%p, field_dims=%p, elem_rank=%p, type=%p, l_name=%d",
|
||||
fh, (long long)*idx, name,
|
||||
field_rank, field_dims, elem_rank, type, l_name);
|
||||
"f=%p, idx=%lld, "
|
||||
"name=%p,"
|
||||
"field_rank=%p, field_dims=%p, elem_rank=%p, type=%p, l_name=%d",
|
||||
fh, (long long)*idx, name,
|
||||
field_rank, field_dims, elem_rank, type, l_name);
|
||||
h5_err_t herr = h5b_get_field_info (
|
||||
fh, *idx, name, (h5_size_t)l_name,
|
||||
field_rank, field_dims, elem_rank, type );
|
||||
fh, *idx, name, (h5_size_t)l_name,
|
||||
field_rank, field_dims, elem_rank, type );
|
||||
h5_strc2for ( name, l_name );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5bl_writefieldattrib_string (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const char *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const char *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
char *buffer2 = h5_strdupfor2c ( buffer, l_buffer );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer='%s', "
|
||||
"l_field_name=%d, "
|
||||
"l_attrib_name=%d, "
|
||||
"l_buffer=%d",
|
||||
fh,
|
||||
field_name2,
|
||||
attrib_name2,
|
||||
buffer2, l_field_name, l_attrib_name, l_buffer);
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer='%s', "
|
||||
"l_field_name=%d, "
|
||||
"l_attrib_name=%d, "
|
||||
"l_buffer=%d",
|
||||
fh,
|
||||
field_name2,
|
||||
attrib_name2,
|
||||
buffer2, l_field_name, l_attrib_name, l_buffer);
|
||||
h5_err_t herr = h5_write_field_attrib (
|
||||
fh, field_name2, attrib_name2,
|
||||
H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
fh, field_name2, attrib_name2,
|
||||
H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
@@ -235,15 +235,15 @@ h5bl_writefieldattrib_string (
|
||||
|
||||
h5_err_t
|
||||
h5bl_getnfieldattribs (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', l_name=%d", fh, name2, l_name);
|
||||
"f=%p, name='%s', l_name=%d", fh, name2, l_name);
|
||||
h5_err_t herr = h5b_get_num_field_attribs ( fh, name2 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
@@ -251,33 +251,33 @@ h5bl_getnfieldattribs (
|
||||
|
||||
h5_err_t
|
||||
h5bl_getfieldattribinfo (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const h5_int64_t *attrib_idx,
|
||||
char *attrib_name,
|
||||
h5_size_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const h5_int64_t *attrib_idx,
|
||||
char *attrib_name,
|
||||
h5_size_t *attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p field_name='%s', "
|
||||
"attrib_idx=%lld, "
|
||||
"attrib_name=%p, "
|
||||
"attrib_nelem=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh,
|
||||
field_name2,
|
||||
(long long)*attrib_idx,
|
||||
attrib_name, attrib_nelem, l_field_name, l_attrib_name);
|
||||
"f=%p field_name='%s', "
|
||||
"attrib_idx=%lld, "
|
||||
"attrib_name=%p, "
|
||||
"attrib_nelem=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh,
|
||||
field_name2,
|
||||
(long long)*attrib_idx,
|
||||
attrib_name, attrib_nelem, l_field_name, l_attrib_name);
|
||||
|
||||
h5_int64_t attrib_type;
|
||||
h5_err_t herr = h5b_get_field_attrib_info (
|
||||
fh, field_name2, *attrib_idx,
|
||||
attrib_name, l_attrib_name,
|
||||
&attrib_type,
|
||||
attrib_nelem );
|
||||
fh, field_name2, *attrib_idx,
|
||||
attrib_name, l_attrib_name,
|
||||
&attrib_type,
|
||||
attrib_nelem );
|
||||
|
||||
h5_strc2for ( attrib_name, l_attrib_name );
|
||||
|
||||
@@ -288,31 +288,31 @@ h5bl_getfieldattribinfo (
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_string (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
char *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
char *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer=%p, l_field_name=%d, l_attrib_name=%d, l_buffer=%d",
|
||||
fh,
|
||||
field_name,
|
||||
attrib_name,
|
||||
buffer, l_field_name, l_attrib_name, l_buffer);
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer=%p, l_field_name=%d, l_attrib_name=%d, l_buffer=%d",
|
||||
fh,
|
||||
field_name,
|
||||
attrib_name,
|
||||
buffer, l_field_name, l_attrib_name, l_buffer);
|
||||
|
||||
h5_err_t herr = h5_read_field_attrib (
|
||||
fh, field_name2, attrib_name2,
|
||||
H5_STRING_T, buffer );
|
||||
fh, field_name2, attrib_name2,
|
||||
H5_STRING_T, buffer );
|
||||
|
||||
h5_strc2for ( buffer, l_buffer );
|
||||
|
||||
|
||||
@@ -0,0 +1,455 @@
|
||||
/*
|
||||
Copyright (c) 2006-2012, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include "h5_private.h"
|
||||
#include "h5core/h5b_attribs.h"
|
||||
|
||||
#define H5_R8_T H5_FLOAT64_T
|
||||
#define H5_R4_T H5_FLOAT32_T
|
||||
#define H5_I8_T H5_INT64_T
|
||||
#define H5_I4_T H5_INT32_T
|
||||
|
||||
/*
|
||||
__ _ _ _ ___ _ __ _ _
|
||||
/ _` | | | |/ _ \ '__| | | |
|
||||
| (_| | |_| | __/ | | |_| |
|
||||
\__, |\__,_|\___|_| \__, |
|
||||
|_| |___/
|
||||
*/
|
||||
|
||||
#define h5bl_getnfieldattribs F77_NAME ( \
|
||||
h5bl_getnfieldattribs, \
|
||||
h5bl_getnfieldattribs_, \
|
||||
H5BL_GETNFIELDATTRIBS)
|
||||
h5_int64_t
|
||||
h5bl_getnfieldattribs (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%*s'",
|
||||
(h5_file_p)f, l_name, name);
|
||||
char* name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5b_get_num_field_attribs (f, name2);
|
||||
free (name2);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5bl_getfieldattribinfo F77_NAME ( \
|
||||
h5bl_getfieldattribinfo, \
|
||||
h5bl_getfieldattribinfo_, \
|
||||
h5bl_getfieldattribinfo)
|
||||
h5_int64_t
|
||||
h5bl_getfieldattribinfo (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const h5_int64_t* const attrib_idx,
|
||||
char* const attrib_name,
|
||||
h5_int64_t* const attrib_nelem,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, field_name='%*s', attrib_idx=%lld, "
|
||||
"attrib_name=%p, attrib_nelem=%p",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
(long long)*attrib_idx,
|
||||
attrib_name, attrib_nelem);
|
||||
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
h5_int64_t attrib_type;
|
||||
h5_int64_t herr = h5b_get_field_attrib_info (
|
||||
f,
|
||||
field_name2, *attrib_idx - 1,
|
||||
attrib_name, l_attrib_name,
|
||||
&attrib_type,
|
||||
(h5_size_t*)attrib_nelem );
|
||||
|
||||
h5_strc2for ( attrib_name, l_attrib_name );
|
||||
|
||||
free (field_name2);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
/*
|
||||
_ __
|
||||
(_) / /__
|
||||
| | / / _ \
|
||||
| |/ / (_) |
|
||||
|_/_/ \___/
|
||||
*/
|
||||
static inline h5_int64_t
|
||||
write_field_attrib (
|
||||
h5_file_t* const fh,
|
||||
const char* field_name,
|
||||
const int l_field_name,
|
||||
const char* attrib_name,
|
||||
const int l_attrib_name,
|
||||
const h5_int64_t attrib_type,
|
||||
const void* attrib_value,
|
||||
const hsize_t attrib_nelems
|
||||
) {
|
||||
char *field_name2 = h5_strdupfor2c (field_name, l_field_name);
|
||||
char *attrib_name2 = h5_strdupfor2c (attrib_name, l_attrib_name);
|
||||
h5_int64_t h5err = h5_write_field_attrib (
|
||||
fh, field_name2,
|
||||
attrib_name2, attrib_type,
|
||||
attrib_value, attrib_nelems);
|
||||
free (field_name2);
|
||||
free (attrib_name2);
|
||||
return h5err;
|
||||
}
|
||||
|
||||
static inline h5_int64_t
|
||||
read_field_attrib (
|
||||
h5_file_t* const fh,
|
||||
const char* field_name,
|
||||
const int l_field_name,
|
||||
const char* attrib_name,
|
||||
const int l_attrib_name,
|
||||
const hid_t attrib_type,
|
||||
void* attrib_value
|
||||
) {
|
||||
char *field_name2 = h5_strdupfor2c (field_name, l_field_name);
|
||||
char *attrib_name2 = h5_strdupfor2c (attrib_name, l_attrib_name);
|
||||
h5_int64_t h5err = h5_read_field_attrib (
|
||||
fh, field_name2,
|
||||
attrib_name2, attrib_type, attrib_value);
|
||||
free (field_name2);
|
||||
free (attrib_name2);
|
||||
return h5err;
|
||||
}
|
||||
|
||||
/*
|
||||
_ _
|
||||
___| |_ _ __(_)_ __ __ _
|
||||
/ __| __| '__| | '_ \ / _` |
|
||||
\__ \ |_| | | | | | | (_| |
|
||||
|___/\__|_| |_|_| |_|\__, |
|
||||
|___/
|
||||
*/
|
||||
#define h5bl_writefieldattrib_string F77_NAME ( \
|
||||
h5bl_writefieldattrib_string, \
|
||||
h5bl_writefieldattrib_string_, \
|
||||
H5BL_WRITEFIELDATTRIB_STRING)
|
||||
h5_int64_t
|
||||
h5bl_writefieldattrib_string (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
const char* const attrib_value,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', "
|
||||
"attrib_name='%.*s' attrib_value='%.*s'",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
l_attrib_value, attrib_value);
|
||||
char* attrib_value2 = h5_strdupfor2c (attrib_value, l_attrib_value);
|
||||
h5_int64_t h5err = write_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_STRING_T,
|
||||
attrib_value2, strlen(attrib_value2)+1 );
|
||||
free (attrib_value2);
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
#define h5bl_readfieldattrib_string F77_NAME ( \
|
||||
h5bl_readfieldattrib_string, \
|
||||
h5bl_readfieldattrib_string_, \
|
||||
H5BL_READFIELDATTRIB_STRING)
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_string (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
char* const attrib_value,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, field_name='%.*s', attrib_name='%.*s' attrib_value='%p'",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value);
|
||||
h5_int64_t h5err = read_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_STRING_T, attrib_value);
|
||||
|
||||
h5_strc2for (attrib_value, l_attrib_value);
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
/*
|
||||
_
|
||||
_ __ ___ __ _| |
|
||||
| '__/ _ \/ _` | |
|
||||
| | | __/ (_| | |
|
||||
|_| \___|\__,_|_|
|
||||
*/
|
||||
#define h5bl_writefieldattrib_r8 F77_NAME ( \
|
||||
h5bl_writefieldattrib_r8, \
|
||||
h5bl_writefieldattrib_r8_, \
|
||||
H5BL_WRITEFIELDATTRIB_R8)
|
||||
h5_int64_t
|
||||
h5bl_writefieldattrib_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
const h5_float64_t* const attrib_value,
|
||||
const h5_int64_t* const attrib_nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p, attrib_nelems=%lld",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value, *attrib_nelems);
|
||||
H5_API_RETURN (write_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_R8_T,
|
||||
attrib_value, *attrib_nelems));
|
||||
}
|
||||
|
||||
#define h5bl_readfieldattrib_r8 F77_NAME ( \
|
||||
h5bl_readfieldattrib_r8, \
|
||||
h5bl_readfieldattrib_r8_, \
|
||||
H5BL_READFIELDATTRIB_R8)
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
h5_float64_t* const attrib_value,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value);
|
||||
H5_API_RETURN (read_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_R8_T,
|
||||
attrib_value));
|
||||
}
|
||||
|
||||
#define h5bl_writefieldattrib_r4 F77_NAME ( \
|
||||
h5bl_writefieldattrib_r4, \
|
||||
h5bl_writefieldattrib_r4_, \
|
||||
H5BL_WRITEFIELDATTRIB_R4)
|
||||
h5_int64_t
|
||||
h5bl_writefieldattrib_r4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
const h5_float32_t* const attrib_value,
|
||||
const h5_int64_t* const attrib_nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p, attrib_nelems=%lld",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value, *attrib_nelems);
|
||||
H5_API_RETURN (write_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_R4_T,
|
||||
attrib_value, *attrib_nelems));
|
||||
}
|
||||
|
||||
#define h5bl_readfieldattrib_r4 F77_NAME ( \
|
||||
h5bl_readfieldattrib_r4, \
|
||||
h5bl_readfieldattrib_r4_, \
|
||||
H5BL_READFIELDATTRIB_R4)
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_r4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
h5_float32_t* const attrib_value,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value);
|
||||
H5_API_RETURN (read_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_R4_T,
|
||||
attrib_value));
|
||||
}
|
||||
|
||||
/*
|
||||
_ _
|
||||
(_)_ __ | |_ ___ __ _ ___ _ __
|
||||
| | '_ \| __/ _ \/ _` |/ _ \ '__|
|
||||
| | | | | || __/ (_| | __/ |
|
||||
|_|_| |_|\__\___|\__, |\___|_|
|
||||
|___/
|
||||
*/
|
||||
#define h5bl_writefieldattrib_i8 F77_NAME ( \
|
||||
h5bl_writefieldattrib_i8, \
|
||||
h5bl_writefieldattrib_i8_, \
|
||||
H5BL_WRITEFIELDATTRIB_I8)
|
||||
h5_int64_t
|
||||
h5bl_writefieldattrib_i8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
const h5_int64_t* const attrib_value,
|
||||
const h5_int64_t* const attrib_nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p, attrib_nelems=%lld",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value, *attrib_nelems);
|
||||
H5_API_RETURN (write_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_I8_T,
|
||||
attrib_value, *attrib_nelems));
|
||||
}
|
||||
|
||||
#define h5bl_readfieldattrib_i8 F77_NAME ( \
|
||||
h5bl_readfieldattrib_i8, \
|
||||
h5bl_readfieldattrib_i8_, \
|
||||
H5BL_READFIELDATTRIB_I8)
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_i8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
h5_int64_t* const attrib_value,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name,
|
||||
const int l_attrib_value
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value);
|
||||
H5_API_RETURN (read_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_I8_T,
|
||||
attrib_value));
|
||||
}
|
||||
|
||||
#define h5bl_writefieldattrib_i4 F77_NAME ( \
|
||||
h5bl_writefieldattrib_i4, \
|
||||
h5bl_writefieldattrib_i4_, \
|
||||
H5BL_WRITEFIELDATTRIB_I4 )
|
||||
h5_int64_t
|
||||
h5bl_writefieldattrib_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
const h5_int32_t* const attrib_value,
|
||||
const h5_int64_t* const attrib_nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p, attrib_nelems=%lld",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value, *attrib_nelems);
|
||||
H5_API_RETURN (write_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_I4_T,
|
||||
attrib_value, *attrib_nelems));
|
||||
}
|
||||
|
||||
#define h5bl_readfieldattrib_i4 F77_NAME ( \
|
||||
h5bl_readfieldattrib_i4, \
|
||||
h5bl_readfieldattrib_i4_, \
|
||||
H5BL_READFIELDATTRIB_I4)
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const field_name,
|
||||
const char* const attrib_name,
|
||||
h5_int32_t* const attrib_value,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, field_name='%.*s', attrib_name='%.*s', "
|
||||
"attrib_value=%p",
|
||||
(h5_file_p)f,
|
||||
l_field_name, field_name,
|
||||
l_attrib_name, attrib_name,
|
||||
attrib_value);
|
||||
H5_API_RETURN (read_field_attrib (
|
||||
f,
|
||||
field_name, l_field_name,
|
||||
attrib_name, l_attrib_name,
|
||||
H5_I4_T,
|
||||
attrib_value));
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
|
||||
! __ _ _ _ _ _ _ _ _
|
||||
! / _(_) ___| | __| | __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! | |_| |/ _ \ |/ _` | / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! | _| | __/ | (_| | | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |_| |_|\___|_|\__,_| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
|
||||
!
|
||||
! __ _ _ _ ___ _ __ _ _
|
||||
! / _` | | | |/ _ \ '__| | | |
|
||||
! | (_| | |_| | __/ | | |_| |
|
||||
! \__, |\__,_|\___|_| \__, |
|
||||
! |_| |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockGetNumFieldAttribs
|
||||
!! \return number of attributes or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getnfieldattribs (filehandle, field_name)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockGetFieldAttribInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_getfieldattribinfo (filehandle, field_name, idx, attrib_name, attrib_nelems)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
INTEGER*8,INTENT(IN) :: idx !< index of attribute being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT):: attrib_name !< name of attribute
|
||||
INTEGER*8,INTENT(OUT):: attrib_nelems !< number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
! _ __ _ _
|
||||
! (_) / /__ ___| |_ _ __(_)_ __ __ _
|
||||
! | | / / _ \ / __| __| '__| | '_ \ / _` |
|
||||
! | |/ / (_) | \__ \ |_| | | | | | | (_| |
|
||||
! |_/_/ \___/ |___/\__|_| |_|_| |_|\__, |
|
||||
! |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockWriteFieldAttribString
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_string (filehandle, field_name, attrib_name, attrib_value, attrib_nelems)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelems !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_string (filehandle, field_name, attrib_name, attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! _ __ _
|
||||
! (_) / /__ _ __ ___ __ _| |
|
||||
! | | / / _ \ | '__/ _ \/ _` | |
|
||||
! | |/ / (_) | | | | __/ (_| | |
|
||||
! |_/_/ \___/ |_| \___|\__,_|_|
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!!
|
||||
!! See \ref H5BlockWriteFieldAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_r8 (filehandle, field_name, attrib_name, attrib_value, attrib_nelems)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelems !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockReadFieldAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_r8 ( filehandle, field_name, attrib_name, attrib_value )
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockWriteFieldAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_r4 (filehandle, field_name, attrib_name, attrib_value, attrib_nelems)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
REAL*4, INTENT(OUT):: attrib_value(*) !< attribute datato be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelems !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockReadFieldAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_r4 (filehandle, field_name, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*4, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! _ __ _ _
|
||||
! (_) / /__ (_)_ __ | |_ ___ __ _ ___ _ __
|
||||
! | | / / _ \ | | '_ \| __/ _ \/ _` |/ _ \ '__|
|
||||
! | |/ / (_) | | | | | | || __/ (_| | __/ |
|
||||
! |_/_/ \___/ |_|_| |_|\__\___|\__, |\___|_|
|
||||
! |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockWriteFieldAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_i8 (filehandle, field_name, attrib_name, attrib_value, attrib_nelems)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelems !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockReadFieldAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_i8 (filehandle, field_name, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockWriteFieldAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_writefieldattrib_i4 (filehandle, field_name, attrib_name, attrib_value, attrib_nelems)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelems !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5BlockReadFieldAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_readfieldattrib_i4 (filehandle, field_name, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: field_name !< name of field
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! __ _ _ _ _
|
||||
! / _(_) ___| | __| | ___ _ __ __ _ ___(_)_ __ __ _
|
||||
! | |_| |/ _ \ |/ _` | / __| '_ \ / _` |/ __| | '_ \ / _` |
|
||||
! | _| | __/ | (_| | \__ \ |_) | (_| | (__| | | | | (_| |
|
||||
! |_| |_|\___|_|\__,_| |___/ .__/ \__,_|\___|_|_| |_|\__, |
|
||||
! |_| |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5Block3dGetFieldSpacing
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_get_field_spacing (filehandle, name, x, y, z)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(OUT) :: x
|
||||
REAL*8, INTENT(OUT) :: y
|
||||
REAL*8, INTENT(OUT) :: z
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5Block3dSetFieldSpacing
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_set_field_spacing (filehandle, name, x, y, z)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(IN) :: x
|
||||
REAL*8, INTENT(IN) :: y
|
||||
REAL*8, INTENT(IN) :: z
|
||||
END FUNCTION
|
||||
|
||||
! __ _ _ _ _ _
|
||||
! / _(_) ___| | __| | ___ _ __(_) __ _(_)_ __
|
||||
! | |_| |/ _ \ |/ _` | / _ \| '__| |/ _` | | '_ \
|
||||
! | _| | __/ | (_| | | (_) | | | | (_| | | | | |
|
||||
! |_| |_|\___|_|\__,_| \___/|_| |_|\__, |_|_| |_|
|
||||
! |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5Block3dGetFieldOrigin
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_get_field_origin (filehandle, name, x, y, z)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(OUT) :: x
|
||||
REAL*8, INTENT(OUT) :: y
|
||||
REAL*8, INTENT(OUT) :: z
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5block_attrib_f
|
||||
!! See \ref H5Block3dSetFieldOrigin
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_set_field_origin (filehandle, name, x, y, z)
|
||||
INTEGER*8, INTENT(IN) :: filehandle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL*8, INTENT(IN) :: x
|
||||
REAL*8, INTENT(IN) :: y
|
||||
REAL*8, INTENT(IN) :: z
|
||||
END FUNCTION
|
||||
|
||||
!> @}
|
||||
@@ -0,0 +1,387 @@
|
||||
/*
|
||||
Copyright (c) 2006-2012, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include "h5_private.h"
|
||||
//#include "h5core/h5b_io.h"
|
||||
|
||||
#define h5bl_3d_write_scalar_field_r8 F77_NAME ( \
|
||||
h5bl_3d_write_scalar_field_r8, \
|
||||
h5bl_3d_write_scalar_field_r8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R8 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_float64_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
f, name2, (void*)buffer, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_scalar_field_r8 F77_NAME ( \
|
||||
h5bl_3d_read_scalar_field_r8, \
|
||||
h5bl_3d_read_scalar_field_r8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R8 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_float64_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', buffer=%p, l_name=%d",
|
||||
(h5_file_p)f, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
f, name2, buffer, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_write_vector3d_field_r8 F77_NAME ( \
|
||||
h5bl_3d_write_vector3d_field_r8, \
|
||||
h5bl_3d_write_vector3d_field_r8_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_R8 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_float64_t* const x_buf,
|
||||
const h5_float64_t* const y_buf,
|
||||
const h5_float64_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_vector3d_field_r8 F77_NAME ( \
|
||||
h5bl_3d_read_vector3d_field_r8, \
|
||||
h5bl_3d_read_vector3d_field_r8_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_R8 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_float64_t* const x_buf,
|
||||
h5_float64_t* const y_buf,
|
||||
h5_float64_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_write_scalar_field_r4 F77_NAME ( \
|
||||
h5bl_3d_write_scalar_field_r4, \
|
||||
h5bl_3d_write_scalar_field_r4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R4 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_r4 (
|
||||
const h5_int64_t*const fh,
|
||||
const char* const name,
|
||||
const h5_float32_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', buffer=%p, l_name=%d",
|
||||
(h5_file_p)f, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
f, name2, (void*)buffer, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_scalar_field_r4 F77_NAME ( \
|
||||
h5bl_3d_read_scalar_field_r4, \
|
||||
h5bl_3d_read_scalar_field_r4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R4 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_r4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_float32_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', buffer=%p, l_name=%d",
|
||||
(h5_file_p)f, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
f, name2, buffer, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_write_vector3d_field_r4 F77_NAME ( \
|
||||
h5bl_3d_write_vector3d_field_r4, \
|
||||
h5bl_3d_write_vector3d_field_r4_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_R4 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_r4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_float32_t* const x_buf,
|
||||
const h5_float32_t* const y_buf,
|
||||
const h5_float32_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_vector3d_field_r4 F77_NAME ( \
|
||||
h5bl_3d_read_vector3d_field_r4, \
|
||||
h5bl_3d_read_vector3d_field_r4_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_R4 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_r4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_float32_t* const x_buf,
|
||||
h5_float32_t* const y_buf,
|
||||
h5_float32_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_write_scalar_field_i8 F77_NAME ( \
|
||||
h5bl_3d_write_scalar_field_i8, \
|
||||
h5bl_3d_write_scalar_field_i8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I8 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_i8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_int64_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', buffer=%p, l_name=%d",
|
||||
(h5_file_p)f, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
f, name2, (void*)buffer, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_scalar_field_i8 F77_NAME ( \
|
||||
h5bl_3d_read_scalar_field_i8, \
|
||||
h5bl_3d_read_scalar_field_i8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I8 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_i8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_int64_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', buffer=%p, l_name=%d",
|
||||
(h5_file_p)f, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
f, name2, buffer, H5T_NATIVE_INT64 );
|
||||
free (name2);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_write_vector3d_field_i8 F77_NAME ( \
|
||||
h5bl_3d_write_vector3d_field_i8, \
|
||||
h5bl_3d_write_vector3d_field_i8_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_I8 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_i8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_int64_t* const x_buf,
|
||||
const h5_int64_t* const y_buf,
|
||||
const h5_int64_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_vector3d_field_i8 F77_NAME ( \
|
||||
h5bl_3d_read_vector3d_field_i8, \
|
||||
h5bl_3d_read_vector3d_field_i8_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_I8 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_i8 (
|
||||
const h5_int64_t *const fh,
|
||||
const char* const name,
|
||||
h5_int64_t* const x_buf,
|
||||
h5_int64_t* const y_buf,
|
||||
h5_int64_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_write_scalar_field_i4 F77_NAME ( \
|
||||
h5bl_3d_write_scalar_field_i4, \
|
||||
h5bl_3d_write_scalar_field_i4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I4 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_int32_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', buffer=%p, l_name=%d",
|
||||
(h5_file_p)f, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
f, name2, (void*)buffer, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_scalar_field_i4 F77_NAME ( \
|
||||
h5bl_3d_read_scalar_field_i4, \
|
||||
h5bl_3d_read_scalar_field_i4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I4 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_int32_t* const buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', buffer=%p, l_name=%d",
|
||||
(h5_file_p)f, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
f, name2, buffer, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_write_vector3d_field_i4 F77_NAME ( \
|
||||
h5bl_3d_write_vector3d_field_i4, \
|
||||
h5bl_3d_write_vector3d_field_i4_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_I4 )
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_int32_t* const x_buf,
|
||||
const h5_int32_t* const y_buf,
|
||||
const h5_int32_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5bl_3d_read_vector3d_field_i4 F77_NAME ( \
|
||||
h5bl_3d_read_vector3d_field_i4, \
|
||||
h5bl_3d_read_vector3d_field_i4_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_I4 )
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_int32_t* const x_buf,
|
||||
h5_int32_t* const y_buf,
|
||||
h5_int32_t* const z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"fh=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
(h5_file_p)f, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
f, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
!> \ingroup h5hut_f90_api
|
||||
!! \addtogroup h5block_data_f
|
||||
!! @{
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteScalarFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r8 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(IN) :: buffer(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadScalarFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r8 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(OUT) :: buffer(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteVector3dFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_r8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
REAL*8, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
REAL*8, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadVector3dFieldFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_r8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
REAL*8, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
REAL*8, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteScalarFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r4 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(IN) :: buffer(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadScalarFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r4 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(OUT) :: buffer(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteVector3dFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_r4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
REAL*4, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
REAL*4, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadVector3dFieldFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_r4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*4, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
REAL*4, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
REAL*4, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteScalarFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i8 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(IN) :: buffer(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadScalarFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i8 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(OUT) :: buffer(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteVector3dFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_i8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
INTEGER*8, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
INTEGER*8, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadVector3dFieldInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_i8 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
INTEGER*8, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
INTEGER*8, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteScalarFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i4 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(IN) :: buffer(*) !< the array of data
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadScalarFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i4 ( filehandle, name, buffer )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(OUT) :: buffer(*) !< buffer to read the data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dWriteVector3dFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_write_vector3d_field_i4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(IN) :: x(*) !< the array of x data to write
|
||||
INTEGER*4, INTENT(IN) :: y(*) !< the array of y data to write
|
||||
INTEGER*4, INTENT(IN) :: z(*) !< the array of z data to write
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! See \ref H5Block3dReadVector3dFieldInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5bl_3d_read_vector3d_field_i4 ( filehandle, name, x, y, z )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*4, INTENT(OUT) :: x(*) !< buffer to read the x data into
|
||||
INTEGER*4, INTENT(OUT) :: y(*) !< buffer to read the y data into
|
||||
INTEGER*4, INTENT(OUT) :: z(*) !< buffer to read the z data into
|
||||
END FUNCTION
|
||||
|
||||
!> @}
|
||||
+328
-328
@@ -13,664 +13,664 @@
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_r8 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_r8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R8 )
|
||||
h5bl_3d_write_scalar_field_r8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_DOUBLE );
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_r8 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_r8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R8 )
|
||||
h5bl_3d_read_scalar_field_r8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
fh, name2, buffer, H5T_NATIVE_DOUBLE );
|
||||
fh, name2, buffer, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_vector3d_field_r8 F77NAME ( \
|
||||
h5bl_3d_write_vector3d_field_r8_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_R8 )
|
||||
h5bl_3d_write_vector3d_field_r8_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *x_buf,
|
||||
const h5_float64_t *y_buf,
|
||||
const h5_float64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *x_buf,
|
||||
const h5_float64_t *y_buf,
|
||||
const h5_float64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_vector3d_field_r8 F77NAME ( \
|
||||
h5bl_3d_read_vector3d_field_r8_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_R8 )
|
||||
h5bl_3d_read_vector3d_field_r8_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *x_buf,
|
||||
h5_float64_t *y_buf,
|
||||
h5_float64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *x_buf,
|
||||
h5_float64_t *y_buf,
|
||||
h5_float64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_r4 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_r4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R4 )
|
||||
h5bl_3d_write_scalar_field_r4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_FLOAT );
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_r4 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_r4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R4 )
|
||||
h5bl_3d_read_scalar_field_r4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
fh, name2, buffer, H5T_NATIVE_FLOAT );
|
||||
fh, name2, buffer, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_vector3d_field_r4 F77NAME ( \
|
||||
h5bl_3d_write_vector3d_field_r4_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_R4 )
|
||||
h5bl_3d_write_vector3d_field_r4_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *x_buf,
|
||||
const h5_float32_t *y_buf,
|
||||
const h5_float32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *x_buf,
|
||||
const h5_float32_t *y_buf,
|
||||
const h5_float32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_vector3d_field_r4 F77NAME ( \
|
||||
h5bl_3d_read_vector3d_field_r4_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_R4 )
|
||||
h5bl_3d_read_vector3d_field_r4_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float32_t *x_buf,
|
||||
h5_float32_t *y_buf,
|
||||
h5_float32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float32_t *x_buf,
|
||||
h5_float32_t *y_buf,
|
||||
h5_float32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_i8 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_i8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I8 )
|
||||
h5bl_3d_write_scalar_field_i8_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_INT64 );
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_i8 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_i8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I8 )
|
||||
h5bl_3d_read_scalar_field_i8_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
fh, name2, buffer, H5T_NATIVE_INT64 );
|
||||
fh, name2, buffer, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_vector3d_field_i8 F77NAME ( \
|
||||
h5bl_3d_write_vector3d_field_i8_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_I8 )
|
||||
h5bl_3d_write_vector3d_field_i8_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *x_buf,
|
||||
const h5_int64_t *y_buf,
|
||||
const h5_int64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *x_buf,
|
||||
const h5_int64_t *y_buf,
|
||||
const h5_int64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_vector3d_field_i8 F77NAME ( \
|
||||
h5bl_3d_read_vector3d_field_i8_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_I8 )
|
||||
h5bl_3d_read_vector3d_field_i8_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int64_t *x_buf,
|
||||
h5_int64_t *y_buf,
|
||||
h5_int64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int64_t *x_buf,
|
||||
h5_int64_t *y_buf,
|
||||
h5_int64_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_scalar_field_i4 F77NAME ( \
|
||||
h5bl_3d_write_scalar_field_i4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I4 )
|
||||
h5bl_3d_write_scalar_field_i4_, \
|
||||
H5BL_3D_WRITE_SCALAR_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_scalar_field_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_scalar_data (
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_INT32 );
|
||||
fh, name2, (void*)buffer, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_scalar_field_i4 F77NAME ( \
|
||||
h5bl_3d_read_scalar_field_i4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I4 )
|
||||
h5bl_3d_read_scalar_field_i4_, \
|
||||
H5BL_3D_READ_SCALAR_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_scalar_field_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name, buffer, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_scalar_data (
|
||||
fh, name2, buffer, H5T_NATIVE_INT32 );
|
||||
fh, name2, buffer, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_write_vector3d_field_i4 F77NAME ( \
|
||||
h5bl_3d_write_vector3d_field_i4_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_I4 )
|
||||
h5bl_3d_write_vector3d_field_i4_, \
|
||||
H5BL_3D_WRITE_VECTOR3D_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_write_vector3d_field_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *x_buf,
|
||||
const h5_int32_t *y_buf,
|
||||
const h5_int32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *x_buf,
|
||||
const h5_int32_t *y_buf,
|
||||
const h5_int32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_write_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_3d_read_vector3d_field_i4 F77NAME ( \
|
||||
h5bl_3d_read_vector3d_field_i4_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_I4 )
|
||||
h5bl_3d_read_vector3d_field_i4_, \
|
||||
H5BL_3D_READ_VECTOR3D_FIELD_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_3d_read_vector3d_field_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int32_t *x_buf,
|
||||
h5_int32_t *y_buf,
|
||||
h5_int32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_int32_t *x_buf,
|
||||
h5_int32_t *y_buf,
|
||||
h5_int32_t *z_buf,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
"f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p, l_name=%d",
|
||||
fh, name, x_buf, y_buf, z_buf, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5b_read_vector3d_data (
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
|
||||
fh, name2,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_r8 F77NAME ( \
|
||||
h5bl_writefieldattrib_r8_, \
|
||||
H5BL_WRITEFIELDATTRIB_R8 )
|
||||
h5bl_writefieldattrib_r8_, \
|
||||
H5BL_WRITEFIELDATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_writefieldattrib_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_write_field_attrib (
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_DOUBLE, buffer, *nelems );
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_DOUBLE, buffer, *nelems );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_readfieldattrib_r8 F77NAME ( \
|
||||
h5bl_readfieldattrib_r8_, \
|
||||
H5BL_READFIELDATTRIB_R8 )
|
||||
h5bl_readfieldattrib_r8_, \
|
||||
H5BL_READFIELDATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_read_field_attrib (
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_DOUBLE, buffer );
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_DOUBLE, buffer );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_r4 F77NAME ( \
|
||||
h5bl_writefieldattrib_r4_, \
|
||||
H5BL_WRITEFIELDATTRIB_R4 )
|
||||
h5bl_writefieldattrib_r4_, \
|
||||
H5BL_WRITEFIELDATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_writefieldattrib_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_float32_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_float32_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_write_field_attrib (
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_FLOAT, buffer, *nelems );
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_FLOAT, buffer, *nelems );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_readfieldattrib_r4 F77NAME ( \
|
||||
h5bl_readfieldattrib_r4_, \
|
||||
H5BL_READFIELDATTRIB_R4 )
|
||||
h5bl_readfieldattrib_r4_, \
|
||||
H5BL_READFIELDATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_float32_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_float32_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_read_field_attrib (
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_FLOAT, buffer );
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_FLOAT, buffer );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_i8 F77NAME ( \
|
||||
h5bl_writefieldattrib_i8_, \
|
||||
H5BL_WRITEFIELDATTRIB_I8 )
|
||||
h5bl_writefieldattrib_i8_, \
|
||||
H5BL_WRITEFIELDATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_writefieldattrib_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_write_field_attrib (
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_INT64, buffer, *nelems );
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_INT64, buffer, *nelems );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_readfieldattrib_i8 F77NAME ( \
|
||||
h5bl_readfieldattrib_i8_, \
|
||||
H5BL_READFIELDATTRIB_I8 )
|
||||
h5bl_readfieldattrib_i8_, \
|
||||
H5BL_READFIELDATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_int64_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_int64_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_read_field_attrib (
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_INT64, buffer );
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_INT64, buffer );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_writefieldattrib_i4 F77NAME ( \
|
||||
h5bl_writefieldattrib_i4_, \
|
||||
H5BL_WRITEFIELDATTRIB_I4 )
|
||||
h5bl_writefieldattrib_i4_, \
|
||||
H5BL_WRITEFIELDATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_writefieldattrib_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_size_t *nelems,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer, (long long)*nelems,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_write_field_attrib (
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_INT32, buffer, *nelems );
|
||||
fh, field_name2, attrib_name2,
|
||||
H5T_NATIVE_INT32, buffer, *nelems );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5bl_readfieldattrib_i4 F77NAME ( \
|
||||
h5bl_readfieldattrib_i4_, \
|
||||
H5BL_READFIELDATTRIB_I4 )
|
||||
h5bl_readfieldattrib_i4_, \
|
||||
H5BL_READFIELDATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfieldattrib_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_int32_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_int32_t *buffer,
|
||||
const int l_field_name,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"values=%p, l_field_name=%d, l_attrib_name=%d",
|
||||
fh, field_name, attrib_name, buffer,
|
||||
l_field_name, l_attrib_name);
|
||||
char *field_name2 = h5_strdupfor2c ( field_name, l_field_name );
|
||||
char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name );
|
||||
h5_err_t herr = h5_read_field_attrib (
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_INT32, buffer );
|
||||
fh, field_name2, attrib_name2, H5T_NATIVE_INT32, buffer );
|
||||
free ( field_name2 );
|
||||
free ( attrib_name2 );
|
||||
H5_API_RETURN(herr);
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
! Declaration of subroutines for Fortran Bindings
|
||||
|
||||
!!!!!!!! File Opening and Closing !!!!!!!!
|
||||
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a file for reading. See \ref H5OpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openr ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a file for writing in truncate mode. See \ref H5OpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openw ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a file for writing in append mode. See \ref H5OpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_opena ( filename )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a parallel file for reading. See \ref H5OpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openr_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a parallel file for writing in truncate mode. See \ref H5OpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openw_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a parallel file for writing in append mode. See \ref H5OpenFile
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_opena_par ( filename, mpi_communicator )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a file for reading and specifies an HDF5 alignment.
|
||||
!! See \ref H5OpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openr_align ( filename, align )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a file for writing in truncate mode and specifies an HDF5 alignment.
|
||||
!! See \ref H5OpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openw_align ( filename, align )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a file for writing in append mode and specifies an HDF5 alignment.
|
||||
!! See \ref H5OpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_opena_align ( filename, align )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a parallel file for reading and specifies an HDF5 alignment.
|
||||
!! See \ref H5OpenFileAlign
|
||||
!!
|
||||
!! Flags are specified as a comma separated string that can include:
|
||||
!!
|
||||
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||
!!
|
||||
!! See \ref H5OpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openr_par_align ( filename, mpi_communicator, align, flags )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a parallel file for writing in truncate mode and specifies
|
||||
!! an HDF5 alignment.
|
||||
!!
|
||||
!! Flags are specified as a comma separated string that can include:
|
||||
!!
|
||||
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||
!!
|
||||
!! See \ref H5OpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_openw_par_align ( filename, mpi_communicator, align, flags )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for writing
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Opens a parallel file for writing in append mode and specifies
|
||||
!! an HDF5 alignment.
|
||||
!!
|
||||
!! Flags are specified as a comma separated string that can include:
|
||||
!!
|
||||
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||
!!
|
||||
!! See \ref H5OpenFileAlign
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_opena_par_align ( filename, mpi_communicator, align, flags )
|
||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for appending
|
||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Closes a file. See \ref H5CloseFile
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5_close ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Close HDF5 library. See \ref H5Finalize
|
||||
!! \return \c H5_SUCCESS or \c H5_FAILURE
|
||||
INTEGER*8 FUNCTION h5_finalize ()
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_file_f
|
||||
!! Checks that a file is valid. See \ref H5CheckFile
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5_check ( filehandle )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_model_f
|
||||
!! See \ref H5SetStep
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5_setstep (filehandle,step)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: step !< a timestep value >= 1
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_model_f
|
||||
!! See \ref H5GetStep
|
||||
!! \return the the current step or \c H5_FAILURE
|
||||
INTEGER*8 FUNCTION h5_getstep (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_model_f
|
||||
!! See \ref H5GetNumSteps
|
||||
!! \return the number of steps or error code
|
||||
INTEGER*8 FUNCTION h5_getnsteps (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_error_f
|
||||
!! See \ref H5SetVerbosityLevel
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5_set_verbosity_level ( level )
|
||||
INTEGER*8, INTENT(IN) :: level !< the level from 0 (no output) to 5 (most detailed)
|
||||
END FUNCTION
|
||||
|
||||
Executable
+219
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
Copyright (c) 2006-2012, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include "h5_private.h"
|
||||
#include "h5core/h5u_model.h"
|
||||
|
||||
/*==============Reading Data Characteristics============*/
|
||||
|
||||
#define h5pt_getndatasets F77_NAME ( \
|
||||
h5pt_getndatasets, \
|
||||
h5pt_getndatasets_, \
|
||||
H5PT_GETNDATASETS )
|
||||
h5_int64_t
|
||||
h5pt_getndatasets (
|
||||
const h5_int64_t* const fh
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t, "fh=%p", (h5_file_p)f);
|
||||
H5_API_RETURN(h5u_get_num_datasets (f));
|
||||
}
|
||||
|
||||
#define h5pt_getnpoints F77_NAME ( \
|
||||
h5pt_getnpoints, \
|
||||
h5pt_getnpoints_, \
|
||||
H5PT_GETNPOINTS )
|
||||
h5_int64_t
|
||||
h5pt_getnpoints (
|
||||
const h5_int64_t* const fh
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t, "fh=%p", (h5_file_p)f);
|
||||
H5_API_RETURN (h5u_get_num_particles (f));
|
||||
}
|
||||
|
||||
#define h5pt_getdatasetname F77_NAME ( \
|
||||
h5pt_getdatasetname, \
|
||||
h5pt_getdatasetname_, \
|
||||
H5PT_GETDATASETNAME )
|
||||
h5_int64_t
|
||||
h5pt_getdatasetname (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* index,
|
||||
char* name,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, index=%lld, name='%s', l_name=%d",
|
||||
(h5_file_p)f, (long long)*index, name, l_name);
|
||||
h5_int64_t herr = h5u_get_dataset_info (
|
||||
f, *index - 1, name, l_name, NULL, NULL );
|
||||
h5_strc2for (name, l_name);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5pt_getdatasetinfo F77_NAME( \
|
||||
h5pt_getdatasetinfo, \
|
||||
h5pt_getdatasetinfo_, \
|
||||
H5PT_GETDATASETINFO)
|
||||
h5_int64_t
|
||||
h5pt_getdatasetinfo (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* dataset_idx,
|
||||
char* dataset_name,
|
||||
h5_int64_t* dataset_type,
|
||||
h5_int64_t* dataset_nelem,
|
||||
const int l_dataset_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, "
|
||||
"dataset_idx=%lld, "
|
||||
"dataset_name=%p, "
|
||||
"dataset_type=%p, "
|
||||
"dataset_nelem=%p",
|
||||
(h5_file_p)f,
|
||||
(long long)*dataset_idx,
|
||||
dataset_name, dataset_type, dataset_nelem);
|
||||
h5_int64_t h5err = h5u_get_dataset_info (
|
||||
f,
|
||||
*dataset_idx - 1,
|
||||
dataset_name, l_dataset_name,
|
||||
dataset_type,
|
||||
(h5_size_t*)dataset_nelem);
|
||||
h5_strc2for (dataset_name, l_dataset_name);
|
||||
convert_type2for (dataset_type);
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
/*=============Setting and getting views================*/
|
||||
|
||||
#define h5pt_setview F77_NAME ( \
|
||||
h5pt_setview, \
|
||||
h5pt_setview_, \
|
||||
H5PT_SETVIEW )
|
||||
h5_int64_t
|
||||
h5pt_setview (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* const start,
|
||||
const h5_int64_t* const end
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, start=%lld, end=%lld",
|
||||
(h5_file_p)f, (long long)*start, (long long)*end);
|
||||
H5_API_RETURN (h5u_set_view (f, (*start)-1, (*end)-1));
|
||||
}
|
||||
|
||||
#define h5pt_setview_indices F77_NAME ( \
|
||||
h5pt_setview_indices, \
|
||||
h5pt_setview_indices_, \
|
||||
H5PT_SETVIEW_INDICES )
|
||||
h5_int64_t
|
||||
h5pt_setview_indices (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* const indices,
|
||||
const h5_int64_t* const nelem
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, indices=%p, nelem=%lld",
|
||||
(h5_file_p)f, indices, (long long)*nelem);
|
||||
h5_size_t* findices;
|
||||
TRY (findices = h5_calloc (*nelem, sizeof (*indices)));
|
||||
for (size_t i = 0; i < *nelem; i++)
|
||||
findices[i] = indices[i] - 1;
|
||||
TRY (h5u_set_view_indices (f, findices, *nelem));
|
||||
TRY (h5_free (findices));
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
#define h5pt_setnpoints F77_NAME ( \
|
||||
h5pt_setnpoints, \
|
||||
h5pt_setnpoints_, \
|
||||
H5PT_SETNPOINTS )
|
||||
h5_int64_t
|
||||
h5pt_setnpoints (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* const npoints
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, npoints=%lld",
|
||||
(h5_file_p)f, (long long)*npoints);
|
||||
H5_API_RETURN (h5u_set_num_particles (f, *npoints, 1));
|
||||
}
|
||||
|
||||
#define h5pt_setnpoints_strided F77_NAME ( \
|
||||
h5pt_setnpoints_strided, \
|
||||
h5pt_setnpoints_strided_, \
|
||||
H5PT_SETNPOINTS_STRIDED )
|
||||
h5_int64_t
|
||||
h5pt_setnpoints_strided (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* const npoints,
|
||||
const h5_int64_t* const stride
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, npoints=%lld, stride=%lld",
|
||||
(h5_file_p)f, (long long)*npoints, (long long)*stride);
|
||||
H5_API_RETURN (h5u_set_num_particles (f, *npoints, *stride));
|
||||
}
|
||||
|
||||
#define h5pt_resetview F77_NAME ( \
|
||||
h5pt_resetview, \
|
||||
h5pt_resetview_, \
|
||||
H5PT_RESETVIEW )
|
||||
h5_int64_t
|
||||
h5pt_resetview (
|
||||
const h5_int64_t* const fh
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p",
|
||||
(h5_file_p)f);
|
||||
H5_API_RETURN (h5u_reset_view (f));
|
||||
}
|
||||
|
||||
#define h5pt_hasview F77_NAME ( \
|
||||
h5pt_hasview, \
|
||||
h5pt_hasview_, \
|
||||
H5PT_HASVIEW )
|
||||
h5_int64_t
|
||||
h5pt_hasview (
|
||||
const h5_int64_t* const fh
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p",
|
||||
(h5_file_p)f);
|
||||
H5_API_RETURN (h5u_has_view (f));
|
||||
}
|
||||
|
||||
#define h5pt_getview F77_NAME ( \
|
||||
h5pt_getview, \
|
||||
h5pt_getview_, \
|
||||
H5PT_GETVIEW )
|
||||
h5_int64_t
|
||||
h5pt_getview (
|
||||
const h5_int64_t* const fh,
|
||||
h5_int64_t* const start,
|
||||
h5_int64_t* const end
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, start=%p, end=%p",
|
||||
(h5_file_p)f, start, end);
|
||||
TRY (h5u_get_view (f, start, end));
|
||||
*start += 1;
|
||||
*end += 1;
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
!!!!!!!! Setting up the Data Model !!!!!!!!
|
||||
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartSetNumParticles
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setnpoints ( filehandle, npoints )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: npoints !< the number of particles on *this* processor
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartSetNumParticlesStrided
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setnpoints_strided ( filehandle, npoints, stride )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: npoints !< the number of particles on *this* processor
|
||||
INTEGER*8, INTENT(IN) :: stride !< the stride value (e.g. the number of fields in the particle data array)
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartGetNumDatasets
|
||||
!! \return the number of datasets or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getndatasets (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartGetNumParticles
|
||||
!! \return the number of particles or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getnpoints (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartGetDatasetName
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getdatasetname (filehandle,index,name)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: index !< index of dataset to query (starting from 0)
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name !< buffer to read the dataset name into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartGetDatasetInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getdatasetinfo (filehandle, idx, name, type, num_elems)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
INTEGER*8,INTENT(IN) :: idx !< index of dataset being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT):: name !< name of datset
|
||||
INTEGER*8,INTENT(OUT):: type !< type of datset
|
||||
INTEGER*8,INTENT(OUT):: num_elems !< number of elements in the dataset
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartSetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setview (filehandle,start,end)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: start !< offset of the first particle in the view
|
||||
INTEGER*8, INTENT(IN) :: end !< offset of the last particle in the view (inclusive)
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartSetViewIndices
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_setview_indices (filehandle,indices,nelem)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(IN) :: indices(*) !< list of indicies to select in this view
|
||||
INTEGER*8, INTENT(IN) :: nelem !< number of particles in the list
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartResetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_resetview (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartResetView
|
||||
!! \return 1 if true, 0 if false, or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_hasview (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_model_f
|
||||
!!
|
||||
!! See \ref H5PartGetView
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5pt_getview (filehandle,start,end)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
INTEGER*8, INTENT(OUT) :: start !< buffer to store the offset of the first particle in the view
|
||||
INTEGER*8, INTENT(OUT) :: end !< buffer to store the offset of the last particle in the view (inclusive)
|
||||
END FUNCTION
|
||||
+145
-145
@@ -12,73 +12,73 @@
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
|
||||
#define h5pt_setnpoints F77NAME ( \
|
||||
h5pt_setnpoints_, \
|
||||
H5PT_SETNPOINTS )
|
||||
#define h5pt_setnpoints_strided F77NAME ( \
|
||||
h5pt_setnpoints_strided_, \
|
||||
H5PT_SETNPOINTS_STRIDED )
|
||||
#define h5pt_getnsteps F77NAME ( \
|
||||
h5pt_getnsteps_, \
|
||||
H5PT_GETNSTEPS )
|
||||
#define h5pt_getndatasets F77NAME ( \
|
||||
h5pt_getndatasets_, \
|
||||
H5PT_GETNDATASETS )
|
||||
#define h5pt_getnpoints F77NAME ( \
|
||||
h5pt_getnpoints_, \
|
||||
H5PT_GETNPOINTS )
|
||||
#define h5pt_getdatasetname F77NAME ( \
|
||||
h5pt_getdatasetname_, \
|
||||
H5PT_GETDATASETNAME )
|
||||
#define h5pt_setview F77NAME ( \
|
||||
h5pt_setview_, \
|
||||
H5PT_SETVIEW )
|
||||
#define h5pt_setview_indices F77NAME ( \
|
||||
h5pt_setview_indices_, \
|
||||
H5PT_SETVIEW_INDICES )
|
||||
#define h5pt_resetview F77NAME ( \
|
||||
h5pt_resetview_, \
|
||||
H5PT_RESETVIEW )
|
||||
#define h5pt_hasview F77NAME ( \
|
||||
h5pt_hasview_, \
|
||||
H5PT_HASVIEW )
|
||||
#define h5pt_getview F77NAME ( \
|
||||
h5pt_getview_, \
|
||||
H5PT_GETVIEW )
|
||||
#define h5pt_writedata_r8 F77NAME ( \
|
||||
h5pt_writedata_r8_, \
|
||||
H5PT_WRITEDATA_R8 )
|
||||
#define h5pt_writedata_r4 F77NAME ( \
|
||||
h5pt_writedata_r4_, \
|
||||
H5PT_WRITEDATA_R4 )
|
||||
#define h5pt_writedata_i8 F77NAME ( \
|
||||
h5pt_writedata_i8_, \
|
||||
H5PT_WRITEDATA_I8 )
|
||||
#define h5pt_writedata_i4 F77NAME ( \
|
||||
h5pt_writedata_i4_, \
|
||||
H5PT_WRITEDATA_I4 )
|
||||
#define h5pt_readdata_r8 F77NAME ( \
|
||||
h5pt_readdata_r8_, \
|
||||
H5PT_READDATA_R8 )
|
||||
#define h5pt_readdata_r4 F77NAME ( \
|
||||
h5pt_readdata_r4_, \
|
||||
H5PT_READDATA_R4 )
|
||||
#define h5pt_readdata_i8 F77NAME ( \
|
||||
h5pt_readdata_i8_, \
|
||||
H5PT_READDATA_I8 )
|
||||
#define h5pt_readdata_i4 F77NAME ( \
|
||||
h5pt_readdata_i4_, \
|
||||
H5PT_READDATA_I4 )
|
||||
#define h5pt_setnpoints F77NAME ( \
|
||||
h5pt_setnpoints_, \
|
||||
H5PT_SETNPOINTS )
|
||||
#define h5pt_setnpoints_strided F77NAME ( \
|
||||
h5pt_setnpoints_strided_, \
|
||||
H5PT_SETNPOINTS_STRIDED )
|
||||
#define h5pt_getnsteps F77NAME ( \
|
||||
h5pt_getnsteps_, \
|
||||
H5PT_GETNSTEPS )
|
||||
#define h5pt_getndatasets F77NAME ( \
|
||||
h5pt_getndatasets_, \
|
||||
H5PT_GETNDATASETS )
|
||||
#define h5pt_getnpoints F77NAME ( \
|
||||
h5pt_getnpoints_, \
|
||||
H5PT_GETNPOINTS )
|
||||
#define h5pt_getdatasetname F77NAME ( \
|
||||
h5pt_getdatasetname_, \
|
||||
H5PT_GETDATASETNAME )
|
||||
#define h5pt_setview F77NAME ( \
|
||||
h5pt_setview_, \
|
||||
H5PT_SETVIEW )
|
||||
#define h5pt_setview_indices F77NAME ( \
|
||||
h5pt_setview_indices_, \
|
||||
H5PT_SETVIEW_INDICES )
|
||||
#define h5pt_resetview F77NAME ( \
|
||||
h5pt_resetview_, \
|
||||
H5PT_RESETVIEW )
|
||||
#define h5pt_hasview F77NAME ( \
|
||||
h5pt_hasview_, \
|
||||
H5PT_HASVIEW )
|
||||
#define h5pt_getview F77NAME ( \
|
||||
h5pt_getview_, \
|
||||
H5PT_GETVIEW )
|
||||
#define h5pt_writedata_r8 F77NAME ( \
|
||||
h5pt_writedata_r8_, \
|
||||
H5PT_WRITEDATA_R8 )
|
||||
#define h5pt_writedata_r4 F77NAME ( \
|
||||
h5pt_writedata_r4_, \
|
||||
H5PT_WRITEDATA_R4 )
|
||||
#define h5pt_writedata_i8 F77NAME ( \
|
||||
h5pt_writedata_i8_, \
|
||||
H5PT_WRITEDATA_I8 )
|
||||
#define h5pt_writedata_i4 F77NAME ( \
|
||||
h5pt_writedata_i4_, \
|
||||
H5PT_WRITEDATA_I4 )
|
||||
#define h5pt_readdata_r8 F77NAME ( \
|
||||
h5pt_readdata_r8_, \
|
||||
H5PT_READDATA_R8 )
|
||||
#define h5pt_readdata_r4 F77NAME ( \
|
||||
h5pt_readdata_r4_, \
|
||||
H5PT_READDATA_R4 )
|
||||
#define h5pt_readdata_i8 F77NAME ( \
|
||||
h5pt_readdata_i8_, \
|
||||
H5PT_READDATA_I8 )
|
||||
#define h5pt_readdata_i4 F77NAME ( \
|
||||
h5pt_readdata_i4_, \
|
||||
H5PT_READDATA_I4 )
|
||||
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5pt_setnpoints (
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *n
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *n
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, n=%lld", fh, (long long)*n);
|
||||
@@ -87,14 +87,14 @@ h5pt_setnpoints (
|
||||
|
||||
h5_err_t
|
||||
h5pt_setnpoints_strided (
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *n,
|
||||
h5_int64_t *stride
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *n,
|
||||
h5_int64_t *stride
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, n=%lld, stride=%lld",
|
||||
fh, (long long)*n, (long long)*stride);
|
||||
fh, (long long)*n, (long long)*stride);
|
||||
H5_API_RETURN(h5u_set_num_particles ( fh, *n, *stride ));
|
||||
}
|
||||
|
||||
@@ -102,8 +102,8 @@ h5pt_setnpoints_strided (
|
||||
|
||||
h5_int64_t
|
||||
h5pt_getndatasets (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", fh);
|
||||
@@ -112,8 +112,8 @@ h5pt_getndatasets (
|
||||
|
||||
h5_int64_t
|
||||
h5pt_getnpoints (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", fh);
|
||||
@@ -121,18 +121,18 @@ h5pt_getnpoints (
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_getdatasetname (
|
||||
const h5_int64_t *f,
|
||||
const h5_int64_t *index,
|
||||
char *name,
|
||||
const int l_name
|
||||
) {
|
||||
h5pt_getdatasetname (
|
||||
const h5_int64_t *f,
|
||||
const h5_int64_t *index,
|
||||
char *name,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, index=%lld, name='%s', l_name=%d",
|
||||
fh, (long long)*index, name, l_name);
|
||||
fh, (long long)*index, name, l_name);
|
||||
h5_err_t herr = h5u_get_dataset_info (
|
||||
fh, *index, name, l_name, NULL, NULL );
|
||||
fh, *index, name, l_name, NULL, NULL );
|
||||
h5_strc2for ( name, l_name );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
@@ -141,14 +141,14 @@ h5pt_getdatasetname (
|
||||
|
||||
h5_err_t
|
||||
h5pt_setview (
|
||||
const h5_int64_t *f,
|
||||
const h5_int64_t *start,
|
||||
const h5_int64_t *end
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
const h5_int64_t *start,
|
||||
const h5_int64_t *end
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, start=%lld, end=%lld",
|
||||
fh, (long long)*start, (long long)*end);
|
||||
fh, (long long)*start, (long long)*end);
|
||||
H5_API_RETURN(h5u_set_view ( fh, (*start)-1, (*end)-1 ));
|
||||
}
|
||||
|
||||
@@ -161,14 +161,14 @@ h5pt_setview_indices (
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, indices=%p, nelem=%lld",
|
||||
fh, indices, (long long)*nelem);
|
||||
fh, indices, (long long)*nelem);
|
||||
H5_API_RETURN(h5u_set_view_indices ( fh, (const h5_size_t*const)indices, *nelem ));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_resetview (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p", fh);
|
||||
@@ -177,8 +177,8 @@ h5pt_resetview (
|
||||
|
||||
h5_err_t
|
||||
h5pt_hasview (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p", fh);
|
||||
@@ -187,14 +187,14 @@ h5pt_hasview (
|
||||
|
||||
h5_err_t
|
||||
h5pt_getview (
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *start,
|
||||
h5_int64_t *end
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *start,
|
||||
h5_int64_t *end
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, start=%p, end=%p",
|
||||
fh, start, end);
|
||||
fh, start, end);
|
||||
H5_API_RETURN(h5u_get_view ( fh, start, end));
|
||||
}
|
||||
|
||||
@@ -202,68 +202,68 @@ h5pt_getview (
|
||||
/*==================Writing data ============*/
|
||||
h5_err_t
|
||||
h5pt_writedata_r8 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_float64_t *data,
|
||||
const int l_name ) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_float64_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_write_data (
|
||||
fh, name2, (void*)data, H5T_NATIVE_DOUBLE );
|
||||
fh, name2, (void*)data, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_writedata_r4 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_float32_t *data,
|
||||
const int l_name ) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_float32_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_write_data (
|
||||
fh, name2, (void*)data, H5T_NATIVE_FLOAT );
|
||||
fh, name2, (void*)data, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_writedata_i8 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_int64_t *data,
|
||||
const int l_name ) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_int64_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_write_data (
|
||||
fh, name2, (void*)data, H5T_NATIVE_INT64 );
|
||||
fh, name2, (void*)data, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_writedata_i4 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_int32_t *data,
|
||||
const int l_name ) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
const h5_int32_t *data,
|
||||
const int l_name ) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_write_data (
|
||||
fh, name2, (void*)data, H5T_NATIVE_INT32 );
|
||||
fh, name2, (void*)data, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
@@ -272,54 +272,54 @@ h5pt_writedata_i4 (
|
||||
/*==================Reading data ============*/
|
||||
h5_err_t
|
||||
h5pt_readdata_r8 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_float64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_float64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_read_data (
|
||||
fh, name2, data, H5T_NATIVE_DOUBLE );
|
||||
fh, name2, data, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_readdata_r4 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_float32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_float32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_read_data (
|
||||
fh, name2, data, H5T_NATIVE_FLOAT );
|
||||
fh, name2, data, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_readdata_i8 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_int64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_int64_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_read_data (
|
||||
fh, name2, data, H5T_NATIVE_INT64 );
|
||||
fh, name2, data, H5T_NATIVE_INT64 );
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
@@ -327,18 +327,18 @@ h5pt_readdata_i8 (
|
||||
|
||||
h5_err_t
|
||||
h5pt_readdata_i4 (
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_int32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
const h5_int64_t *f,
|
||||
const char *name,
|
||||
h5_int32_t *data,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, l_name=%d",
|
||||
fh, name, data, l_name);
|
||||
fh, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_err_t herr = h5u_read_data (
|
||||
fh, name2, data, H5T_NATIVE_INT32 );
|
||||
fh, name2, data, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
Copyright (c) 2006-2013, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include "h5_private.h"
|
||||
|
||||
/*==================Writing data ============*/
|
||||
#define h5pt_writedata_r8 F77_NAME ( \
|
||||
h5pt_writedata_r8, \
|
||||
h5pt_writedata_r8_, \
|
||||
H5PT_WRITEDATA_R8 )
|
||||
h5_int64_t
|
||||
h5pt_writedata_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_float64_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_write_data (
|
||||
f, name2, (void*)data, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5pt_writedata_r4 F77_NAME ( \
|
||||
h5pt_writedata_r4, \
|
||||
h5pt_writedata_r4_, \
|
||||
H5PT_WRITEDATA_R4 )
|
||||
h5_int64_t
|
||||
h5pt_writedata_r4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_float32_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_write_data (
|
||||
f, name2, (void*)data, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5pt_writedata_i8 F77_NAME ( \
|
||||
h5pt_writedata_i8, \
|
||||
h5pt_writedata_i8_, \
|
||||
H5PT_WRITEDATA_I8 )
|
||||
h5_int64_t
|
||||
h5pt_writedata_i8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_int64_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_write_data (
|
||||
f, name2, (void*)data, H5T_NATIVE_INT64 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5pt_writedata_i4 F77_NAME ( \
|
||||
h5pt_writedata_i4, \
|
||||
h5pt_writedata_i4_, \
|
||||
H5PT_WRITEDATA_I4 )
|
||||
h5_int64_t
|
||||
h5pt_writedata_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
const h5_int32_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_write_data (
|
||||
f, name2, (void*)data, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
|
||||
/*==================Reading data ============*/
|
||||
#define h5pt_readdata_r8 F77_NAME ( \
|
||||
h5pt_readdata_r8, \
|
||||
h5pt_readdata_r8_, \
|
||||
H5PT_READDATA_R8 )
|
||||
h5_int64_t
|
||||
h5pt_readdata_r8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_float64_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_read_data (
|
||||
f, name2, data, H5T_NATIVE_DOUBLE );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5pt_readdata_r4 F77_NAME ( \
|
||||
h5pt_readdata_r4, \
|
||||
h5pt_readdata_r4_, \
|
||||
H5PT_READDATA_R4 )
|
||||
h5_int64_t
|
||||
h5pt_readdata_r4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_float32_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_read_data (
|
||||
f, name2, data, H5T_NATIVE_FLOAT );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5pt_readdata_i8 F77_NAME ( \
|
||||
h5pt_readdata_i8, \
|
||||
h5pt_readdata_i8_, \
|
||||
H5PT_READDATA_I8 )
|
||||
h5_int64_t
|
||||
h5pt_readdata_i8 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_int64_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_read_data (
|
||||
f, name2, data, H5T_NATIVE_INT64 );
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#define h5pt_readdata_i4 F77_NAME ( \
|
||||
h5pt_readdata_i4, \
|
||||
h5pt_readdata_i4_, \
|
||||
H5PT_READDATA_I4 )
|
||||
h5_int64_t
|
||||
h5pt_readdata_i4 (
|
||||
const h5_int64_t* const fh,
|
||||
const char* const name,
|
||||
h5_int32_t* const data,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c (fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"hf=%p, name='%s', data=%p, l_name=%d",
|
||||
(h5_file_p)f, name, data, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5u_read_data (
|
||||
f, name2, data, H5T_NATIVE_INT32 );
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
!!!!!!!! Reading and Writing Datasets !!!!!!!!
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartWriteDataFloat64
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_writedata_r8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(IN) :: data(*) !< the array of float64 data to write
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartWriteDataFloat32
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_writedata_r4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL, INTENT(IN) :: data(*) !< the array of float32 data to write
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartWriteDataInt64
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_writedata_i8 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(IN) :: data(*) !< the array of int64 data to write
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartWriteDataInt32
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_writedata_i4 ( filehandle, name, data )
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER, INTENT(IN) :: data(*) !< the array of int32 data to write
|
||||
END FUNCTION
|
||||
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartReadDataFloat64
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_readdata_r8 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL*8, INTENT(OUT) :: data(*) !< array to read float64 data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartReadDataFloat32
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_readdata_r4 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
REAL, INTENT(OUT) :: data(*) !< array to read float32 data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartReadDataInt64
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_readdata_i8 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER*8, INTENT(OUT) :: data(*) !< array to read int64 data into
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5part_data_f
|
||||
!! See \ref H5PartReadDataInt32
|
||||
!! \return 0 on success or error code
|
||||
INTEGER*8 FUNCTION h5pt_readdata_i4 (filehandle,name,data)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset
|
||||
INTEGER, INTENT(OUT) :: data(*) !< array to read int32 data into
|
||||
END FUNCTION
|
||||
|
||||
+95
-91
@@ -13,50 +13,50 @@
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
|
||||
#define h5_openr F77NAME ( \
|
||||
h5_openr_, \
|
||||
H5_OPENR )
|
||||
#define h5_openw F77NAME ( \
|
||||
h5_openw_, \
|
||||
H5_OPENW )
|
||||
#define h5_opena F77NAME ( \
|
||||
h5_opena_, \
|
||||
H5_OPENA )
|
||||
#define h5_openr_par F77NAME ( \
|
||||
h5_openr_par_, \
|
||||
H5_OPENR_PAR )
|
||||
#define h5_openw_par F77NAME ( \
|
||||
h5_openw_par_, \
|
||||
H5_OPENW_PAR )
|
||||
#define h5_opena_par F77NAME ( \
|
||||
h5_opena_par_, \
|
||||
H5_OPENA_PAR )
|
||||
#define h5_close F77NAME ( \
|
||||
h5_close_, \
|
||||
H5_CLOSE)
|
||||
#define h5_check F77NAME ( \
|
||||
h5_check_, \
|
||||
H5_CHECK)
|
||||
#define h5_setstep F77NAME ( \
|
||||
h5_setstep_, \
|
||||
H5_SETSTEP )
|
||||
#define h5_getnsteps F77NAME ( \
|
||||
h5_getnsteps_, \
|
||||
H5_GETNSTEPS )
|
||||
#define h5_set_verbosity_level F77NAME ( \
|
||||
h5_set_verbosity_level_, \
|
||||
H5_SET_VERBOSITY_LEVEL )
|
||||
#define h5_openr F77NAME ( \
|
||||
h5_openr_, \
|
||||
H5_OPENR )
|
||||
#define h5_openw F77NAME ( \
|
||||
h5_openw_, \
|
||||
H5_OPENW )
|
||||
#define h5_opena F77NAME ( \
|
||||
h5_opena_, \
|
||||
H5_OPENA )
|
||||
#define h5_openr_par_align F77NAME ( \
|
||||
h5_openr_par_align_, \
|
||||
H5_OPENR_PAR_ALIGN )
|
||||
#define h5_openw_par_align F77NAME ( \
|
||||
h5_openw_par_align_, \
|
||||
H5_OPENW_PAR_ALIGN )
|
||||
#define h5_opena_par_align F77NAME ( \
|
||||
h5_opena_par_align_, \
|
||||
H5_OPENA_PA_ALIGNR )
|
||||
#define h5_close F77NAME ( \
|
||||
h5_close_, \
|
||||
H5_CLOSE)
|
||||
#define h5_check F77NAME ( \
|
||||
h5_check_, \
|
||||
H5_CHECK)
|
||||
#define h5_setstep F77NAME ( \
|
||||
h5_setstep_, \
|
||||
H5_SETSTEP )
|
||||
#define h5_getnsteps F77NAME ( \
|
||||
h5_getnsteps_, \
|
||||
H5_GETNSTEPS )
|
||||
#define h5_set_verbosity_level F77NAME ( \
|
||||
h5_set_verbosity_level_, \
|
||||
H5_SET_VERBOSITY_LEVEL )
|
||||
|
||||
#endif
|
||||
|
||||
/* open/close interface */
|
||||
h5_err_t
|
||||
h5_openr (
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "name='%s', l_name=%d", name, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
@@ -67,9 +67,9 @@ h5_openr (
|
||||
|
||||
h5_err_t
|
||||
h5_openw (
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "name='%s', l_name=%d", name, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
@@ -79,10 +79,10 @@ h5_openw (
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_opena (
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
h5_opena (
|
||||
const char *name,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "name='%s', l_name=%d", name, l_name);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
@@ -93,78 +93,82 @@ h5pt_opena (
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
h5_err_t
|
||||
h5_openr_par (
|
||||
const char *name,
|
||||
MPI_Fint *fcomm,
|
||||
const char *flags,
|
||||
const int l_name,
|
||||
const int l_flags
|
||||
) {
|
||||
h5_openr_par_align (
|
||||
const char *name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "name='%s', fcomm=%d, flags=%s, "
|
||||
"l_name=%d, l_flags=%d",
|
||||
name, *fcomm, flags, l_name, l_flags);
|
||||
H5_API_ENTER (h5_err_t, "name='%s', fcomm=%d, align=%lld, flags=%s, "
|
||||
"l_name=%d, l_flags=%d",
|
||||
name, *fcomm, (long long)*align,
|
||||
flags, l_name, l_flags);
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
char *flags2 = h5_strdupfor2c ( flags, l_flags );
|
||||
h5_int32_t fbits = H5_O_RDONLY | _flagsfor2c ( flags2 );
|
||||
h5_file_t* f = h5_open_file ( name2, fbits, ccomm );
|
||||
h5_file_t* f = h5_open_file ( name2, fbits, ccomm, 0 );
|
||||
free ( name2 );
|
||||
free ( flags2 );
|
||||
H5_API_RETURN((h5_int64_t)(size_t)f);
|
||||
H5_API_RETURN((h5_int64_t)(size_t)f);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5_openw_par (
|
||||
const char *name,
|
||||
MPI_Fint *fcomm,
|
||||
const char *flags,
|
||||
const int l_name,
|
||||
const int l_flags
|
||||
) {
|
||||
h5_openw_par_align (
|
||||
const char *name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "name='%s', fcomm=%d, flags=%s, "
|
||||
"l_name=%d, l_flags=%d",
|
||||
name, *fcomm, flags, l_name, l_flags);
|
||||
H5_API_ENTER (h5_err_t, "name='%s', fcomm=%d, align=%lld, flags=%s, "
|
||||
"l_name=%d, l_flags=%d",
|
||||
name, *fcomm, (long long)*align,
|
||||
flags, l_name, l_flags);
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
char *flags2 = h5_strdupfor2c ( flags, l_flags );
|
||||
h5_int32_t fbits = H5_O_WRONLY | _flagsfor2c ( flags2 );
|
||||
h5_file_t* f = h5_open_file ( name2, fbits, ccomm );
|
||||
h5_file_t* f = h5_open_file ( name2, fbits, ccomm, 0 );
|
||||
free ( name2 );
|
||||
free ( flags2 );
|
||||
H5_API_RETURN((h5_int64_t)(size_t)f);
|
||||
H5_API_RETURN((h5_int64_t)(size_t)f);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5pt_opena_par_align (
|
||||
const char *name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_name,
|
||||
const int l_flags
|
||||
) {
|
||||
h5_opena_par_align (
|
||||
const char *name,
|
||||
MPI_Fint *fcomm,
|
||||
const h5_int64_t *align,
|
||||
const char *flags,
|
||||
const int l_name,
|
||||
const int l_flags
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "name='%s', fcomm=%d, align=%lld, flags=%s, "
|
||||
"l_name=%d, l_flags=%d",
|
||||
name, *fcomm, (long long)*align,
|
||||
flags, l_name, l_flags);
|
||||
"l_name=%d, l_flags=%d",
|
||||
name, *fcomm, (long long)*align,
|
||||
flags, l_name, l_flags);
|
||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
char *flags2 = h5_strdupfor2c ( flags, l_flags );
|
||||
h5_int32_t fbits = H5_O_APPEND | _flagsfor2c ( flags2 );
|
||||
h5_file_t* f = h5_open_file ( name2, fbits, ccomm );
|
||||
h5_file_t* f = h5_open_file ( name2, fbits, ccomm, *align );
|
||||
free ( name2 );
|
||||
free ( flags2 );
|
||||
H5_API_RETURN((h5_int64_t)(size_t)f);
|
||||
H5_API_RETURN((h5_int64_t)(size_t)f);
|
||||
}
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_close (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p", fh);
|
||||
@@ -173,8 +177,8 @@ h5_close (
|
||||
|
||||
h5_err_t
|
||||
h5_check (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p", fh);
|
||||
@@ -183,8 +187,8 @@ h5_check (
|
||||
|
||||
h5_err_t
|
||||
h5_setstep (
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *step ) {
|
||||
const h5_int64_t *f,
|
||||
h5_int64_t *step ) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_err_t, "f=%p, step=%lld", fh, (long long)*step);
|
||||
@@ -193,8 +197,8 @@ h5_setstep (
|
||||
|
||||
h5_ssize_t
|
||||
h5_getnsteps (
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
const h5_int64_t *f
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", fh);
|
||||
@@ -203,8 +207,8 @@ h5_getnsteps (
|
||||
|
||||
h5_err_t
|
||||
h5_set_verbosity_level (
|
||||
const h5_int64_t *level
|
||||
) {
|
||||
const h5_int64_t *level
|
||||
) {
|
||||
|
||||
H5_API_ENTER (h5_err_t, "level=%lld", (long long)*level);
|
||||
H5_API_RETURN(h5_set_debuglevel ( *level ));
|
||||
|
||||
@@ -0,0 +1,651 @@
|
||||
/*
|
||||
Copyright (c) 2006-2012, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include "h5_private.h"
|
||||
#include "h5core/h5_attribs.h"
|
||||
|
||||
/*
|
||||
__ _ _ _ _ _ _ _
|
||||
/ _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
| |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
| _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
|_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
__ _ _ _ ___ _ __ _ _
|
||||
/ _` | | | |/ _ \ '__| | | |
|
||||
| (_| | |_| | __/ | | |_| |
|
||||
\__, |\__,_|\___|_| \__, |
|
||||
|_| |___/
|
||||
*/
|
||||
|
||||
#define h5_getnfileattribs F77_NAME( \
|
||||
h5_getnfileattribs, \
|
||||
h5_getnfileattribs_, \
|
||||
H5_GETNFILEATTRIBS)
|
||||
h5_int64_t
|
||||
h5_getnfileattribs (
|
||||
const h5_int64_t* const fh
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t, "fh=%p", (h5_file_p)f);
|
||||
H5_API_RETURN (h5_get_num_attribs (f, H5_ATTRIB_FILE));
|
||||
}
|
||||
|
||||
#define h5_getfileattribinfo F77_NAME( \
|
||||
h5_getfileattribinfo, \
|
||||
h5_getfileattribinfo_, \
|
||||
H5_GETFILEATTRIBINFO)
|
||||
h5_int64_t
|
||||
h5_getfileattribinfo (
|
||||
const h5_int64_t* const fh,
|
||||
const h5_int64_t* attrib_idx,
|
||||
char* attrib_name,
|
||||
h5_int64_t* attrib_type,
|
||||
h5_int64_t* attrib_nelem,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, "
|
||||
"attrib_idx=%lld, "
|
||||
"attrib_name=%p, "
|
||||
"attrib_type=%p, "
|
||||
"attrib_nelem=%p",
|
||||
(h5_file_p)fh,
|
||||
(long long)*attrib_idx,
|
||||
attrib_name, attrib_type, attrib_nelem);
|
||||
h5_int64_t h5err = h5_get_attrib_info (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
*attrib_idx - 1,
|
||||
attrib_name, l_attrib_name,
|
||||
attrib_type,
|
||||
(h5_size_t*)attrib_nelem);
|
||||
h5_strc2for (attrib_name, l_attrib_name);
|
||||
convert_type2for (attrib_type);
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
/*
|
||||
_ __
|
||||
(_) / /__
|
||||
| | / / _ \
|
||||
| |/ / (_) |
|
||||
|_/_/ \___/
|
||||
*/
|
||||
static inline h5_int64_t
|
||||
write_file_attrib (
|
||||
h5_file_t* const f,
|
||||
const char* name,
|
||||
const int l_name,
|
||||
const hid_t type,
|
||||
const void* buffer,
|
||||
const hsize_t l_buffer
|
||||
) {
|
||||
char *name2 = h5_strdupfor2c (name, l_name);
|
||||
h5_int64_t herr = h5_write_attrib (f, H5_ATTRIB_FILE, name2, type, buffer, l_buffer );
|
||||
free (name2);
|
||||
return herr;
|
||||
}
|
||||
|
||||
static inline h5_int64_t
|
||||
read_file_attrib (
|
||||
h5_file_t* const f,
|
||||
const char* name,
|
||||
const int l_name,
|
||||
const hid_t type,
|
||||
void* const buffer
|
||||
) {
|
||||
char* name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5_read_attrib (f, H5_ATTRIB_FILE, name2, type, buffer);
|
||||
free (name2);
|
||||
return herr;
|
||||
}
|
||||
|
||||
/*
|
||||
_ _
|
||||
___| |_ _ __(_)_ __ __ _
|
||||
/ __| __| '__| | '_ \ / _` |
|
||||
\__ \ |_| | | | | | | (_| |
|
||||
|___/\__|_| |_|_| |_|\__, |
|
||||
|___/
|
||||
*/
|
||||
#define h5_writefileattrib_string F77_NAME ( \
|
||||
h5_writefileattrib_string, \
|
||||
h5_writefileattrib_string_, \
|
||||
H5_WRITEFILEATTRIB_STRING)
|
||||
h5_int64_t
|
||||
h5_writefileattrib_string (
|
||||
h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer='%.*s'",
|
||||
(h5_file_p)f, l_name, name, l_buffer, buffer);
|
||||
char *buffer2 = h5_strdupfor2c (buffer, l_buffer);
|
||||
h5_int64_t herr = write_file_attrib (
|
||||
f, name, l_name, H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
free (buffer2);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5_readfileattrib_string F77_NAME ( \
|
||||
h5_readfileattrib_string, \
|
||||
h5_readfileattrib_string_, \
|
||||
H5_READFILEATTRIB_STRING)
|
||||
h5_int64_t
|
||||
h5_readfileattrib_string (
|
||||
h5_int64_t *const fh,
|
||||
const char *name,
|
||||
char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer='%.*s'",
|
||||
(h5_file_p)f, l_name, name, l_buffer, buffer);
|
||||
h5_int64_t herr = read_file_attrib (f, name, l_name, H5_STRING_T, buffer);
|
||||
h5_strc2for (buffer, l_buffer);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5_writefileattrib_r8 F77_NAME ( \
|
||||
h5_writefileattrib_r8, \
|
||||
h5_writefileattrib_r8_, \
|
||||
H5_WRITEFILEATTRIB_R8)
|
||||
h5_int64_t
|
||||
h5_writefileattrib_r8 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT64_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readfileattrib_r8 F77_NAME ( \
|
||||
h5_readfileattrib_r8, \
|
||||
h5_readfileattrib_r8_, \
|
||||
H5_READFILEATTRIB_R8 )
|
||||
h5_int64_t
|
||||
h5_readfileattrib_r8 (
|
||||
h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_int64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"(h5_file_p)fh=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
#define h5_writefileattrib_r4 F77_NAME ( \
|
||||
h5_writefileattrib_r4, \
|
||||
h5_writefileattrib_r4_, \
|
||||
H5_WRITEFILEATTRIB_R4 )
|
||||
h5_int64_t
|
||||
h5_writefileattrib_r4 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT32_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readfileattrib_r4 F77_NAME ( \
|
||||
h5_readfileattrib_r4, \
|
||||
h5_readfileattrib_r4_, \
|
||||
H5_READFILEATTRIB_R4 )
|
||||
h5_int64_t
|
||||
h5_readfileattrib_r4 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_int32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT32_T,
|
||||
buffer));
|
||||
}
|
||||
|
||||
#define h5_writefileattrib_i8 F77_NAME ( \
|
||||
h5_writefileattrib_i8, \
|
||||
h5_writefileattrib_i8_, \
|
||||
H5_WRITEFILEATTRIB_I8)
|
||||
h5_int64_t
|
||||
h5_writefileattrib_i8 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT64_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readfileattrib_i8 F77_NAME ( \
|
||||
h5_readfileattrib_i8, \
|
||||
h5_readfileattrib_i8_, \
|
||||
H5_READFILEATTRIB_I8 )
|
||||
h5_int64_t
|
||||
h5_readfileattrib_i8 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_int64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT64_T,
|
||||
buffer));
|
||||
}
|
||||
|
||||
#define h5_writefileattrib_i4 F77_NAME ( \
|
||||
h5_writefileattrib_i4, \
|
||||
h5_writefileattrib_i4_, \
|
||||
H5_WRITEFILEATTRIB_I4 )
|
||||
h5_int64_t
|
||||
h5_writefileattrib_i4 (
|
||||
h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT32_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readfileattrib_i4 F77_NAME ( \
|
||||
h5_readfileattrib_i4, \
|
||||
h5_readfileattrib_i4_, \
|
||||
H5_READFILEATTRIB_I4 )
|
||||
h5_int64_t
|
||||
h5_readfileattrib_i4 (
|
||||
h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_int32_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_file_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT32_T,
|
||||
buffer));
|
||||
}
|
||||
|
||||
/*
|
||||
_ _ _ _ _ _
|
||||
___| |_ ___ _ __ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
/ __| __/ _ \ '_ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
\__ \ || __/ |_) | | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
|___/\__\___| .__/ \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
|_|
|
||||
*/
|
||||
#define h5_getnstepattribs F77_NAME( \
|
||||
h5_getnstepattribs, \
|
||||
h5_getnstepattribs_, \
|
||||
H5_GETNSTEPATTRIBS)
|
||||
h5_int64_t
|
||||
h5_getnstepattribs (
|
||||
const h5_int64_t* fh
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"fh=%p",
|
||||
(h5_file_p)f);
|
||||
H5_API_RETURN (h5_get_num_attribs (f, H5_ATTRIB_STEP));
|
||||
}
|
||||
|
||||
#define h5_getstepattribinfo F77_NAME( \
|
||||
h5_getstepattribinfo, \
|
||||
h5_getstepattribinfo_, \
|
||||
H5_GETSTEPATTRIBINFO)
|
||||
h5_int64_t
|
||||
h5_getstepattribinfo (
|
||||
const h5_int64_t* fh,
|
||||
const h5_int64_t* attrib_idx,
|
||||
char* attrib_name,
|
||||
h5_int64_t* attrib_type,
|
||||
h5_int64_t* attrib_nelem,
|
||||
const int l_attrib_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, "
|
||||
"attrib_idx=%lld, "
|
||||
"attrib_name=%p, "
|
||||
"attrib_type=%p, "
|
||||
"attrib_nelem=%p",
|
||||
(h5_file_p)f,
|
||||
(long long)*attrib_idx,
|
||||
attrib_name, attrib_type, attrib_nelem);
|
||||
h5_int64_t h5err = h5_get_attrib_info (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
*attrib_idx - 1,
|
||||
attrib_name, l_attrib_name,
|
||||
attrib_type,
|
||||
(h5_size_t*)attrib_nelem);
|
||||
h5_strc2for (attrib_name, l_attrib_name);
|
||||
convert_type2for (attrib_type);
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
static inline h5_int64_t
|
||||
write_step_attrib (
|
||||
h5_file_t* const fh,
|
||||
const char* name,
|
||||
const int l_name,
|
||||
const hid_t type,
|
||||
const void* buffer,
|
||||
const hsize_t l_buffer
|
||||
) {
|
||||
char *name2 = h5_strdupfor2c (name, l_name);
|
||||
h5_int64_t herr = h5_write_attrib (fh, H5_ATTRIB_STEP, name2, type, buffer, l_buffer );
|
||||
free (name2);
|
||||
return herr;
|
||||
}
|
||||
|
||||
static inline h5_int64_t
|
||||
read_step_attrib (
|
||||
h5_file_t* const fh,
|
||||
const char* name,
|
||||
const int l_name,
|
||||
const hid_t type,
|
||||
void* const buffer
|
||||
) {
|
||||
char* name2 = h5_strdupfor2c ( name, l_name );
|
||||
h5_int64_t herr = h5_read_attrib (fh, H5_ATTRIB_STEP, name2, type, buffer);
|
||||
free (name2);
|
||||
return herr;
|
||||
}
|
||||
|
||||
#define h5_writestepattrib_string F77_NAME ( \
|
||||
h5_writestepattrib_string, \
|
||||
h5_writestepattrib_string_, \
|
||||
H5_WRITESTEPATTRIB_STRING)
|
||||
h5_int64_t
|
||||
h5_writestepattrib_string (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer='%.*s'",
|
||||
(h5_file_p)f, l_name, name, l_buffer, buffer);
|
||||
char *buffer2 = h5_strdupfor2c (buffer, l_buffer);
|
||||
h5_int64_t herr = write_step_attrib (
|
||||
f, name, l_name, H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
free (buffer2);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5_readstepattrib_string F77_NAME ( \
|
||||
h5_readstepattrib_string, \
|
||||
h5_readstepattrib_string_, \
|
||||
H5_READSTEPATTRIB_STRING)
|
||||
h5_int64_t
|
||||
h5_readstepattrib_string (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer='%.*s'",
|
||||
(h5_file_p)f, l_name, name, l_buffer, buffer);
|
||||
h5_int64_t herr = read_step_attrib (f, name, l_name, H5_STRING_T, buffer);
|
||||
h5_strc2for (buffer, l_buffer);
|
||||
H5_API_RETURN (herr);
|
||||
}
|
||||
|
||||
#define h5_writestepattrib_r8 F77_NAME ( \
|
||||
h5_writestepattrib_r8, \
|
||||
h5_writestepattrib_r8_, \
|
||||
H5_WRITESTEPATTRIB_R8)
|
||||
h5_int64_t
|
||||
h5_writestepattrib_r8 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT64_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readstepattrib_r8 F77_NAME ( \
|
||||
h5_readstepattrib_r8, \
|
||||
h5_readstepattrib_r8_, \
|
||||
H5_READSTEPATTRIB_R8 )
|
||||
h5_int64_t
|
||||
h5_readstepattrib_r8 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
#define h5_writestepattrib_r4 F77_NAME ( \
|
||||
h5_writestepattrib_r4, \
|
||||
h5_writestepattrib_r4_, \
|
||||
H5_WRITESTEPATTRIB_R4 )
|
||||
h5_int64_t
|
||||
h5_writestepattrib_r4 (
|
||||
h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT32_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readstepattrib_r4 F77_NAME ( \
|
||||
h5_readstepattrib_r4, \
|
||||
h5_readstepattrib_r4_, \
|
||||
H5_READSTEPATTRIB_R4 )
|
||||
h5_int64_t
|
||||
h5_readstepattrib_r4 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_FLOAT32_T,
|
||||
buffer));
|
||||
}
|
||||
|
||||
#define h5_writestepattrib_i8 F77_NAME ( \
|
||||
h5_writestepattrib_i8, \
|
||||
h5_writestepattrib_i8_, \
|
||||
H5_WRITESTEPATTRIB_I8)
|
||||
h5_int64_t
|
||||
h5_writestepattrib_i8 (
|
||||
h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT64_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readstepattrib_i8 F77_NAME ( \
|
||||
h5_readstepattrib_i8, \
|
||||
h5_readstepattrib_i8_, \
|
||||
H5_READSTEPATTRIB_I8 )
|
||||
h5_int64_t
|
||||
h5_readstepattrib_i8 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT64_T,
|
||||
buffer));
|
||||
}
|
||||
|
||||
#define h5_writestepattrib_i4 F77_NAME ( \
|
||||
h5_writestepattrib_i4, \
|
||||
h5_writestepattrib_i4_, \
|
||||
H5_WRITESTEPATTRIB_I4 )
|
||||
h5_int64_t
|
||||
h5_writestepattrib_i4 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p, nelem=%lld",
|
||||
(h5_file_p)f, l_name, name, buffer, (long long)*nelem);
|
||||
H5_API_RETURN (write_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT32_T,
|
||||
buffer, (hsize_t)*nelem));
|
||||
}
|
||||
|
||||
#define h5_readstepattrib_i4 F77_NAME ( \
|
||||
h5_readstepattrib_i4, \
|
||||
h5_readstepattrib_i4_, \
|
||||
H5_READSTEPATTRIB_I4 )
|
||||
h5_int64_t
|
||||
h5_readstepattrib_i4 (
|
||||
const h5_int64_t *const fh,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_file_t* f = h5_filehandlefor2c(fh);
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, name='%.*s', buffer=%p",
|
||||
(h5_file_p)f, l_name, name, buffer);
|
||||
H5_API_RETURN (read_step_attrib(
|
||||
f,
|
||||
name, l_name,
|
||||
H5_INT32_T,
|
||||
buffer));
|
||||
}
|
||||
@@ -0,0 +1,366 @@
|
||||
! __ _ _ _ _ _ _ _
|
||||
! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! __ _ _ _ ___ _ __ _ _
|
||||
! / _` | | | |/ _ \ '__| | | |
|
||||
! | (_| | |_| | __/ | | |_| |
|
||||
! \__, |\__,_|\___|_| \__, |
|
||||
! |_| |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5GetNumFileAttribs
|
||||
!! \return number of attributes or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_getnfileattribs (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5GetFileAttribInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_getfileattribinfo (filehandle, idx, attrib_name, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
INTEGER*8,INTENT(IN) :: idx !< index of attribute being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT):: attrib_name !< name of attribute
|
||||
INTEGER*8,INTENT(OUT):: attrib_type !< type of attribute
|
||||
INTEGER*8,INTENT(OUT):: attrib_nelem !< number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
! __ _ _ _ _ _ _ _
|
||||
! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! _ __ _ _
|
||||
! (_) / /__ ___| |_ _ __(_)_ __ __ _
|
||||
! | | / / _ \ / __| __| '__| | '_ \ / _` |
|
||||
! | |/ / (_) | \__ \ |_| | | | | | | (_| |
|
||||
! |_/_/ \___/ |___/\__|_| |_|_| |_|\__, |
|
||||
! |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteFileAttribString
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writefileattrib_string (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data to be written
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readfileattrib_string (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of the attribute to read
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! __ _ _ _ _ _ _ _
|
||||
! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! _ __ _
|
||||
! (_) / /__ _ __ ___ __ _| |
|
||||
! | | / / _ \ | '__/ _ \/ _` | |
|
||||
! | |/ / (_) | | | | __/ (_| | |
|
||||
! |_/_/ \___/ |_| \___|\__,_|_|
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteFileAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writefileattrib_r8 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadFileAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readfileattrib_r8 (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteFileAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writefileattrib_r4 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*4, INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadFileAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readfileattrib_r4 ( filehandle, attrib_name, attrib_value )
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*4, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! __ _ _ _ _ _ _ _
|
||||
! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! _ __ _ _
|
||||
! (_) / /__ (_)_ __ | |_ ___ __ _ ___ _ __
|
||||
! | | / / _ \ | | '_ \| __/ _ \/ _` |/ _ \ '__|
|
||||
! | |/ / (_) | | | | | | || __/ (_| | __/ |
|
||||
! |_/_/ \___/ |_|_| |_|\__\___|\__, |\___|_|
|
||||
! |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteFileAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writefileattrib_i8 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadFileAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readfileattrib_i8 (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteFileAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writefileattrib_i4 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
INTEGER*8,INTENT(OUT):: attrib_type !< type of attribute
|
||||
INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadFileAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readfileattrib_i4 (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! _ _ _ _ _ _
|
||||
! ___| |_ ___ _ __ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! / __| __/ _ \ '_ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! \__ \ || __/ |_) | | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |___/\__\___| .__/ \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! |_|
|
||||
! __ _ _ _ ___ _ __ _ _
|
||||
! / _` | | | |/ _ \ '__| | | |
|
||||
! | (_| | |_| | __/ | | |_| |
|
||||
! \__, |\__,_|\___|_| \__, |
|
||||
! |_| |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5GetNumFileAttribs
|
||||
!! \return number of attributes or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_getnstepattribs (filehandle)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5GetFileAttribInfo
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_getstepattribinfo (filehandle, idx, attrib_name, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
INTEGER*8,INTENT(IN) :: idx !< index of attribute being queried
|
||||
CHARACTER(LEN=*), INTENT(OUT):: attrib_name !< name of attribute
|
||||
INTEGER*8,INTENT(OUT):: attrib_nelem !< number of elements in the attrib array
|
||||
END FUNCTION
|
||||
|
||||
! _ _ _ _ _ _
|
||||
! ___| |_ ___ _ __ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! / __| __/ _ \ '_ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! \__ \ || __/ |_) | | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |___/\__\___| .__/ \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! |_|
|
||||
! _ __ _ _
|
||||
! (_) / /__ ___| |_ _ __(_)_ __ __ _
|
||||
! | | / / _ \ / __| __| '__| | '_ \ / _` |
|
||||
! | |/ / (_) | \__ \ |_| | | | | | | (_| |
|
||||
! |_/_/ \___/ |___/\__|_| |_|_| |_|\__, |
|
||||
! |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteStepAttribString
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writestepattrib_string (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data to be written
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadStepAttribString
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readstepattrib_string (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8, INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of the attribute to read
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! _ _ _ _ _ _
|
||||
! ___| |_ ___ _ __ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! / __| __/ _ \ '_ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! \__ \ || __/ |_) | | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |___/\__\___| .__/ \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! |_|
|
||||
! _ __ _
|
||||
! (_) / /__ _ __ ___ __ _| |
|
||||
! | | / / _ \ | '__/ _ \/ _` | |
|
||||
! | |/ / (_) | | | | __/ (_| | |
|
||||
! |_/_/ \___/ |_| \___|\__,_|_|
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteStepAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writestepattrib_r8 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadStepAttribFloat64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readstepattrib_r8 (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteStepAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writestepattrib_r4 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*4, INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadStepAttribFloat32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readstepattrib_r4 ( filehandle, attrib_name, attrib_value )
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
REAL*4, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
! _ _ _ _ _ _
|
||||
! ___| |_ ___ _ __ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___
|
||||
! / __| __/ _ \ '_ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __|
|
||||
! \__ \ || __/ |_) | | (_| | |_| |_| | | | |_) | |_| | || __/\__ \
|
||||
! |___/\__\___| .__/ \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/
|
||||
! |_|
|
||||
! _ __ _ _
|
||||
! (_) / /__ (_)_ __ | |_ ___ __ _ ___ _ __
|
||||
! | | / / _ \ | | '_ \| __/ _ \/ _` |/ _ \ '__|
|
||||
! | |/ / (_) | | | | | | || __/ (_| | __/ |
|
||||
! |_/_/ \___/ |_|_| |_|\__\___|\__, |\___|_|
|
||||
! |___/
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteStepAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writestepattrib_i8 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadStepAttribInt64
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readstepattrib_i8 (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5WriteStepAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_writestepattrib_i4 (filehandle, attrib_name, attrib_value, attrib_nelem)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write
|
||||
INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data to be written
|
||||
INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array
|
||||
END FUNCTION
|
||||
|
||||
!>
|
||||
!! \ingroup h5hut_attrib_f
|
||||
!! See \ref H5ReadStepAttribInt32
|
||||
!! \return 0 on success or error code
|
||||
!<
|
||||
INTEGER*8 FUNCTION h5_readstepattrib_i4 (filehandle, attrib_name, attrib_value)
|
||||
INTEGER*8,INTENT(IN) :: filehandle !< file handle
|
||||
CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read
|
||||
INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array
|
||||
END FUNCTION
|
||||
+242
-251
@@ -14,34 +14,33 @@
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
|
||||
#define h5_writefileattrib_string F77NAME ( h5_writefileattrib_string_, H5_writefileattrib_string )
|
||||
#define h5_writestepattrib_string F77NAME ( h5_writestepattrib_string_, H5_WRITESTEPATTRIB_STRING )
|
||||
#define h5_readstepattrib_string F77NAME ( h5_readstepattrib_string_, h5_READSTEPATTRIB_STRING )
|
||||
#define h5_readfileattrib_string F77NAME ( h5_readfileattrib_string_, h5_READFILEATTRIB_STRING )
|
||||
#define h5_writefileattrib_string F77NAME ( h5_writefileattrib_string_, H5_writefileattrib_string )
|
||||
#define h5_writestepattrib_string F77NAME ( h5_writestepattrib_string_, H5_WRITESTEPATTRIB_STRING )
|
||||
#define h5_readstepattrib_string F77NAME ( h5_readstepattrib_string_, h5_READSTEPATTRIB_STRING )
|
||||
#define h5_readfileattrib_string F77NAME ( h5_readfileattrib_string_, h5_READFILEATTRIB_STRING )
|
||||
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writefileattrib_string (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
char *buffer2 = h5_strdupfor2c ( buffer, l_buffer );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer='%s', l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer2, l_name, l_buffer);
|
||||
"f=%p, name='%s', buffer='%s', l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer2, l_name, l_buffer);
|
||||
|
||||
h5_err_t herr = h5_write_attrib (
|
||||
fh, H5_ATTRIB_FILE, name2,
|
||||
H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
h5_err_t herr = h5_write_file_attrib (
|
||||
fh, name2, H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
|
||||
free ( name2 );
|
||||
free ( buffer2 );
|
||||
@@ -50,23 +49,22 @@ h5_writefileattrib_string (
|
||||
|
||||
h5_err_t
|
||||
h5_writestepattrib_string (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
char *buffer2 = h5_strdupfor2c ( buffer, l_buffer );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer='%s', l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer2, l_name, l_buffer);
|
||||
"f=%p, name='%s', buffer='%s', l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer2, l_name, l_buffer);
|
||||
|
||||
h5_err_t herr = h5_write_attrib (
|
||||
fh, H5_ATTRIB_STEP, name2,
|
||||
H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
h5_err_t herr = h5_write_step_attrib (
|
||||
fh, name2, H5_STRING_T, buffer2, strlen(buffer2)+1 );
|
||||
|
||||
free ( name2 );
|
||||
free ( buffer2 );
|
||||
@@ -75,21 +73,21 @@ h5_writestepattrib_string (
|
||||
|
||||
h5_err_t
|
||||
h5_readfileattrib_string (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char * name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer, l_name, l_buffer);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer, l_name, l_buffer);
|
||||
|
||||
h5_err_t herr = h5_read_attrib (
|
||||
fh, H5_ATTRIB_FILE, name2, H5_STRING_T, buffer );
|
||||
fh, fh->root_gid, name2, H5_STRING_T, buffer );
|
||||
|
||||
h5_strc2for ( buffer, l_buffer );
|
||||
|
||||
@@ -99,21 +97,21 @@ h5_readfileattrib_string (
|
||||
|
||||
h5_err_t
|
||||
h5_readstepeattrib_string (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
char *buffer,
|
||||
const int l_name,
|
||||
const int l_buffer
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char * name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer, l_name, l_buffer);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d, l_buffer=%d",
|
||||
fh, name2, buffer, l_name, l_buffer);
|
||||
|
||||
h5_err_t herr = h5_read_attrib (
|
||||
fh, H5_ATTRIB_STEP, name2, H5_STRING_T, buffer );
|
||||
h5_err_t herr = h5_read_step_attrib (
|
||||
fh, name2, H5_STRING_T, buffer );
|
||||
|
||||
h5_strc2for ( buffer, l_buffer );
|
||||
|
||||
@@ -121,449 +119,442 @@ h5_readstepeattrib_string (
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writefileattrib_r8 F77NAME ( \
|
||||
h5_writefileattrib_r8_, \
|
||||
H5_WRITEFILEATTRIB_R8 )
|
||||
h5_writefileattrib_r8_, \
|
||||
H5_WRITEFILEATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writefileattrib_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2,
|
||||
H5_FLOAT64_T, buffer, (hsize_t)*nelem);
|
||||
h5_err_t herr = h5_write_file_attrib(
|
||||
fh, name2, H5_FLOAT64_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readfileattrib_r8 F77NAME ( \
|
||||
h5_readfileattrib_r8_, \
|
||||
H5_READFILEATTRIB_R8 )
|
||||
h5_readfileattrib_r8_, \
|
||||
H5_READFILEATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfileattrib_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2, H5_FLOAT64_T, buffer);
|
||||
fh, fh->root_gid, name2, H5_FLOAT64_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writefileattrib_r4 F77NAME ( \
|
||||
h5_writefileattrib_r4_, \
|
||||
H5_WRITEFILEATTRIB_R4 )
|
||||
h5_writefileattrib_r4_, \
|
||||
H5_WRITEFILEATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writefileattrib_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2,
|
||||
h5_err_t herr = h5_write_file_attrib(
|
||||
fh, name2,
|
||||
H5_FLOAT32_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readfileattrib_r4 F77NAME ( \
|
||||
h5_readfileattrib_r4_, \
|
||||
H5_READFILEATTRIB_R4 )
|
||||
h5_readfileattrib_r4_, \
|
||||
H5_READFILEATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfileattrib_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2, H5_FLOAT32_T, buffer);
|
||||
fh, fh->root_gid, name2, H5_FLOAT32_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writefileattrib_i8 F77NAME ( \
|
||||
h5_writefileattrib_i8_, \
|
||||
H5_WRITEFILEATTRIB_I8 )
|
||||
h5_writefileattrib_i8_, \
|
||||
H5_WRITEFILEATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writefileattrib_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2,
|
||||
H5_INT64_T, buffer, (hsize_t)*nelem);
|
||||
h5_err_t herr = h5_write_file_attrib(
|
||||
fh, name2, H5_INT64_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readfileattrib_i8 F77NAME ( \
|
||||
h5_readfileattrib_i8_, \
|
||||
H5_READFILEATTRIB_I8 )
|
||||
h5_readfileattrib_i8_, \
|
||||
H5_READFILEATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfileattrib_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2, H5_INT64_T, buffer);
|
||||
fh, fh->root_gid, name2, H5_INT64_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writefileattrib_i4 F77NAME ( \
|
||||
h5_writefileattrib_i4_, \
|
||||
H5_WRITEFILEATTRIB_I4 )
|
||||
h5_writefileattrib_i4_, \
|
||||
H5_WRITEFILEATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writefileattrib_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2,
|
||||
H5_INT32_T, buffer, (hsize_t)*nelem);
|
||||
h5_err_t herr = h5_write_file_attrib(
|
||||
fh, name2, H5_INT32_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readfileattrib_i4 F77NAME ( \
|
||||
h5_readfileattrib_i4_, \
|
||||
H5_READFILEATTRIB_I4 )
|
||||
h5_readfileattrib_i4_, \
|
||||
H5_READFILEATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readfileattrib_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_FILE, name2, H5_INT32_T, buffer);
|
||||
fh, fh->root_gid, name2, H5_INT32_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writestepattrib_r8 F77NAME ( \
|
||||
h5_writestepattrib_r8_, \
|
||||
H5_WRITESTEPATTRIB_R8 )
|
||||
h5_writestepattrib_r8_, \
|
||||
H5_WRITESTEPATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writestepattrib_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2,
|
||||
H5_FLOAT64_T, buffer, (hsize_t)*nelem);
|
||||
h5_err_t herr = h5_write_step_attrib(
|
||||
fh, name2, H5_FLOAT64_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readstepattrib_r8 F77NAME ( \
|
||||
h5_readstepattrib_r8_, \
|
||||
H5_READSTEPATTRIB_R8 )
|
||||
h5_readstepattrib_r8_, \
|
||||
H5_READSTEPATTRIB_R8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readstepattrib_r8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2, H5_FLOAT64_T, buffer);
|
||||
h5_err_t herr = h5_read_step_attrib(
|
||||
fh, name2, H5_FLOAT64_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writestepattrib_r4 F77NAME ( \
|
||||
h5_writestepattrib_r4_, \
|
||||
H5_WRITESTEPATTRIB_R4 )
|
||||
h5_writestepattrib_r4_, \
|
||||
H5_WRITESTEPATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writestepattrib_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2,
|
||||
H5_FLOAT32_T, buffer, (hsize_t)*nelem);
|
||||
h5_err_t herr = h5_write_step_attrib(
|
||||
fh, name2, H5_FLOAT32_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readstepattrib_r4 F77NAME ( \
|
||||
h5_readstepattrib_r4_, \
|
||||
H5_READSTEPATTRIB_R4 )
|
||||
h5_readstepattrib_r4_, \
|
||||
H5_READSTEPATTRIB_R4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readstepattrib_r4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2, H5_FLOAT32_T, buffer);
|
||||
h5_err_t herr = h5_read_step_attrib(
|
||||
fh, name2, H5_FLOAT32_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writestepattrib_i8 F77NAME ( \
|
||||
h5_writestepattrib_i8_, \
|
||||
H5_WRITESTEPATTRIB_I8 )
|
||||
h5_writestepattrib_i8_, \
|
||||
H5_WRITESTEPATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writestepattrib_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2,
|
||||
H5_INT64_T, buffer, (hsize_t)*nelem);
|
||||
h5_err_t herr = h5_write_step_attrib(
|
||||
fh, name2, H5_INT64_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readstepattrib_i8 F77NAME ( \
|
||||
h5_readstepattrib_i8_, \
|
||||
H5_READSTEPATTRIB_I8 )
|
||||
h5_readstepattrib_i8_, \
|
||||
H5_READSTEPATTRIB_I8 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readstepattrib_i8 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2, H5_INT64_T, buffer);
|
||||
h5_err_t herr = h5_read_step_attrib(
|
||||
fh, name2, H5_INT64_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_writestepattrib_i4 F77NAME ( \
|
||||
h5_writestepattrib_i4_, \
|
||||
H5_WRITESTEPATTRIB_I4 )
|
||||
h5_writestepattrib_i4_, \
|
||||
H5_WRITESTEPATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5_writestepattrib_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_int64_t *nelem,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
"f=%p, name='%s', buffer=%p, nelem=%lld, l_name=%d",
|
||||
fh, name2, buffer, (long long)*nelem, l_name);
|
||||
|
||||
h5_err_t herr = h5_write_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2,
|
||||
H5_INT32_T, buffer, (hsize_t)*nelem);
|
||||
h5_err_t herr = h5_write_step_attrib(
|
||||
fh, name2, H5_INT32_T, buffer, (hsize_t)*nelem);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
}
|
||||
|
||||
#if ! defined(F77_NO_UNDERSCORE)
|
||||
#if !defined(F77_NO_UNDERSCORE)
|
||||
#define h5_readstepattrib_i4 F77NAME ( \
|
||||
h5_readstepattrib_i4_, \
|
||||
H5_READSTEPATTRIB_I4 )
|
||||
h5_readstepattrib_i4_, \
|
||||
H5_READSTEPATTRIB_I4 )
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5bl_readstepattrib_i4 (
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
h5_int64_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer,
|
||||
const int l_name
|
||||
) {
|
||||
|
||||
h5_file_t *fh = h5_filehandlefor2c(f);
|
||||
char *name2 = h5_strdupfor2c ( name, l_name );
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
"f=%p, name='%s', buffer=%p, l_name=%d",
|
||||
fh, name2, buffer, l_name);
|
||||
|
||||
h5_err_t herr = h5_read_attrib(
|
||||
fh, H5_ATTRIB_STEP, name2, H5_INT32_T, buffer);
|
||||
h5_err_t herr = h5_read_step_attrib(
|
||||
fh, name2, H5_INT32_T, buffer);
|
||||
|
||||
free ( name2 );
|
||||
H5_API_RETURN(herr);
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
|
||||
INTEGER*8 :: H5_STRING_T
|
||||
INTEGER*8 :: H5_INT16_T
|
||||
INTEGER*8 :: H5_INT32_T
|
||||
INTEGER*8 :: H5_INT64_t
|
||||
INTEGER*8 :: H5_FLOAT32_T
|
||||
INTEGER*8 :: H5_FLOAT64_T
|
||||
|
||||
PARAMETER (H5_STRING_T = 1)
|
||||
PARAMETER (H5_INT16_T = 2)
|
||||
PARAMETER (H5_INT32_T = 3)
|
||||
PARAMETER (H5_INT64_T = 4)
|
||||
PARAMETER (H5_FLOAT32_T = 5)
|
||||
PARAMETER (H5_FLOAT64_T = 6)
|
||||
|
||||
INTEGER*8 :: H5_MAX_NAME_LEN
|
||||
PARAMETER (H5_MAX_NAME_LEN = 64)
|
||||
|
||||
INTEGER*8 :: H5_SUCCESS
|
||||
INTEGER*8 :: H5_OK
|
||||
INTEGER*8 :: H5_NOK
|
||||
INTEGER*8 :: H5_FAILURE
|
||||
INTEGER*8 :: H5_ERR_BADF
|
||||
INTEGER*8 :: H5_ERR_NOMEM
|
||||
INTEGER*8 :: H5_ERR_INVAL
|
||||
INTEGER*8 :: H5_ERR_BADFD
|
||||
|
||||
INTEGER*8 :: H5_ERR_LAYOUT
|
||||
INTEGER*8 :: H5_ERR_NOENTRY
|
||||
|
||||
INTEGER*8 :: H5_ERR_MPI
|
||||
INTEGER*8 :: H5_ERR_HDF5
|
||||
INTEGER*8 :: H5_ERR_H5
|
||||
INTEGER*8 :: H5_ERR_H5PART
|
||||
INTEGER*8 :: H5_ERR_H5BLOCK
|
||||
INTEGER*8 :: H5_ERR_H5FED
|
||||
|
||||
INTEGER*8 :: H5_ERR_INTERNAL
|
||||
INTEGER*8 :: H5_ERR_NOT_IMPLEMENTED
|
||||
|
||||
PARAMETER (H5_SUCCESS = 0)
|
||||
PARAMETER (H5_OK = H5_SUCCESS)
|
||||
PARAMETER (H5_NOK = -1)
|
||||
PARAMETER (H5_FAILURE = -2)
|
||||
PARAMETER (H5_ERR_BADF = -9)
|
||||
PARAMETER (H5_ERR_NOMEM = -12)
|
||||
PARAMETER (H5_ERR_INVAL = -22)
|
||||
PARAMETER (H5_ERR_BADFD = -77)
|
||||
|
||||
PARAMETER (H5_ERR_LAYOUT = -100)
|
||||
PARAMETER (H5_ERR_NOENTRY = -101)
|
||||
|
||||
PARAMETER (H5_ERR_MPI = -201)
|
||||
PARAMETER (H5_ERR_HDF5 = -202)
|
||||
PARAMETER (H5_ERR_H5 = -203)
|
||||
PARAMETER (H5_ERR_H5PART = -204)
|
||||
PARAMETER (H5_ERR_H5BLOCK = -205)
|
||||
PARAMETER (H5_ERR_H5FED = -206)
|
||||
|
||||
PARAMETER (H5_ERR_INTERNAL = -253)
|
||||
PARAMETER (H5_ERR_NOT_IMPLEMENTED = -254)
|
||||
+42
-28
@@ -1,46 +1,60 @@
|
||||
# src/Fortran level Makefile.am
|
||||
|
||||
OBJEXT=o
|
||||
if ENABLE_FORTRAN
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/src/include
|
||||
|
||||
AM_CPPFLAGS = -I../include @AM_CPPFLAGS@
|
||||
F90_FILES = \
|
||||
H5F.f90 \
|
||||
H5_constF.f90 \
|
||||
H5_attribsF.f90 \
|
||||
H5PartF.f90 \
|
||||
H5Part_ioF.f90 \
|
||||
H5BlockF.f90 \
|
||||
H5Block_attribsF.f90 \
|
||||
H5Block_ioF.f90
|
||||
|
||||
F90_FILES = H5.f90 \
|
||||
H5_attribs.f90 \
|
||||
H5Part.f90 \
|
||||
H5Block.f90 \
|
||||
H5Block_readwrite.f90
|
||||
|
||||
EXTRA_HEADERS = ../include/H5hut.h
|
||||
EXTRA_HEADERS =
|
||||
|
||||
# Extra files that I wish to include in the dist tar ball.
|
||||
EXTRA_DIST = TestUnderscoreC.c \
|
||||
TestUnderscore.f \
|
||||
$(F90_FILES)
|
||||
EXTRA_DIST = \
|
||||
TestUnderscoreC.c \
|
||||
TestUnderscore.f \
|
||||
h5_private.h \
|
||||
$(F90_FILES)
|
||||
|
||||
# Files that I don't want to include in the dist tar ball
|
||||
#nodist_include_HEADERS = ../include/H5hutF.h @UNDERSCORE_H@
|
||||
nodist_include_HEADERS = ../include/H5hutF.h
|
||||
nodist_include_HEADERS = \
|
||||
$(top_srcdir)/src//include/H5hutF.h
|
||||
|
||||
# What to build... Will be determined by configure script.
|
||||
lib_LTLIBRARIES = @LIB_FORTRAN@
|
||||
lib_LTLIBRARIES = libH5hutF.la
|
||||
|
||||
# Listing of all possible targets that I may build.
|
||||
EXTRA_LTLIBRARIES = libH5hutF.la
|
||||
include_HEADERS = \
|
||||
$(top_srcdir)/src/include/H5hutF.h
|
||||
|
||||
libH5hutF_la_SOURCES = \
|
||||
H5_F.c \
|
||||
H5_attribs_F.c \
|
||||
H5Part_F.c \
|
||||
H5Block_F.c \
|
||||
H5Block_readwrite_F.c
|
||||
libH5hutF_la_SOURCES = \
|
||||
H5.c \
|
||||
H5_attribs.c \
|
||||
H5Part.c \
|
||||
H5Part_io.c \
|
||||
H5Block.c \
|
||||
H5Block_attribs.c \
|
||||
H5Block_io.c
|
||||
|
||||
libH5hutF_la_DEPENDENCIES = ../include/H5hutF.h
|
||||
libH5hutF_la_DEPENDENCIES = \
|
||||
$(top_srcdir)/src/include/H5hutF.h
|
||||
|
||||
libH5hutF_la_LDFLAGS = -version-info 2:0:0 -rpath '$(libdir)'
|
||||
|
||||
../include/H5hutF.h: $(F90_FILES)
|
||||
awk '/INTEGER\*8 FUNCTION/{print "\t" $$1 " " $$3}' $^ >$@
|
||||
$(top_srcdir)/src/include/H5hutF.h: $(F90_FILES)
|
||||
awk '/INTEGER\*8 :: /{print "\t" $$0}' $^ >$@
|
||||
awk '/PARAMETER /{print "\t" $$0}' $^ >> $@
|
||||
awk '/INTEGER\*8 FUNCTION/{print "\t" $$1 " " $$3}' $^ >>$@
|
||||
|
||||
all-local: $(top_srcdir)/src/include/H5hutF.h
|
||||
$(INSTALL) -m644 .libs/libH5hutF.a $(top_srcdir)/src/lib
|
||||
endif
|
||||
|
||||
clean: clean-am
|
||||
$(RM) ../include/H5hutF.h
|
||||
|
||||
clean-local:
|
||||
$(RM) -f *~
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void findunderscores(void){
|
||||
printf("#ifndef F77_NO_UNDERSCORE\n");
|
||||
printf("#define F77_NO_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_NO_CAPS\n");
|
||||
printf("#define F77_NO_CAPS\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_NO_UNDERSCORE\n");
|
||||
printf("#define F77_NO_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_NO_CAPS\n");
|
||||
printf("#define F77_NO_CAPS\n");
|
||||
printf("#endif\n");
|
||||
}
|
||||
|
||||
void FindUnderscores(void){
|
||||
printf("#ifndef F77_NO_UNDERSCORE\n");
|
||||
printf("#define F77_NO_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_NO_UNDERSCORE\n");
|
||||
printf("#define F77_NO_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
}
|
||||
|
||||
void FindUnderscores_(void){
|
||||
printf("#ifndef F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#define F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#define F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
}
|
||||
|
||||
void findunderscores_(void){
|
||||
printf("#ifndef F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#define F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_NO_CAPS\n");
|
||||
printf("#define F77_NO_CAPS\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#define F77_SINGLE_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_NO_CAPS\n");
|
||||
printf("#define F77_NO_CAPS\n");
|
||||
printf("#endif\n");
|
||||
}
|
||||
void FINDUNDERSCORES(void){
|
||||
printf("#ifndef F77_CRAY_UNDERSCORE\n");
|
||||
printf("#define F77_CRAY_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef F77_CRAY_UNDERSCORE\n");
|
||||
printf("#define F77_CRAY_UNDERSCORE\n");
|
||||
printf("#endif\n");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
Copyright (c) 2006-2012, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#ifndef __FORTRAN_H5_PRIVATE_H
|
||||
#define __FORTRAN_H5_PRIVATE_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
|
||||
#include "Underscore.h"
|
||||
|
||||
#if defined(F77_NO_UNDERSCORE)
|
||||
#define F77_NAME(a,b,c) a
|
||||
#elif defined(F77_SINGLE_UNDERSCORE)
|
||||
#define F77_NAME(a,b,c) b
|
||||
#elif defined(F77_CRAY_UNDERSCORE)
|
||||
#define F77_NAME(a,b,c) c
|
||||
#else
|
||||
#error Error, no way to determine how to construct fortran bindings
|
||||
#endif
|
||||
|
||||
#define convert_type2for(type) \
|
||||
if (*type == H5_STRING_T) { \
|
||||
*type = 1; \
|
||||
} else if (*type == H5_INT16_T) { \
|
||||
*type = 2; \
|
||||
} else if (*type == H5_INT32_T) { \
|
||||
*type = 3; \
|
||||
} else if (*type == H5_INT64_T) { \
|
||||
*type = 4; \
|
||||
} else if (*type == H5_FLOAT32_T) { \
|
||||
*type = 5; \
|
||||
} else if (*type == H5_FLOAT64_T) { \
|
||||
*type = 6; \
|
||||
} else { \
|
||||
H5_API_LEAVE ( \
|
||||
h5_error ( \
|
||||
H5_ERR_H5, \
|
||||
"Unknown attribute type")); \
|
||||
}
|
||||
|
||||
static inline char*
|
||||
h5_strdupfor2c (
|
||||
const char* s,
|
||||
const ssize_t len
|
||||
) {
|
||||
// :FIXME: error handling
|
||||
char* dup = (char*)malloc (len + 1);
|
||||
strncpy (dup, s, len);
|
||||
dup[len] = '\0';
|
||||
for (int i = len-1; i >= 0; i--) {
|
||||
if (dup[i] == ' ') dup[i] = '\0';
|
||||
else break;
|
||||
}
|
||||
return dup;
|
||||
}
|
||||
|
||||
static inline char*
|
||||
h5_strc2for (
|
||||
char* const str,
|
||||
const ssize_t l_str
|
||||
) {
|
||||
size_t len = strlen (str);
|
||||
memset (str+len, ' ', l_str-len);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static inline h5_file_t*
|
||||
h5_filehandlefor2c (
|
||||
const h5_int64_t* ptr
|
||||
) {
|
||||
return (h5_file_t*)ptr;
|
||||
}
|
||||
#endif
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# test level Makefile.am
|
||||
|
||||
SUBDIRS = h5core @BINDINGS@
|
||||
SUBDIRS = h5core C Fortran include
|
||||
|
||||
|
||||
+7
-35
@@ -1,36 +1,6 @@
|
||||
# src level Makefile.am
|
||||
|
||||
OBJEXT=o
|
||||
|
||||
AM_CPPFLAGS = -I../include @AM_CPPFLAGS@
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/src/include
|
||||
|
||||
EXTRA_HEADERS = \
|
||||
../include/h5core/h5_attach.h \
|
||||
../include/h5core/h5_attribs.h \
|
||||
../include/h5core/h5_core.h \
|
||||
../include/h5core/h5_errno.h \
|
||||
../include/h5core/h5_errorhandling.h \
|
||||
../include/h5core/h5_hdf5.h \
|
||||
../include/h5core/h5_maps.h \
|
||||
../include/h5core/h5_openclose.h \
|
||||
../include/h5core/h5_readwrite.h \
|
||||
../include/h5core/h5_syscall.h \
|
||||
../include/h5core/h5_types.h \
|
||||
../include/h5core/h5u_readwrite.h \
|
||||
../include/h5core/h5b_readwrite.h \
|
||||
../include/h5core/h5u_model.h \
|
||||
../include/h5core/h5b_model.h \
|
||||
../include/h5core/h5b_attribs.h \
|
||||
../include/h5core/h5t_adjacencies.h \
|
||||
../include/h5core/h5t_core.h \
|
||||
../include/h5core/h5t_inquiry.h \
|
||||
../include/h5core/h5t_map.h \
|
||||
../include/h5core/h5t_model.h \
|
||||
../include/h5core/h5t_readwrite.h \
|
||||
../include/h5core/h5t_ref_elements.h \
|
||||
../include/h5core/h5t_retrieve.h \
|
||||
../include/h5core/h5t_storemesh.h \
|
||||
../include/h5core/h5t_tags.h \
|
||||
h5_attribs_private.h \
|
||||
h5_core_private.h \
|
||||
h5_errorhandling_private.h \
|
||||
@@ -72,7 +42,7 @@ EXTRA_DIST = $(EXTRA_HEADERS)
|
||||
lib_LTLIBRARIES = libH5hut.la
|
||||
|
||||
# Listing of sources
|
||||
libH5hut_la_SOURCES = \
|
||||
libH5hut_la_SOURCES = \
|
||||
h5_attach.c \
|
||||
h5_attribs.c \
|
||||
h5_errorhandling.c \
|
||||
@@ -120,12 +90,14 @@ libH5hut_la_DEPENDENCIES = $(EXTRA_HEADERS)
|
||||
libH5hut_la_LDFLAGS = -version-info 2:0:0
|
||||
|
||||
all-local:
|
||||
$(INSTALL) -m644 .libs/libH5hut.a ../lib
|
||||
$(INSTALL) -m0755 -d $(top_builddir)/src/lib
|
||||
$(INSTALL) -m644 .libs/libH5hut.a $(top_builddir)/src/lib
|
||||
|
||||
install-exec-local:
|
||||
@$(INSTALL) -d $(DESTDIR)$(includedir)/h5core
|
||||
@$(INSTALL) -m644 ../include/h5core/*.h $(DESTDIR)$(includedir)/h5core/
|
||||
@$(INSTALL) -m644 $(top_srcdir)/src/include/h5core/*.h $(DESTDIR)$(includedir)/h5core/
|
||||
|
||||
clean-local:
|
||||
$(RM) -f ../lib/libH5hut.*
|
||||
$(RM) -f $(top_srcdir)/src/lib/libH5hut.*
|
||||
$(RM) -f *~
|
||||
|
||||
|
||||
@@ -1071,6 +1071,19 @@ hdf5_close_file (
|
||||
HDF5_WRAPPER_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
hdf5_close (
|
||||
void
|
||||
) {
|
||||
HDF5_WRAPPER_ENTER (h5_err_t, "%s", "void");
|
||||
if (H5close () < 0)
|
||||
HDF5_WRAPPER_LEAVE (
|
||||
h5_error (
|
||||
H5_ERR_HDF5,
|
||||
"Cannot close HDF5 library."));
|
||||
HDF5_WRAPPER_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
hdf5_flush (
|
||||
hid_t obj_id,
|
||||
|
||||
@@ -367,6 +367,14 @@ h5_close_file (
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5_close_hdf5 (
|
||||
void
|
||||
) {
|
||||
H5_CORE_API_ENTER (h5_err_t, "%s", "");
|
||||
H5_CORE_API_RETURN (hdf5_close ());
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5_flush_step (
|
||||
h5_file_t* const f
|
||||
@@ -495,36 +503,6 @@ h5_get_num_steps(
|
||||
f->prefix_step_name);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_core_filehandling
|
||||
|
||||
Start traversing steps.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
h5_start_traverse_steps (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
UNUSED_ARGUMENT (f);
|
||||
return h5_error_not_implemented ();
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_core_filehandling
|
||||
|
||||
Go to next step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
h5_traverse_steps (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
UNUSED_ARGUMENT (f);
|
||||
return h5_error_not_implemented ();
|
||||
}
|
||||
|
||||
char *
|
||||
h5_strdupfor2c (
|
||||
const char *s,
|
||||
|
||||
@@ -559,14 +559,14 @@ update_internal_structs (
|
||||
"m=%p, from_lvl=%u",
|
||||
m, (unsigned)from_lvl);
|
||||
h5_debug ("%s (%lld)", __func__, (long long)from_lvl);
|
||||
clock_t t1 = clock();
|
||||
// clock_t t1 = clock();
|
||||
TRY( compute_elems_of_vertices (m, from_lvl) );
|
||||
clock_t t2 = clock();
|
||||
// clock_t t2 = clock();
|
||||
// fprintf (stderr, "compute_elems_of_vertices(): %f\n",
|
||||
// (float)(t2-t1)/CLOCKS_PER_SEC);
|
||||
t1 = clock();
|
||||
// t1 = clock();
|
||||
TRY( compute_elems_of_edges (m, from_lvl ) );
|
||||
t2 = clock();
|
||||
// t2 = clock();
|
||||
// fprintf (stderr, "compute_elems_of_edge(): %f\n",
|
||||
// (float)(t2-t1)/CLOCKS_PER_SEC);
|
||||
h5_debug ("%s (%lld): done", __func__, (long long)from_lvl);
|
||||
|
||||
+272
-81
@@ -1,17 +1,11 @@
|
||||
/*
|
||||
Copyright 2007-2008
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
Copyright (c) 2006-2013, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#ifndef __H5_H
|
||||
#define __H5_H
|
||||
@@ -20,119 +14,316 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_file_t *
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Open file with name \c filbename. This function is available in the parallel
|
||||
and serial version. In the serial case \c comm may have any value.
|
||||
|
||||
File mode flags are:
|
||||
- H5_O_RDONLY: only reading allowed
|
||||
- H5_O_WRONLY: create new file, dataset must not exist
|
||||
- H5_O_APPEND: allows to append a new datasets to an existing file
|
||||
- H5_O_RDWR: dataset may exist
|
||||
|
||||
You can also select a "virtual file driver" in the HDF5 layer using:
|
||||
- H5_VFD_INDEPENDENT: MPI-IO in independent (asynchronous) mode
|
||||
- H5_VFD_MPIPOSIX: parallel I/O implemented directly by HDF5, bypassing MPI-IO
|
||||
|
||||
\return File handle.
|
||||
\return NULL on error.
|
||||
*/
|
||||
static inline h5_file_p
|
||||
H5OpenFile (
|
||||
const char * filename,
|
||||
h5_int32_t flag,
|
||||
MPI_Comm comm
|
||||
);
|
||||
const char* filename, /*!< file name */
|
||||
h5_int32_t flags, /*!< file open flags */
|
||||
MPI_Comm comm /*!< MPI communicator */
|
||||
) {
|
||||
H5_API_ENTER (h5_file_p, "filename='%s', flags=%d, ...",filename,flags);
|
||||
H5_API_RETURN (h5_open_file (filename, flags, comm, 0));
|
||||
}
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
h5_err_t
|
||||
Close file and free all memory associated with the file handle.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5CloseFile (
|
||||
h5_file_t * f
|
||||
);
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_close_file (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Verify that the file handle points to a valid H5hut file structure.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5CheckFile (
|
||||
h5_file_t * f
|
||||
);
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_check_filehandle (f));
|
||||
}
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
h5_err_t
|
||||
Define format of the step names.
|
||||
|
||||
Example: ==H5SetStepNameFormat( f, "Step", 6 )== defines step names
|
||||
like ==Step#000042==.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5SetStepNameFormat (
|
||||
h5_file_t *f,
|
||||
const char *name,
|
||||
const h5_int64_t width
|
||||
);
|
||||
h5_file_t* const f, /*!< Handle to file */
|
||||
const char* name, /*!< Prefix */
|
||||
const h5_int64_t width /*!< Width of the number */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', width=%lld",
|
||||
f, name, (long long) width);
|
||||
H5_API_RETURN (h5_set_stepname_fmt (f, name, width));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Get format of the step names.
|
||||
|
||||
\return value \c >=0 on success
|
||||
\return -1 on error
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5GetStepNameFormat (
|
||||
h5_file_t *f,
|
||||
char *name,
|
||||
const h5_size_t l_name,
|
||||
int *width
|
||||
);
|
||||
h5_file_t* const f, /*!< Handle to file */
|
||||
char* name, /*!< OUT: Prefix */
|
||||
const h5_size_t l_name, /*!< length of buffer name */
|
||||
int* width /*!< OUT: Width of the number */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name=%p, l_name=%llu, width=%p",
|
||||
f, name, (unsigned long long)l_name, width);
|
||||
H5_API_RETURN (h5_get_stepname_fmt (f, name, l_name, width));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Set the current step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5SetStep (
|
||||
h5_file_t *f,
|
||||
const h5_id_t step
|
||||
);
|
||||
h5_file_t* const f, /*!< [in] Handle to open file */
|
||||
const h5_id_t step /*!< [in] Step to set. */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, step=%lld", f, (long long)step);
|
||||
H5_API_RETURN (h5_set_step (f, step));
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Get current step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_id_t
|
||||
H5GetStep (
|
||||
h5_file_t *f
|
||||
);
|
||||
h5_file_t* const f /*!< Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_step (f));
|
||||
}
|
||||
|
||||
int
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Get the number of processors.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return Number of processors.
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
static inline int
|
||||
H5GetNumProcs (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_procs(f));
|
||||
}
|
||||
|
||||
h5_ssize_t
|
||||
/*!
|
||||
\ingroup h5hut_model
|
||||
|
||||
Get the number of time-steps that are currently stored in the file
|
||||
\c f.
|
||||
|
||||
It works for both reading and writing of files, but is probably
|
||||
only typically used when you are reading.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return number of time-steps or error code
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5GetNumSteps (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_steps(f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5_inquiry
|
||||
|
||||
Query whether a particular step already exists in the file.
|
||||
|
||||
\param[in] f File handle.
|
||||
\param[in] stepno Step number to query for existence
|
||||
|
||||
\return true or false
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5HasStep (
|
||||
h5_file_t * const f,
|
||||
h5_id_t step
|
||||
);
|
||||
h5_file_t* const f,
|
||||
h5_id_t stepno
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, stepno=%lld",
|
||||
f, (long long)stepno);
|
||||
H5_API_RETURN (h5_has_step (f, stepno));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5StartTraverseSteps (
|
||||
h5_file_t *f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5TraverseSteps (
|
||||
h5_file_t *f
|
||||
);
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
h5_err_t
|
||||
H5EndTraverseSteps (
|
||||
h5_file_t *f
|
||||
);
|
||||
Set verbosity level to \c level.
|
||||
|
||||
h5_err_t
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5SetVerbosityLevel (
|
||||
const h5_id_t level
|
||||
);
|
||||
) {
|
||||
return h5_set_debuglevel (level);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
Set error handler to \c handler.
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5SetErrorHandler (
|
||||
h5_errorhandler_t handler
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "handler=%p", handler);
|
||||
H5_API_RETURN (h5_set_errorhandler (handler));
|
||||
}
|
||||
|
||||
h5_errorhandler_t
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
Get current error handler.
|
||||
|
||||
\return Pointer to error handler.
|
||||
*/
|
||||
static inline h5_errorhandler_t
|
||||
H5GetErrorHandler (
|
||||
void
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_errorhandler_t, "%s", "void");
|
||||
H5_API_RETURN (h5_get_errorhandler());
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5ReportErrorhandler (
|
||||
const char *fmt,
|
||||
const char* fmt,
|
||||
va_list ap
|
||||
);
|
||||
) {
|
||||
return h5_report_errorhandler (fmt, ap);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5AbortErrorhandler (
|
||||
const char *fmt,
|
||||
const char* fmt,
|
||||
va_list ap
|
||||
);
|
||||
) {
|
||||
return h5_abort_errorhandler (fmt, ap);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_error
|
||||
|
||||
Get last error code.
|
||||
|
||||
\return error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5GetErrno (
|
||||
void
|
||||
);
|
||||
) {
|
||||
return h5_get_errno ();
|
||||
}
|
||||
|
||||
|
||||
static inline h5_err_t
|
||||
H5FlushStep (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_flush_step (f));
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
H5FlushFile (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_flush_file (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Set the `throttle` factor, which causes HDF5 write and read
|
||||
calls to be issued in that number of batches.
|
||||
|
||||
This can prevent large concurrency parallel applications that
|
||||
use independent writes from overwhelming the underlying
|
||||
parallel file system.
|
||||
|
||||
Throttling only works with the H5_VFD_MPIPOSIX or
|
||||
H5_VFD_INDEPENDENT drivers and is only available in
|
||||
the parallel library.
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
#ifdef PARALLEL_IO
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5SetThrottle (
|
||||
h5_file_t* f,
|
||||
int factor
|
||||
);
|
||||
#endif
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, factor=%d", f, factor);
|
||||
H5_API_RETURN (h5_set_throttle(f, factor));
|
||||
}
|
||||
#endif // PARALLEL_IO
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+585
-103
@@ -1,16 +1,96 @@
|
||||
#ifndef __H5BLOCK_H
|
||||
#define __H5BLOCK_H
|
||||
|
||||
/*!
|
||||
\defgroup h5block_c_api H5Block C API
|
||||
*/
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
\defgroup h5block_kernel H5Block Kernel
|
||||
*/
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
\defgroup h5block_private H5Block Private
|
||||
*/
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
\defgroup h5block_model Setting up the Data Model
|
||||
*/
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
\defgroup h5block_data Reading and Writing Datasets
|
||||
*/
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
\defgroup h5block_attrib Reading and Writing Attributes
|
||||
*/
|
||||
|
||||
/*!
|
||||
\note
|
||||
Different field sizes are allowed in the same time-step.
|
||||
|
||||
\note
|
||||
The same layout can be used, if the size of the field matches the
|
||||
size of the layout. If the size of the layout doesn't match the
|
||||
size of the field, an error will be indicated.
|
||||
|
||||
\note
|
||||
In write mode partitions are shrinked to make them non-overlaping. This
|
||||
process may shrink the partitions more than required.
|
||||
|
||||
\note
|
||||
In read-mode partitions may not cross boundaries. This means, if the grid
|
||||
size is (X, Y, Z), all partitions must fit into this grid.
|
||||
|
||||
|
||||
\todo
|
||||
check whether layout is reasonable
|
||||
|
||||
API function names
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_int64_t
|
||||
|
||||
/********************** defining the layout **********************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Tests whether a view has been set, either directly with
|
||||
\ref H5Block3dSetView or indirectly with \ref H5Block3dSetGrid.
|
||||
|
||||
\return 0 on false, 1 on true
|
||||
*/
|
||||
static inline h5_int64_t
|
||||
H5Block3dHasView (
|
||||
h5_file_t *const f /*!< IN: File handle */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", f);
|
||||
H5_API_RETURN (h5b_3d_has_view (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Defines the partition of the field that this processor owns, using
|
||||
Fortran ordering: the fastest moving index is \c i.
|
||||
|
||||
This routine uses an MPI_Allgather, so at large concurrency it should
|
||||
be called as infrequently as possible. For instance, if several timesteps
|
||||
use the same field dimensions, set the layout only once before the
|
||||
first timestep.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dSetView (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_int64_t i_start, /*!< IN: start index of \c i */
|
||||
@@ -19,20 +99,56 @@ H5Block3dSetView (
|
||||
const h5_int64_t j_end, /*!< IN: end index of \c j */
|
||||
const h5_int64_t k_start, /*!< IN: start index of \c k */
|
||||
const h5_int64_t k_end /*!< IN: end index of \c k */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%lld, i_end=%lld, "
|
||||
"j_start=%lld, j_end=%lld, "
|
||||
"k_start=%lld, k_end=%lld",
|
||||
f,
|
||||
(long long)i_start, (long long)i_end,
|
||||
(long long)j_start, (long long)j_end,
|
||||
(long long)k_start, (long long)k_end);
|
||||
H5_API_RETURN (h5b_3d_set_view(f, i_start, i_end, j_start, j_end, k_start, k_end));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Return the view of this processor.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dGetView (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
h5_size_t *const i_start, /*!< OUT: start index of \c i */
|
||||
h5_size_t *const i_end, /*!< OUT: end index of \c i */
|
||||
h5_size_t *const j_start, /*!< OUT: start index of \c j */
|
||||
h5_size_t *const j_end, /*!< OUT: end index of \c j */
|
||||
h5_size_t *const k_start, /*!< OUT: start index of \c k */
|
||||
h5_size_t *const k_end /*!< OUT: end index of \c k */
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
h5_size_t *i_start, /*!< OUT: start index of \c i */
|
||||
h5_size_t *i_end, /*!< OUT: end index of \c i */
|
||||
h5_size_t *j_start, /*!< OUT: start index of \c j */
|
||||
h5_size_t *j_end, /*!< OUT: end index of \c j */
|
||||
h5_size_t *k_start, /*!< OUT: start index of \c k */
|
||||
h5_size_t *k_end /*!< OUT: end index of \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
f,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
H5_API_RETURN (h5b_3d_get_view (f, i_start, i_end, j_start, j_end, k_start, k_end));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Return the reduced (ghost-zone free) view of this processor.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dGetReducedView (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
h5_size_t *const i_start, /*!< OUT: start index of \c i */
|
||||
@@ -41,157 +157,523 @@ H5Block3dGetReducedView (
|
||||
h5_size_t *const j_end, /*!< OUT: end index of \c j */
|
||||
h5_size_t *const k_start, /*!< OUT: start index of \c j */
|
||||
h5_size_t *const k_end /*!< OUT: end index of \c j */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"i_start=%p, i_end=%p, "
|
||||
"j_start=%p, j_end=%p, "
|
||||
"k_start=%p, k_end=%p",
|
||||
f,
|
||||
i_start, i_end,
|
||||
j_start, j_end,
|
||||
k_start, k_end);
|
||||
H5_API_RETURN (h5b_3d_get_reduced_view(f, i_start, i_end, j_start, j_end, k_start, k_end));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Define the chunk dimensions and enable chunking in the underlying
|
||||
HDF5 dataset.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dSetChunk (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: size of \c i */
|
||||
const h5_size_t j, /*!< IN: size of \c j */
|
||||
const h5_size_t k /*!< IN: size of \c k */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_chunk(f, i, j, k));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Lookup the chunk dimensions of the underlying HDF5 dataset.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dGetChunk (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const char *field_name, /*!< IN: name of dataset */
|
||||
h5_size_t *const i, /*!< OUT: size of i */
|
||||
h5_size_t *const j, /*!< OUT: size of j */
|
||||
h5_size_t *const k /*!< OUT: size of k */
|
||||
);
|
||||
h5_size_t *const i, /*!< OUT: size of \c i */
|
||||
h5_size_t *const j, /*!< OUT: size of \c j */
|
||||
h5_size_t *const k /*!< OUT: size of \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%p, j=%p, k=%p",
|
||||
f, i, j, k);
|
||||
H5_API_RETURN (h5b_3d_get_chunk(f, field_name, i, j, k));
|
||||
}
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
h5_err_t
|
||||
#ifdef PARALLEL_IO
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Define an underlying 3D Cartesian grid on the processors with dimensions
|
||||
(\c i,\c j,\c k). You can look up a processor's index into the grid
|
||||
using \ref H5Block3dGetGridCoords.
|
||||
|
||||
This function can be used in conjunction with \ref H5Block3dSetDims
|
||||
to setup the view for a regular grid.
|
||||
|
||||
The product of the dimensions must equal the size of the MPI communicator.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dSetGrid (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: dimension in \c i */
|
||||
const h5_size_t j, /*!< IN: dimension in \c j */
|
||||
const h5_size_t k /*!< IN: dimension in \c k */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_grid(f, i, j, k));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Look up the index (\c i, \c j, \c k) in the grid belonging to MPI processor
|
||||
\c proc.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dGetGridCoords (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const int proc, /*!< IN: MPI processor */
|
||||
h5_int64_t *const i, /*!< OUT: index in \c i */
|
||||
h5_int64_t *const j, /*!< OUT: index in \c j */
|
||||
h5_int64_t *const k /*!< OUT: index in \c k */
|
||||
);
|
||||
h5_int64_t *i, /*!< OUT: index in \c i */
|
||||
h5_int64_t *j, /*!< OUT: index in \c j */
|
||||
h5_int64_t *k /*!< OUT: index in \c k */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, proc=%d, i=%p, j=%p, k=%p",
|
||||
f, proc, i, j, k);
|
||||
H5_API_RETURN (h5b_3d_get_grid_coords(f, proc, i, j, k));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Set the dimensions of each processor's block when the field is a regular
|
||||
grid.
|
||||
|
||||
A grid must be already set with \ref H5Block3dSetGrid, and all processors
|
||||
must specify the same dimensions.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dSetDims (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: dimension in \c i */
|
||||
const h5_size_t j, /*!< IN: dimension in \c j */
|
||||
const h5_size_t k /*!< IN: dimension in \c k */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_dims(f, i, j, k));
|
||||
}
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Sets the additional cells (\c i, \c j, \c k) in each direction to use as
|
||||
the `halo` region (or `ghost zone`) that overlaps between neighboring
|
||||
processors on the grid.
|
||||
|
||||
A grid with dimensions must already be set with \ref H5Block3dSetGrid and
|
||||
\ref H5Block3dSetDims, and all processors must specify the same halo radii.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dSetHalo (
|
||||
h5_file_t *const f, /*!< IN: File handle */
|
||||
const h5_size_t i, /*!< IN: radius in \c i */
|
||||
const h5_size_t j, /*!< IN: radius in \c j */
|
||||
const h5_size_t k /*!< IN: radius in \c k */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, i=%llu, j=%llu, k=%llu",
|
||||
f,
|
||||
(long long unsigned)i,
|
||||
(long long unsigned)j,
|
||||
(long long unsigned)k);
|
||||
H5_API_RETURN (h5b_3d_set_halo(f, i, j, k));
|
||||
}
|
||||
|
||||
h5_ssize_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Query number of fields in current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5BlockGetNumFields (
|
||||
h5_file_t *const f /*!< IN: file handle */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
H5_API_RETURN (h5b_get_num_fields(f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Get the name, rank and dimensions of the field specified by the
|
||||
index \c idx.
|
||||
|
||||
\c elem_rank reports the rank of the elements in the field
|
||||
(e.g. scalar or vector).
|
||||
|
||||
This function can be used to retrieve all fields bound to the
|
||||
current time-step by looping from \c 0 to the number of fields
|
||||
minus one. The number of fields bound to the current time-step
|
||||
can be queried by calling the function \ref H5BlockGetNumFields.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockGetFieldInfo (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const h5_size_t idx, /*!< IN: index of field */
|
||||
char *name, /*!< OUT: field name */
|
||||
const h5_size_t len_name, /*!< IN: buffer size */
|
||||
h5_size_t *const field_rank, /*!< OUT: field rank */
|
||||
h5_size_t *const field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *const elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *const type /*!< OUT: datatype */
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const h5_size_t idx, /*!< IN: index of field */
|
||||
char *name, /*!< OUT: field name */
|
||||
const h5_size_t len_name, /*!< IN: buffer size */
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_size_t *field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, idx=%llu, "
|
||||
"name=%p, len_name=%llu, "
|
||||
"field_rank=%p, field_dims=%p, elem_rank=%p, type=%p",
|
||||
f, (long long unsigned)idx,
|
||||
name, (long long unsigned)len_name,
|
||||
field_rank, field_dims, elem_rank,
|
||||
type);
|
||||
H5_API_RETURN (
|
||||
h5b_get_field_info (
|
||||
f,
|
||||
idx,
|
||||
name,
|
||||
len_name,
|
||||
field_rank,
|
||||
field_dims,
|
||||
elem_rank,
|
||||
type));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_model
|
||||
|
||||
Get the rank and dimensions of the field specified by its name.
|
||||
See \ref H5BlockGetFieldInfo.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockGetFieldInfoByName (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: field name */
|
||||
h5_size_t *const field_rank, /*!< OUT: field rank */
|
||||
h5_size_t *const field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *const elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *const type /*!< OUT: datatype */
|
||||
);
|
||||
h5_size_t *field_rank, /*!< OUT: field rank */
|
||||
h5_size_t *field_dims, /*!< OUT: field dimensions */
|
||||
h5_size_t *elem_rank, /*!< OUT: element rank */
|
||||
h5_int64_t *type /*!< OUT: datatype */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', "
|
||||
"field_rank=%p, field_dims=%p, elem_rank=%p, type=%p",
|
||||
f, name, field_rank, field_dims, elem_rank, type);
|
||||
H5_API_RETURN (
|
||||
h5b_get_field_info_by_name (
|
||||
f,
|
||||
name,
|
||||
field_rank,
|
||||
field_dims,
|
||||
elem_rank,
|
||||
type));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/********************** reading and writing attribute ************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write the string \c value as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockWriteFieldAttribString (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *const field_name, /*!< IN: field name */
|
||||
const char *const attrib_name, /*!< IN: attribute name */
|
||||
const char *const value /*!< IN: attribute value */
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const char *buffer /*!< IN: attribute value */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer='%s'",
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
buffer);
|
||||
H5_API_RETURN (
|
||||
h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_CHAR,
|
||||
buffer,
|
||||
strlen(buffer) + 1));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read the string value from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockReadFieldAttribString (
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *const field_name, /*!< IN: field name */
|
||||
const char *const attrib_name, /*!< IN: attribute name */
|
||||
char *const buffer /*!< OUT: attribute value */
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
char *buffer /*!< OUT: attribute value */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"field_name='%s', "
|
||||
"attrib_name='%s', "
|
||||
"buffer=%p",
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
buffer);
|
||||
H5_API_RETURN (
|
||||
h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_ssize_t
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Query the number of attributes of field \c field_name.
|
||||
|
||||
\return number of attributes or error code
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5BlockGetNumFieldAttribs (
|
||||
h5_file_t *const f, /*<! IN: file handle */
|
||||
const char *const field_name /*<! IN: field name */
|
||||
);
|
||||
h5_file_t *const f, /*<! IN: file handle */
|
||||
const char *field_name /*<! IN: field name */
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p, field_name='%s'", f, field_name);
|
||||
H5_API_RETURN (h5b_get_num_field_attribs (f, field_name));
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Gets the name, type and number of elements of the field attribute
|
||||
specified by its index.
|
||||
|
||||
This function can be used to retrieve all attributes bound to the
|
||||
specified field by looping from \c 0 to the number of attribute
|
||||
minus one. The number of attributes bound to the
|
||||
field can be queried by calling \ref H5BlockGetNumFieldAttribs.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockGetFieldAttribInfo (
|
||||
h5_file_t *const f, /*<! IN: Handle to open file */
|
||||
const char *const field_name, /*<! IN: field name */
|
||||
const char *field_name, /*<! IN: field name */
|
||||
const h5_size_t attrib_idx, /*<! IN: Index of attribute to
|
||||
get infos about */
|
||||
char *const attrib_name, /*<! OUT: Name of attribute */
|
||||
const h5_size_t len_of_attrib_name,
|
||||
char *attrib_name, /*<! OUT: Name of attribute */
|
||||
const h5_size_t len_attrib_name,
|
||||
/*<! IN: length of buffer \c name */
|
||||
h5_int64_t *const attrib_type, /*<! OUT: Type of value. */
|
||||
h5_size_t *const attrib_nelem /*<! OUT: Number of elements */
|
||||
);
|
||||
h5_int64_t *attrib_type, /*<! OUT: Type of value. */
|
||||
h5_size_t *attrib_nelem /*<! OUT: Number of elements */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p field_name='%s', "
|
||||
"attrib_idx=%llu, "
|
||||
"attrib_name=%p, len_attrib_name=%llu, "
|
||||
"attrib_type=%p, "
|
||||
"attrib_nelem=%p",
|
||||
f,
|
||||
field_name,
|
||||
(long long unsigned)attrib_idx,
|
||||
attrib_name, (long long unsigned)len_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem);
|
||||
H5_API_RETURN (
|
||||
h5b_get_field_attrib_info (
|
||||
f,
|
||||
field_name,
|
||||
attrib_idx,
|
||||
attrib_name,
|
||||
len_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
#define H5BLOCK_FIELD_ORIGIN_NAME "__Origin__"
|
||||
#define H5BLOCK_FIELD_SPACING_NAME "__Spacing__"
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Get field origin.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dGetFieldOrigin (
|
||||
h5_file_t *f,
|
||||
const char *field_name,
|
||||
h5_float64_t *x_origin,
|
||||
h5_float64_t *y_origin,
|
||||
h5_float64_t *z_origin
|
||||
);
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
h5_float64_t *x_origin, /*!< OUT: X origin */
|
||||
h5_float64_t *y_origin, /*!< OUT: Y origin */
|
||||
h5_float64_t *z_origin /*!< OUT: Z origin */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_origin=%p, y_origin=%p, z_origin=%p",
|
||||
f, field_name, x_origin, y_origin, z_origin);
|
||||
h5_float64_t origin[3];
|
||||
|
||||
h5_err_t
|
||||
TRY (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_ORIGIN_NAME,
|
||||
H5_FLOAT64_T,
|
||||
origin));
|
||||
|
||||
*x_origin = origin[0];
|
||||
*y_origin = origin[1];
|
||||
*z_origin = origin[2];
|
||||
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Set field origin.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dSetFieldOrigin (
|
||||
h5_file_t *f,
|
||||
const char *field_name,
|
||||
const h5_float64_t x_origin,
|
||||
const h5_float64_t y_origin,
|
||||
const h5_float64_t z_origin
|
||||
);
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const h5_float64_t x_origin, /*!< IN: X origin */
|
||||
const h5_float64_t y_origin, /*!< IN: Y origin */
|
||||
const h5_float64_t z_origin /*!< IN: Z origin */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_origin=%g, y_origin=%g, z_origin=%g",
|
||||
f, field_name, x_origin, y_origin, z_origin);
|
||||
h5_float64_t origin[3] = { x_origin, y_origin, z_origin };
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_ORIGIN_NAME,
|
||||
(hid_t)H5_FLOAT64_T,
|
||||
origin,
|
||||
3));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Get field spacing for field \c field_name in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dGetFieldSpacing (
|
||||
h5_file_t *f,
|
||||
const char *field_name,
|
||||
h5_float64_t *x_spacing,
|
||||
h5_float64_t *y_spacing,
|
||||
h5_float64_t *z_spacing
|
||||
);
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
h5_float64_t *x_spacing, /*!< OUT: X spacing */
|
||||
h5_float64_t *y_spacing, /*!< OUT: Y spacing */
|
||||
h5_float64_t *z_spacing /*!< OUT: Z spacing */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_spacing=%p, y_spacing=%p, z_spacing=%p",
|
||||
f, field_name, x_spacing, y_spacing, z_spacing);
|
||||
h5_float64_t spacing[3];
|
||||
TRY (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_SPACING_NAME,
|
||||
H5_FLOAT64_T,
|
||||
spacing));
|
||||
*x_spacing = spacing[0];
|
||||
*y_spacing = spacing[1];
|
||||
*z_spacing = spacing[2];
|
||||
H5_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5block_c_api
|
||||
|
||||
Set field spacing for field \c field_name in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dSetFieldSpacing (
|
||||
h5_file_t *f,
|
||||
const char *field_name,
|
||||
const h5_float64_t x_spacing,
|
||||
const h5_float64_t y_spacing,
|
||||
const h5_float64_t z_spacing
|
||||
);
|
||||
h5_file_t *f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const h5_float64_t x_spacing, /*!< IN: X spacing */
|
||||
const h5_float64_t y_spacing, /*!< IN: Y spacing */
|
||||
const h5_float64_t z_spacing /*!< IN: Z spacing */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', x_spacing=%g, y_spacing=%g, z_spacing=%g",
|
||||
f, field_name, x_spacing, y_spacing, z_spacing);
|
||||
h5_float64_t spacing[3] = { x_spacing, y_spacing, z_spacing };
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
H5BLOCK_FIELD_SPACING_NAME,
|
||||
(hid_t)H5_FLOAT64_T,
|
||||
spacing,
|
||||
3));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+575
-148
@@ -5,201 +5,628 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
floating points (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteScalarFieldFloat64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float64_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
floating points (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadScalarFieldFloat64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_float64_t *buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteVector3dFieldFloat64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_float64_t *x_buf,
|
||||
const h5_float64_t *y_buf,
|
||||
const h5_float64_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float64_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_float64_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_float64_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_write_vector3d_data(f, name,
|
||||
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadVector3dFieldFloat64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_float64_t *x_buf,
|
||||
h5_float64_t *y_buf,
|
||||
h5_float64_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_float64_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_float64_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_float64_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
floating points (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteScalarFieldFloat32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float32_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_FLOAT ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
floating points (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadScalarFieldFloat32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_float32_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_float32_t *const buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteVector3dFieldFloat32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_float32_t *x_buf,
|
||||
const h5_float32_t *y_buf,
|
||||
const h5_float32_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_float32_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_float32_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_float32_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_write_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with floating points (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadVector3dFieldFloat32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_float32_t *x_buf,
|
||||
h5_float32_t *y_buf,
|
||||
h5_float32_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_float32_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_float32_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_float32_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
integers (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteScalarFieldInt64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int64_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_INT64 ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
integers (64-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadScalarFieldInt64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_int64_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_int64_t *const buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteVector3dFieldInt64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_int64_t *x_buf,
|
||||
const h5_int64_t *y_buf,
|
||||
const h5_int64_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int64_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_int64_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_int64_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN (h5b_write_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (64-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadVector3dFieldInt64 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_int64_t *x_buf,
|
||||
h5_int64_t *y_buf,
|
||||
h5_int64_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_int64_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_int64_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_int64_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN (h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Write a 3-dimensional field \c name from the buffer starting at \c data
|
||||
to the current time-step using the defined field layout. Values are
|
||||
integers (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteScalarFieldInt32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int32_t *buffer /*!< IN: pointer to write buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_INT32 ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
|
||||
Read a 3-dimensional field \c name into the buffer starting at \c data from
|
||||
the current time-step using the defined field layout. Values are
|
||||
integers (32-bit).
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadScalarFieldInt32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_int32_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to read */
|
||||
h5_int32_t *const buffer /*!< OUT: pointer to read buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", f, name, buffer);
|
||||
H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Write a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c x_buf.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dWriteVector3dFieldInt32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
const h5_int32_t *x_buf,
|
||||
const h5_int32_t *y_buf,
|
||||
const h5_int32_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
const h5_int32_t *x_buf, /*!< IN: pointer to X axis buffer */
|
||||
const h5_int32_t *y_buf, /*!< IN: pointer to Y axis buffer */
|
||||
const h5_int32_t *z_buf /*!< IN: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_write_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_data
|
||||
*/
|
||||
/*!
|
||||
Read a 3-dimensional field \c name with 3-dimensional vectors as values
|
||||
from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the
|
||||
current time-step using the defined field layout. Values are 3-dimensional
|
||||
vectors with integers (32-bit) values.
|
||||
|
||||
You must use the Fortran indexing scheme to access items in \c data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5Block3dReadVector3dFieldInt32 (
|
||||
h5_file_t *const f,
|
||||
const char *name,
|
||||
h5_int32_t *x_buf,
|
||||
h5_int32_t *y_buf,
|
||||
h5_int32_t *z_buf
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *name, /*!< IN: name of dataset to write */
|
||||
h5_int32_t *const x_buf, /*!< OUT: pointer to X axis buffer */
|
||||
h5_int32_t *const y_buf, /*!< OUT: pointer to Y axis buffer */
|
||||
h5_int32_t *const z_buf /*!< OUT: pointer to Z axis buffer */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p",
|
||||
f, name, x_buf, y_buf, z_buf);
|
||||
H5_API_RETURN(h5b_read_vector3d_data(f, name,
|
||||
x_buf, y_buf, z_buf, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write float64 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockWriteFieldAttribFloat64 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_float64_t *buffer,
|
||||
const h5_size_t nelems
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_float64_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read float64 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockReadFieldAttribFloat64 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_float64_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_float64_t *buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
(void*)buffer ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write float32 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockWriteFieldAttribFloat32 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_float32_t *buffer,
|
||||
const h5_size_t nelems
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_float32_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read float32 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockReadFieldAttribFloat32 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_float32_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_float32_t *const buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
buffer ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write int64 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockWriteFieldAttribInt64 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_int64_t *buffer,
|
||||
const h5_size_t nelems
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_int64_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT64,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read int64 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockReadFieldAttribInt64 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_int64_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_int64_t *const buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT64,
|
||||
buffer ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Write int32 \c values as attribute \c attrib_name of field
|
||||
\c field_name.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockWriteFieldAttribInt32 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
const h5_int32_t *buffer,
|
||||
const h5_size_t nelems
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
const h5_int32_t *buffer, /*!< IN: attribute values */
|
||||
const h5_size_t nelems /*!< IN: number of elements */
|
||||
) {
|
||||
|
||||
h5_err_t
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, field_name='%s', attrib_name='%s', "
|
||||
"buffer=%p, nelems=%lld",
|
||||
f, field_name, attrib_name, buffer, (long long)nelems);
|
||||
H5_API_RETURN (h5_write_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT32,
|
||||
buffer,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5block_attrib
|
||||
|
||||
Read int32 values from attribute \c attrib_name of field
|
||||
\c field_name into a \c buffer.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5BlockReadFieldAttribInt32 (
|
||||
h5_file_t *const f,
|
||||
const char *field_name,
|
||||
const char *attrib_name,
|
||||
h5_int32_t *buffer
|
||||
);
|
||||
h5_file_t *const f, /*!< IN: file handle */
|
||||
const char *field_name, /*!< IN: field name */
|
||||
const char *attrib_name, /*!< IN: attribute name */
|
||||
h5_int32_t *buffer /*!< OUT: attribute values */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
|
||||
f, field_name, attrib_name, buffer);
|
||||
H5_API_RETURN (h5_read_field_attrib (
|
||||
f,
|
||||
field_name,
|
||||
attrib_name,
|
||||
H5T_NATIVE_INT32,
|
||||
(void*)buffer ));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -102,15 +102,3 @@ H5FedLinkMeshToStep (
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+491
-42
@@ -5,95 +5,402 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Set the number of particles for the current time-step.
|
||||
After you call this subroutine, all subsequent
|
||||
operations will assume this number of particles will be written.
|
||||
|
||||
For the parallel library, the \c nparticles value is the number of
|
||||
particles that the \e individual task will write. You can use
|
||||
a different value on different tasks.
|
||||
This function uses an \c MPI_Allgather
|
||||
call to aggregate each tasks number of particles and determine
|
||||
the appropiate offsets. Because of the use of this MPI collective,
|
||||
it is advisable to call this function as
|
||||
few times as possible when running at large concurrency.
|
||||
|
||||
This function assumes that your particles' data fields are in stored in
|
||||
contiguous 1D arrays.
|
||||
For instance, the fields \e x and \e y for your particles are stored
|
||||
in separate arrays \c x[] and \c y[].
|
||||
|
||||
If instead you store your particles as tuples, so that the values
|
||||
are arranged \f$ x_1,y_1,x_2,y_2\f$... than you need to setup striding
|
||||
(in this case with value 2) using \ref H5PartSetNumParticlesStrided.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartSetNumParticles (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_size_t nparticles /*!< [in] Number of particles */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, nparticles=%llu",
|
||||
f, (long long unsigned)nparticles);
|
||||
h5_size_t stride = 1;
|
||||
H5_API_RETURN (h5u_set_num_particles(f, nparticles, stride));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Set the number of particles for the current time-step.
|
||||
After you call this subroutine, all subsequent
|
||||
operations will assume this number of particles will be written.
|
||||
|
||||
For the parallel library, the \c nparticles value is the number of
|
||||
particles that the \e individual task will write. You can use
|
||||
a different value on different tasks.
|
||||
This function uses an \c MPI_Allgather
|
||||
call to aggregate each tasks number of particles and determine
|
||||
the appropiate offsets. Because of the use of this MPI collective,
|
||||
it is advisable to call this function as
|
||||
few times as possible when running at large concurrency.
|
||||
|
||||
This function assumes that your particles' data fields are
|
||||
stored tuples. For instance, the fields \e x and \e y of your
|
||||
particles are arranged \f$x_1,y_1,x_2,y_2\f$... in a single data
|
||||
array. In this example, the stride value would be 2.
|
||||
|
||||
If you instead have a separate array for each fields,
|
||||
such as \c x[] and \c y[],
|
||||
use \ref H5PartSetNumParticles.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartSetNumParticlesStrided (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_size_t nparticles, /*!< [in] Number of particles */
|
||||
h5_size_t stride /*!< [in] Stride value (e.g. number of fields in the particle array) */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, nparticles=%llu, stride=%llu",
|
||||
f, (long long unsigned)nparticles,
|
||||
(long long unsigned)stride);
|
||||
H5_API_RETURN (h5u_set_num_particles (f, nparticles, stride));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Define the chunk \c size and enables chunking in the underlying
|
||||
HDF5 layer.
|
||||
|
||||
Note that this policy wastes disk space, but can improve write
|
||||
bandwidth on parallel filesystems that are sensitive to write alignment
|
||||
(e.g. lustre). It is only recommended when using the MPI-POSIX or MPI-IO
|
||||
independent VFDs (see \ref H5OpenFile).
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartSetChunk (
|
||||
h5_file_t *f,
|
||||
h5_size_t size
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, size=%llu", f, (long long unsigned)size);
|
||||
H5_API_RETURN (h5u_set_chunk (f, size));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 64 bit floating point data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartWriteDataFloat64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_float64_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_write_data (f, name, (void*)data, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 32 bit floating point data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartWriteDataFloat32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_float32_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
h5_err_t h5err = h5u_write_data( f, name, (void*)data, H5T_NATIVE_FLOAT );
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 64 bit integer data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartWriteDataInt64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_int64_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_write_data (f, name, (void*)data, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Write array of 32 bit integer data to file.
|
||||
|
||||
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||
the current timestep using \c H5SetStep(), you can start writing datasets
|
||||
into the file. Each dataset has a name associated with it (chosen by the
|
||||
user) in order to facilitate later retrieval. The name of the dataset is
|
||||
specified in the parameter \c name, which must be a null-terminated string.
|
||||
|
||||
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||
at some common naming convention when sharing data with other groups.
|
||||
|
||||
The writing routines also implicitly store the datatype of the array so that
|
||||
the array can be reconstructed properly on other systems with incompatible
|
||||
type representations.
|
||||
|
||||
All data that is written after setting the timestep is associated with that
|
||||
timestep. While the number of particles can change for each timestep, you
|
||||
cannot change the number of particles in the middle of a given timestep.
|
||||
|
||||
The data is committed to disk before the routine returns.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartWriteDataInt32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate array with */
|
||||
const h5_int32_t *data /*!< [in] Array to commit to disk */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_write_data (f, name, (void*)data, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 64 bit floating point data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartReadDataFloat64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_float64_t *data /*!< [out] Array of data */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_DOUBLE));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 32 bit floating point data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartReadDataFloat32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_float32_t *data /*!< [out] Array of data */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_FLOAT));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 64 bit integer data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartReadDataInt64 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_int64_t *data /*!< [out] Array of data */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_INT64));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_data
|
||||
|
||||
Read array of 32 bit integer data from file.
|
||||
|
||||
When retrieving datasets from disk, you ask for them
|
||||
by name. There are no restrictions on naming of arrays,
|
||||
but it is useful to arrive at some common naming
|
||||
convention when sharing data with other groups.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartReadDataInt32 (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name to associate dataset with */
|
||||
h5_int32_t *data /*!< [out] Array of data */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', date=%p", f,name,data);
|
||||
H5_API_RETURN (h5u_read_data (f, name, data, H5T_NATIVE_INT32));
|
||||
}
|
||||
|
||||
h5_ssize_t
|
||||
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Get the number of datasets that are stored at the current time-step.
|
||||
|
||||
\return number of datasets in current timestep or error code
|
||||
*/
|
||||
|
||||
static inline h5_ssize_t
|
||||
H5PartGetNumDatasets (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_get_num_datasets(f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
This reads the name of a dataset specified by it's index in the current
|
||||
time-step.
|
||||
|
||||
If the number of datasets is \c n, the range of \c _index is \c 0 to \c n-1.
|
||||
|
||||
\result \c H5_SUCCESS
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartGetDatasetName (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_id_t idx, /*!< [in] Index of the dataset */
|
||||
char *name, /*!< [out] Name of dataset */
|
||||
const h5_size_t len /*!< [in] Size of buffer \c name */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"idx=%lld, "
|
||||
"name='%p', len=%llu, ",
|
||||
f,
|
||||
(long long)idx,
|
||||
name, (unsigned long long)len);
|
||||
H5_API_RETURN (h5u_get_dataset_info(f, idx, name, len, NULL, NULL));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Gets the name, type and number of elements of a dataset based on its
|
||||
index in the current timestep.
|
||||
|
||||
Type is one of the following values:
|
||||
|
||||
- \c H5_FLOAT64_T (for \c h5_float64_t)
|
||||
- \c H5_FLOAT32_T (for \c h5_float32_t)
|
||||
- \c H5_INT64_T (for \c h5_int64_t)
|
||||
- \c H5_INT32_T (for \c h5_int32_t)
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartGetDatasetInfo (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_id_t idx, /*!< [in] Index of the dataset */
|
||||
@@ -102,48 +409,190 @@ H5PartGetDatasetInfo (
|
||||
/*!< [in] Size of buffer \c dataset_name */
|
||||
h5_int64_t *type, /*!< [out] Type of data in dataset */
|
||||
h5_size_t *nelem /*!< [out] Number of elements. */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t,
|
||||
"f=%p, "
|
||||
"idx=%lld, "
|
||||
"dataset_name='%p', len_dataset_name=%llu, "
|
||||
"type=%p, nelem=%p",
|
||||
f,
|
||||
(long long)idx,
|
||||
dataset_name, (long long unsigned)len_dataset_name,
|
||||
type, nelem);
|
||||
H5_API_RETURN (h5u_get_dataset_info (
|
||||
f, idx, dataset_name, len_dataset_name, type, nelem));
|
||||
}
|
||||
|
||||
h5_ssize_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
This function returns the number of particles in this processor's view,
|
||||
if a view has been set.
|
||||
|
||||
If not, it returns the total number of particles across all processors
|
||||
from the last \ref H5PartSetNumParticles call.
|
||||
|
||||
If you have neither set the number of particles
|
||||
nor set a view, then this returns the total number of
|
||||
particles in the first data set of the current time step.
|
||||
Note that H5Part assumes that all data sets within a given time step
|
||||
have the same number of particles (although the number particles can
|
||||
vary across time steps).
|
||||
|
||||
If none of these conditions are met, an error is thrown.
|
||||
|
||||
\return number of particles in current timestep or an error
|
||||
code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5PartGetNumParticles (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
CHECK_FILEHANDLE( f );
|
||||
H5_API_RETURN (h5u_get_num_particles (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Reset the view.
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartResetView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_reset_view (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Check whether a view has been set, either automatically with
|
||||
\ref H5PartSetNumParticles or manually with \ref H5PartSetView
|
||||
or \ref H5PartSetViewIndices.
|
||||
|
||||
\return 0 for false or 1 for true
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartHasView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_has_view (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
For parallel I/O or for subsetting operations on the datafile,
|
||||
this function allows you to define a subset of the total
|
||||
particle dataset to operate on.
|
||||
The concept of "view" works for both serial
|
||||
and for parallel I/O. The "view" will remain in effect until a new view
|
||||
is set, or the number of particles in a dataset changes, or the view is
|
||||
"unset" by calling \c H5PartSetView(file,-1,-1);
|
||||
|
||||
Before you set a view, \ref H5PartGetNumParticles will return the
|
||||
total number of particles in the current time-step (even for the parallel
|
||||
reads). However, after you set a view, it will return the number of
|
||||
particles contained in the view.
|
||||
|
||||
The range is \e inclusive: the end value is the last index of the
|
||||
data.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartSetView (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t start, /*!< [in] Start particle */
|
||||
h5_int64_t end /*!< [in] End particle */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, start=%lld, end=%lld",
|
||||
f, (long long)start, (long long)end);
|
||||
H5_API_RETURN (h5u_set_view (f, start, end));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
For parallel I/O or for subsetting operations on the datafile,
|
||||
this function allows you to define a subset of the total
|
||||
dataset to operate on by specifying a list of indices.
|
||||
The concept of "view" works for both serial
|
||||
and for parallel I/O. The "view" will remain in effect until a new view
|
||||
is set, or the number of particles in a dataset changes, or the view is
|
||||
"unset" by calling \c H5PartSetViewIndices(NULL,0);
|
||||
|
||||
When you perform a read or write on a view consisting of indices, it
|
||||
is assumed that your buffer is \b unpacked, meaning that there is room
|
||||
for all the intermediate values (which will not be touched by the read
|
||||
or write).
|
||||
|
||||
Before you set a view, the \c H5PartGetNumParticles() will return the
|
||||
total number of particles in the current time-step (even for the parallel
|
||||
reads). However, after you set a view, it will return the number of
|
||||
particles contained in the view.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartSetViewIndices (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_size_t *indices, /*!< [in] List of indices */
|
||||
h5_size_t nelems /*!< [in] Size of list */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, indices=%p, nelems=%llu",
|
||||
f, indices, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5u_set_view_indices (f, indices, nelems));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
Allows you to query the current view. Start and End
|
||||
will be \c -1 if there is no current view established.
|
||||
Use \c H5PartHasView() to see if the view is smaller than the
|
||||
total dataset.
|
||||
|
||||
\return number of elements in the view or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartGetView (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
h5_int64_t *start, /*!< [out] Start particle */
|
||||
h5_int64_t *end /*!< [out] End particle */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, start=%p, end=%p",
|
||||
f, start, end);
|
||||
H5_API_RETURN (h5u_get_view (f, start, end));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5part_model
|
||||
|
||||
If it is too tedious to manually set the start and end coordinates
|
||||
for a view, the \c H5SetCanonicalView() will automatically select an
|
||||
appropriate domain decomposition of the data arrays for the degree
|
||||
of parallelism and set the "view" accordingly.
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5PartSetCanonicalView (
|
||||
h5_file_t *f /*!< [in] Handle to open file */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p", f);
|
||||
H5_API_RETURN (h5u_set_canonical_view (f));
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -5,44 +5,68 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_ssize_t
|
||||
static inline h5_ssize_t
|
||||
H5GetNumAttachments (
|
||||
h5_file_t* const f
|
||||
);
|
||||
h5_file_t* const f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_attachments (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5GetAttachmentInfoByIdx (
|
||||
h5_file_t* const f,
|
||||
const h5_size_t idx, // IN
|
||||
char* const fname, // OUT
|
||||
h5_size_t len_fname, // IN
|
||||
h5_size_t* const fsize // OUT
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"idx=%llu, fname=%p, len_fname=%llu, fsize=%p",
|
||||
(long long unsigned)idx,
|
||||
fname, (long long unsigned)len_fname,
|
||||
fsize);
|
||||
H5_API_RETURN (h5_get_attachment_info_by_idx (
|
||||
f, idx, fname, len_fname, fsize));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5GetAttachmentInfoByName (
|
||||
h5_file_t* const f,
|
||||
char* const fname,
|
||||
h5_size_t* const fsize
|
||||
);
|
||||
char* const fname, // OUT
|
||||
h5_size_t* const fsize // OUT
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s', fsize=%p", fname, fsize);
|
||||
H5_API_RETURN (h5_get_attachment_info_by_name (
|
||||
f, fname, fsize));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5AddAttachment (
|
||||
h5_file_t* const f,
|
||||
const char* fname
|
||||
);
|
||||
h5_file_t* const f, /*!< [in] Handle to open file */
|
||||
const char* fname /*!< [in] Name of file to attach */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s'", fname);
|
||||
H5_API_RETURN (h5_add_attachment (f, fname));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5GetAttachment (
|
||||
h5_file_t* const f,
|
||||
const char* name
|
||||
);
|
||||
h5_file_t* const f, /*!< [in] Handle to open file */
|
||||
const char* fname /*!< [in] Name of attachment */
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s'", fname);
|
||||
H5_API_RETURN (h5_get_attachment (f, fname));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5DeleteAttachment (
|
||||
h5_file_t* const f,
|
||||
const char* const name
|
||||
);
|
||||
const char* const fname
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "fname='%s'", fname);
|
||||
H5_API_RETURN (h5_delete_attachment (f, fname));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+489
-48
@@ -5,165 +5,555 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
/*** WRITE ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with the string \c value to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteFileAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const char *value /*!< [in] Value of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'", f, name, value);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_CHAR,
|
||||
value,
|
||||
strlen(value) + 1 ));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with the string \c value to
|
||||
the current timestep.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteStepAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const char *value /*!< [in] Value of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'", f, name, value);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_CHAR,
|
||||
value,
|
||||
strlen(value) + 1 ));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float32 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
values,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float32 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_FLOAT,
|
||||
values,
|
||||
nelems ));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float64 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with float64 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_float64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_DOUBLE,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int32 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_INT32,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int32 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int32_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_INT32,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int64 \c values to
|
||||
the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5T_NATIVE_INT64,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Write an attribute \c name with int64 \c values to
|
||||
the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5WriteStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
const h5_int64_t *values, /*!< [in] Values of attribute */
|
||||
const h5_size_t nelems /*!< [in] Number of values */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', values=%p, nelems=%llu",
|
||||
f, name, values, (long long unsigned)nelems);
|
||||
H5_API_RETURN (h5_write_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5T_NATIVE_INT64,
|
||||
values,
|
||||
nelems));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*** READ ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read a string into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadFileAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'", f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read a string into a \c buffer from an attribute \c name
|
||||
in the current timestep.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadStepAttribString (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
char *buffer /*!< [out] Value of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', value='%s'",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_STRING_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int32 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadFileAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_INT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int32 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadStepAttribInt32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_INT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int64 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadFileAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_INT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read int64 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadStepAttribInt64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_int64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
h5_err_t h5err = h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_INT64_T,
|
||||
(void*)buffer);
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float32 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadFileAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_FLOAT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float32 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadStepAttribFloat32 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float32_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_FLOAT32_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float64 values into a \c buffer from an attribute \c name
|
||||
in the file root ("/").
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadFileAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Read float64 values into a \c buffer from an attribute \c name
|
||||
in the current time step.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5ReadStepAttribFloat64 (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const char *name, /*!< [in] Name of attribute to create */
|
||||
h5_float64_t *buffer /*!< [out] Values of attribute */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p",
|
||||
f, name, buffer);
|
||||
H5_API_RETURN (h5_read_attrib (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
name,
|
||||
H5_FLOAT64_T,
|
||||
(void*)buffer));
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
/*** QUERY ***/
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the number of attributes in the file's root ("/").
|
||||
|
||||
\return Number of attributes or error code.
|
||||
*/
|
||||
static inline h5_int64_t
|
||||
H5GetNumFileAttribs (
|
||||
h5_file_t *const f /*!< [in] Handle to open file */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_attribs (f, H5_ATTRIB_FILE));
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the number of attributes bound to the current step.
|
||||
|
||||
\h5_err_t h5err = Number of attributes or error code.
|
||||
*/
|
||||
static inline h5_int64_t
|
||||
H5GetNumStepAttribs (
|
||||
h5_file_t *const f /*!< [in] Handle to open file */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "f=%p", f);
|
||||
H5_API_RETURN (h5_get_num_attribs (f, H5_ATTRIB_STEP));
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the name, type and number of elements of the file attribute
|
||||
specified by its index.
|
||||
|
||||
This function can be used to retrieve all attributes bound to the
|
||||
file \c f by looping from \c 0 to the number of attribute minus
|
||||
one. The number of attributes bound to file \c f can be queried
|
||||
by calling \ref H5GetNumFileAttribs.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
|
||||
static inline h5_err_t
|
||||
H5GetFileAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_size_t attrib_idx, /*!< [in] Index of attribute to get
|
||||
@@ -173,9 +563,41 @@ H5GetFileAttribInfo (
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"attrib_idx=%llu, attrib_name=%p, len_attrib_name=%llu, "
|
||||
"attrib_type=%p, attrib_nelem=%p",
|
||||
f,
|
||||
(long long unsigned)attrib_idx,
|
||||
attrib_name,
|
||||
(long long unsigned)len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem);
|
||||
H5_API_RETURN (h5_get_attrib_info (
|
||||
f,
|
||||
H5_ATTRIB_FILE,
|
||||
attrib_idx,
|
||||
attrib_name,
|
||||
len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem));
|
||||
}
|
||||
|
||||
h5_int64_t
|
||||
/*!
|
||||
\ingroup h5hut_attrib
|
||||
|
||||
Gets the name, type and number of elements of the step attribute
|
||||
specified by its index.
|
||||
|
||||
This function can be used to retrieve all attributes bound to the
|
||||
current time-step by looping from \c 0 to the number of attribute
|
||||
minus one. The number of attributes bound to the current
|
||||
time-step can be queried by calling \ref H5GetNumStepAttribs.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5GetStepAttribInfo (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_size_t attrib_idx, /*!< [in] Index of attribute to
|
||||
@@ -185,7 +607,26 @@ H5GetStepAttribInfo (
|
||||
/*!< [in] length of buffer \c name */
|
||||
h5_int64_t *attrib_type, /*!< [out] Type of value. */
|
||||
h5_size_t *attrib_nelem /*!< [out] Number of elements */
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"f=%p, "
|
||||
"attrib_idx=%llu, attrib_name=%p, len_attrib_name=%llu, "
|
||||
"attrib_type=%p, attrib_nelem=%p",
|
||||
f,
|
||||
(unsigned long long)attrib_idx,
|
||||
attrib_name,
|
||||
(unsigned long long)len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem);
|
||||
H5_API_RETURN (h5_get_attrib_info (
|
||||
f,
|
||||
H5_ATTRIB_STEP,
|
||||
attrib_idx,
|
||||
attrib_name,
|
||||
len_of_attrib_name,
|
||||
attrib_type,
|
||||
attrib_nelem));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
SUBDIRS = h5core
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
otherincludedir = $(includedir)/h5core
|
||||
|
||||
otherinclude_HEADERS = \
|
||||
h5_attach.h \
|
||||
h5_attribs.h \
|
||||
h5_core.h \
|
||||
h5_errno.h \
|
||||
h5_errorhandling.h \
|
||||
h5_hdf5.h \
|
||||
h5_maps.h \
|
||||
h5_openclose.h \
|
||||
h5_readwrite.h \
|
||||
h5_syscall.h \
|
||||
h5_types.h \
|
||||
h5b_attribs.h \
|
||||
h5b_model.h \
|
||||
h5b_readwrite.h \
|
||||
h5t_adjacencies.h \
|
||||
h5t_core.h \
|
||||
h5t_inquiry.h \
|
||||
h5t_map.h \
|
||||
h5t_model.h \
|
||||
h5t_readwrite.h \
|
||||
h5t_ref_elements.h \
|
||||
h5t_retrieve.h \
|
||||
h5t_storemesh.h \
|
||||
h5t_tags.h \
|
||||
h5u_model.h \
|
||||
h5u_readwrite.h
|
||||
|
||||
EXTRA_HEADERS =
|
||||
|
||||
EXTRA_DIST =
|
||||
|
||||
clean-local:
|
||||
$(RM) *~
|
||||
$(RM) h5core/*~
|
||||
@@ -23,6 +23,10 @@ h5_close_file (
|
||||
h5_file_t * const f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5_close_hdf5 (
|
||||
void);
|
||||
|
||||
h5_err_t
|
||||
h5_flush_step (
|
||||
h5_file_t * const f
|
||||
@@ -89,23 +93,6 @@ h5_traverse_steps (
|
||||
h5_file_t * f /*!< file handle */
|
||||
);
|
||||
|
||||
char *
|
||||
h5_strdupfor2c (
|
||||
const char *s,
|
||||
const ssize_t len
|
||||
);
|
||||
|
||||
char *
|
||||
h5_strc2for (
|
||||
char * const str,
|
||||
const ssize_t l_str
|
||||
);
|
||||
|
||||
h5_file_t *
|
||||
h5_filehandlefor2c (
|
||||
const h5_int64_t *ptr
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -16,19 +16,21 @@ extern "C" {
|
||||
H5_O_RDWR: dataset may exist
|
||||
*/
|
||||
|
||||
#define H5_O_RDWR 0x001
|
||||
#define H5_O_RDONLY 0x002
|
||||
#define H5_O_WRONLY 0x004
|
||||
#define H5_O_APPEND 0x008
|
||||
#define H5_O_RDWR 0x00000001
|
||||
#define H5_O_RDONLY 0x00000002
|
||||
#define H5_O_WRONLY 0x00000004
|
||||
#define H5_O_APPEND 0x00000008
|
||||
|
||||
#define H5_VFD_MPIPOSIX 0x010
|
||||
#define H5_VFD_INDEPENDENT 0x020
|
||||
#define H5_VFD_MPIPOSIX 0x00000010
|
||||
#define H5_VFD_MPIIO_IND 0x00000020
|
||||
#define H5_VFD_INDEPENDENT H5_VFD_MPIIO_IND // obsolete(?)
|
||||
#define H5_VFD_CORE 0x00000040
|
||||
|
||||
#define H5_FLUSH_FILE 0x040
|
||||
#define H5_FLUSH_STEP 0x080
|
||||
#define H5_FLUSH_DATASET 0x100
|
||||
#define H5_FLUSH_FILE 0x00001000
|
||||
#define H5_FLUSH_STEP 0x00002000
|
||||
#define H5_FLUSH_DATASET 0x00004000
|
||||
|
||||
#define H5_FS_LUSTRE 0x200
|
||||
#define H5_FS_LUSTRE 0x00010000
|
||||
|
||||
#define H5_ID_T H5T_NATIVE_INT64
|
||||
#define H5_FLOAT64_T H5T_NATIVE_DOUBLE
|
||||
@@ -53,11 +55,16 @@ typedef int64_t h5_id_t;
|
||||
typedef int16_t h5t_lvl_idx_t;
|
||||
typedef h5_int32_t h5t_elem_flags_t;
|
||||
typedef int64_t h5_glb_idx_t; // type for a global index
|
||||
//typedef int64_t h5_loc_idx_t; // type for a local index
|
||||
typedef int32_t h5_loc_idx_t; // type for a local index
|
||||
|
||||
#if defined(USE_LARGE_INDICES)
|
||||
typedef int64_t h5_loc_idx_t; // type for a local index
|
||||
typedef int64_t h5_loc_id_t; // type for a local ID
|
||||
#else
|
||||
typedef int32_t h5_loc_idx_t; // type for a local index
|
||||
typedef int32_t h5_loc_id_t; // type for a local ID
|
||||
#endif
|
||||
|
||||
typedef int64_t h5_glb_id_t; // type for a global ID
|
||||
//typedef int64_t h5_loc_id_t; // type for a local ID
|
||||
typedef int32_t h5_loc_id_t; // type for a local ID
|
||||
typedef uint64_t h5_size_t; /* size in number of elements */
|
||||
typedef int64_t h5_ssize_t; /* size in number of elements */
|
||||
typedef int64_t h5_err_t;
|
||||
|
||||
+9
-19
@@ -1,16 +1,17 @@
|
||||
# test level Makefile.am
|
||||
|
||||
#SUBDIRS = H5Block H5Fed H5Part
|
||||
SUBDIRS = H5Fed
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/src/include
|
||||
AM_LDFLAGS += -L${abs_top_builddir}/src/lib
|
||||
|
||||
OBJEXT=o
|
||||
LDADD =
|
||||
LDADD += -lH5hut
|
||||
|
||||
AM_CPPFLAGS = -I../src/include @AM_CPPFLAGS@
|
||||
noinst_PROGRAMS =
|
||||
|
||||
noinst_PROGRAMS = @BUILD_TESTS@
|
||||
if ENABLE_C
|
||||
noinst_PROGRAMS += h5u_test h5b_test h5_attach_test
|
||||
|
||||
TESTS_ENVIRONMENT = env LD_LIBRARY_PATH=@HDF5ROOT@/lib:$(LD_LIBRARY_PATH)
|
||||
TESTS = @BUILD_TESTS@
|
||||
TESTS_ENVIRONMENT = env LD_LIBRARY_PATH=@HDF5_PREFIX@/lib:$(LD_LIBRARY_PATH)
|
||||
|
||||
EXTRA_PROGRAMS = h5u_test h5b_test h5_attach_test
|
||||
|
||||
@@ -22,10 +23,6 @@ h5u_test_SOURCES = \
|
||||
testframe.h \
|
||||
params.h
|
||||
|
||||
h5u_test_LDADD = \
|
||||
../src/C/libH5hutC.la \
|
||||
../src/h5core/libH5hut.la
|
||||
|
||||
h5b_test_SOURCES = \
|
||||
h5b_test.c \
|
||||
h5b_write.c \
|
||||
@@ -34,16 +31,9 @@ h5b_test_SOURCES = \
|
||||
testframe.h \
|
||||
params.h
|
||||
|
||||
h5b_test_LDADD = \
|
||||
../src/C/libH5hutC.la \
|
||||
../src/h5core/libH5hut.la
|
||||
|
||||
h5_attach_test_SOURCES = \
|
||||
h5_attach_test.c
|
||||
|
||||
h5_attach_test_LDADD = \
|
||||
../src/C/libH5hutC.la \
|
||||
../src/h5core/libH5hut.la
|
||||
endif
|
||||
|
||||
clean-local:
|
||||
${RM} -f *.h5
|
||||
|
||||
+9
-17
@@ -6,31 +6,23 @@ if ENABLE_VTKCONVERTER
|
||||
SUBDIRS += vtk2h5grid
|
||||
endif
|
||||
|
||||
AM_LDFLAGS = -L../src/lib @LDFLAGS@
|
||||
LIBS = -lH5hutC -lH5hut @LIBS@
|
||||
AM_CPPFLAGS += -I${abs_top_builddir}/src/include -Wno-deprecated
|
||||
FFLAGS += -cpp $(AM_CPPFLAGS)
|
||||
AM_LDFLAGS += -L${abs_top_builddir}/src/lib
|
||||
|
||||
AM_CPPFLAGS = -I../src/include @AM_CPPFLAGS@
|
||||
LDADD =
|
||||
LDADD += -lH5hut
|
||||
|
||||
# What to build... make install will place these files in the $(prefix)/bin directory.
|
||||
bin_PROGRAMS = @BUILD_TOOLS@
|
||||
EXTRA_PROGRAMS = h5pAttrib h5PartDcToVtk h5PartSurfaceToVtk
|
||||
if ENABLE_C
|
||||
EXTRA_SCRIPTS = # h5hutcc
|
||||
EXTRA_PROGRAMS = h5pAttrib
|
||||
endif
|
||||
|
||||
# Listing of all programs that maybe built. (Has to know statically...)
|
||||
EXTRA_SCRIPTS = h5hutcc
|
||||
|
||||
# Extra files that I wish to include in the dist tar ball.
|
||||
#EXTRA_DIST = h5pAttrib.cc h5pToGNUplot.cc## TO BE TAILORED LATER...
|
||||
|
||||
# Listing of sources
|
||||
h5pAttrib_SOURCES = h5pAttrib.cc
|
||||
|
||||
#h5pToGNUplot_SOURCES = h5pToGNUplot.cc
|
||||
|
||||
#homdynToH5p_SOURCES = homdynToH5p.cc
|
||||
|
||||
h5PartDcToVtk_SOURCES = h5PartDcToVtk.cc
|
||||
|
||||
h5PartSurfaceToVtk_SOURCES = h5PartSurfaceToVtk.cc
|
||||
|
||||
clean: clean-am
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
AM_CPPFLAGS = -I${abs_top_builddir}/src/include -Wno-deprecated
|
||||
AM_CPPFLAGS = -I${abs_top_srcdir}/src/include -Wno-deprecated
|
||||
FFLAGS += -cpp $(AM_CPPFLAGS)
|
||||
LDFLAGS += -L${abs_top_builddir}/src/lib
|
||||
|
||||
LDADD =
|
||||
|
||||
LDADD += -lH5hut -lH5hutC -lvtkCommon -lvtkIO
|
||||
LDADD += -lH5hut -lvtkIO -lvtkFiltering -lvtkCommon -lvtksys
|
||||
|
||||
|
||||
bin_PROGRAMS =
|
||||
|
||||
Reference in New Issue
Block a user