mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
[svn-r2576] Purpose:
Adding the Fortran interface to the HDF5 library Description: Fortran is now a subdirectory of the HDF5 library tree. Platforms tested: Solaris and IRIX (O2K)
This commit is contained in:
parent
8272da0b67
commit
8055378bce
fortran
Makefile.distMakefile.inacconfig.haclocal.m4acsite.m4
bin
config.h.inconfig
BlankFormcommence.inconclude.indec-flagsdec-osf4.xdependdepend1.independ2.independ3.independ4.independN.infreebsdgnu-flagshpux10.20hpux11.00hpux9.03i386-pc-cygwin32intel-osf1irix5.xirix6.xlinux-gnulinux-gnulibc1linux-gnulibc2powerpc-ibm-aix4.2.1.0powerpc-ibm-aix4.3.2.0powerpc-ibm-aix4.xrs6000-ibm-aix4.xsolaris2.xunicosunicosmk
configureconfigure.inexamples
DependenciesMakefile.inattrexample.f90compound.f90dsetexample.f90fileexample.f90groupexample.f90grpdsetexample.f90grpit.f90grpsexample.f90hyperslab.f90mountexample.f90refobjexample.f90refregexample.f90run_examples.shrwdsetexample.f90selectele.f90
libtoolsrc
DependenciesH5Af.cH5Aff.f90H5Df.cH5Dff.f90H5Ef.cH5Eff.f90H5Ff.cH5Fff.f90H5Gf.cH5Gff.f90H5Git.cH5Git.hH5If.cH5Iff.f90H5Pf.cH5Pf_parallel.cH5Pff.f90H5Pff_parallel.f90H5Rf.cH5Rff.f90H5Sf.cH5Sff.f90H5Tf.cH5Tff.f90H5f90.hH5f90global.f90H5f90i.hH5f90kit.cH5f90misc.cH5f90miscf.f90H5f90proto.hH5fortran_flags.f90H5fortran_types.f90.inHDF5.f90HDF5_parallel.f90Makefile.inREADME
test
24
fortran/Makefile.dist
Normal file
24
fortran/Makefile.dist
Normal file
@ -0,0 +1,24 @@
|
||||
# Top-level distributed Makefile -*- makefile -*-
|
||||
|
||||
# This Makefile is a stub (copied from Makefile.dist) which will run
|
||||
# configure and then invoke the same target in the new Makefile created
|
||||
# by configure.
|
||||
|
||||
# Uncomment this variable if your make(1) doesn't set it automatically.
|
||||
#
|
||||
#MAKE=make
|
||||
|
||||
|
||||
SHELL=/bin/sh
|
||||
|
||||
all lib progs check test _test install uninstall dep depend: _config
|
||||
$(MAKE) $@
|
||||
|
||||
clean mostlyclean distclean maintainer-clean TAGS: _config
|
||||
$(MAKE) $@
|
||||
|
||||
_config:
|
||||
sh configure
|
||||
|
||||
.PHONY: all lib progs test install uninstall dep depend clean mostlyclean \
|
||||
distclean maintainer-clean _config
|
111
fortran/Makefile.in
Normal file
111
fortran/Makefile.in
Normal file
@ -0,0 +1,111 @@
|
||||
## Top-level HDF5-Fortran Makefile(.in)
|
||||
##
|
||||
## Copyright (C) 2000 National Center for Supercomputing Applications.
|
||||
## All rights reserved.
|
||||
##
|
||||
##
|
||||
## This makefile mostly just reinvokes make in the various subdirectories
|
||||
## but does so in the correct order. You can alternatively invoke make from
|
||||
## each subdirectory manually.
|
||||
##
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=..
|
||||
srcdir=@srcdir@
|
||||
|
||||
@COMMENCE@
|
||||
|
||||
# Subdirectories in build-order (not including `examples')
|
||||
SUBDIRS=src test
|
||||
|
||||
##############################################################################
|
||||
## T A R G E T S
|
||||
##
|
||||
## all: Build libraries, header files, tests, and programs in the
|
||||
## various subdirectories but does not run tests or install the
|
||||
## library, header files, or programs. The components can be
|
||||
## built individually with the targets lib, progs, and tests.
|
||||
##
|
||||
## check: Test the uninstalled library to make sure it works. You may
|
||||
## also say `test' or `_test' (`test' doesn't work from the top
|
||||
## level directory for some versions of make because `test' is
|
||||
## also a directory).
|
||||
##
|
||||
## install: Installs libraries, header files, programs, and documentation
|
||||
## in the various directories under the prefix directory (lib,
|
||||
## include, bin, man, info). Use the `--prefix=PATH' option
|
||||
## to `configure' (or `config.status') or say `--help' for
|
||||
## other alternatives. The default prefix is `/usr/local'.
|
||||
##
|
||||
## uninstall: Delete all the installed files that the `install' target
|
||||
## created (but not the noninstalled files such as `make all'
|
||||
## created).
|
||||
##
|
||||
## clean: Removes temporary files except those that record the
|
||||
## configuration and those that are part of the distribution.
|
||||
##
|
||||
## mostlyclean: Like `clean' except it doesn't delete a few files like
|
||||
## libraries, programs, and/or generated header files because
|
||||
## regenerating them is rarely necessary and takes a lot of time.
|
||||
##
|
||||
## distclean: Deletes all files that are created by configuring or building
|
||||
## HDF5. If you have unpacked the source and built HDF5 without
|
||||
## creating any other files, then `make distclean' will leave
|
||||
## only the files that were in the distrubution.
|
||||
##
|
||||
## maintainer-clean:
|
||||
## Like `distclean' except it deletes more files. It deletes
|
||||
## all generated files. This target is not intended for normal
|
||||
## users; it deletes files that may require special tools to
|
||||
## rebuild.
|
||||
##
|
||||
## TAGS: Updates the tags table for this program.
|
||||
##
|
||||
## dep depend: Builds dependencies in all subdirectories. These targets
|
||||
## might not be available on certain combinations of make
|
||||
## programs and C compilers. At the other extreme, the GNU
|
||||
## make used in combination with gcc will maintain dependency
|
||||
## information automatically.
|
||||
lib progs check test _test uninstall:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@) || exit 1; \
|
||||
done
|
||||
|
||||
tests TAGS dep depend:
|
||||
@@SETX@; for d in $(SUBDIRS) examples; do \
|
||||
(cd $$d && $(MAKE) $@) || exit 1; \
|
||||
done
|
||||
|
||||
install:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@) || exit 1; \
|
||||
done
|
||||
@$(LT) --mode=finish $(libdir);
|
||||
|
||||
.PHONY: all lib progs test _test install uninstall dep depend clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
clean mostlyclean:
|
||||
@@SETX@; for d in $(SUBDIRS) examples; do \
|
||||
(cd $$d && $(MAKE) $@); \
|
||||
done
|
||||
-$(RM) conftest conftest.c
|
||||
|
||||
distclean:
|
||||
@@SETX@; for d in $(SUBDIRS) examples; do \
|
||||
(cd $$d && $(MAKE) $@); \
|
||||
done
|
||||
-$(RM) config/commence config/conclude
|
||||
-$(RM) config/stamp1 config/stamp2 config/depend?
|
||||
-$(RM) config.cache config.log config.status
|
||||
-$(RM) src/H5config.h src/H5pubconf.h
|
||||
-$(RM) libtool Makefile
|
||||
|
||||
maintainer-clean:
|
||||
@echo "This target is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@@SETX@; for d in $(SUBDIRS) examples; do \
|
||||
(cd $$d && $(MAKE) $@); \
|
||||
done
|
||||
-$(RM) config.cache config.log config.status src/H5config.h
|
||||
-$(RM) configure src/H5config.h.in
|
||||
|
53
fortran/acconfig.h
Normal file
53
fortran/acconfig.h
Normal file
@ -0,0 +1,53 @@
|
||||
/* Define if the __attribute__(()) extension is present */
|
||||
#undef HAVE_ATTRIBUTE
|
||||
|
||||
/* Define if the compiler understands the __FUNCTION__ keyword. */
|
||||
#undef HAVE_FUNCTION
|
||||
|
||||
/* Define if we have parallel support */
|
||||
#undef HAVE_PARALLEL
|
||||
|
||||
/* Define if we have thread safe support */
|
||||
#undef HAVE_THREADSAFE
|
||||
|
||||
/* Define if it's safe to use `long long' for hsize_t and hssize_t */
|
||||
#undef HAVE_LARGE_HSIZET
|
||||
|
||||
/* Width for printf() for type `long long' or `__int64', us. `ll' */
|
||||
#undef PRINTF_LL_WIDTH
|
||||
|
||||
/* Define if `tm_gmtoff' is a member of `struct tm' */
|
||||
#undef HAVE_TM_GMTOFF
|
||||
|
||||
/* Define if `__tm_gmtoff' is a member of `struct tm' */
|
||||
#undef HAVE___TM_GMTOFF
|
||||
|
||||
/* Define if `timezone' is a global variable */
|
||||
#undef HAVE_TIMEZONE
|
||||
|
||||
/* Define if `struct timezone' is defined */
|
||||
#undef HAVE_STRUCT_TIMEZONE
|
||||
|
||||
/* Define if `struct stat' has the `st_blocks' field */
|
||||
#undef HAVE_STAT_ST_BLOCKS
|
||||
|
||||
/* Define if `struct text_info' is defined */
|
||||
#undef HAVE_STRUCT_TEXT_INFO
|
||||
|
||||
/* Define if `struct videoconfig' is defined */
|
||||
#undef HAVE_STRUCT_VIDEOCONFIG
|
||||
|
||||
/* Define if the ioctl TIOCGETD is defined */
|
||||
#undef HAVE_TIOCGETD
|
||||
|
||||
/* Define if the ioctl TIOCGWINSZ is defined */
|
||||
#undef HAVE_TIOCGWINSZ
|
||||
|
||||
/* Define if the Globus GASS is defined */
|
||||
#undef HAVE_GASS
|
||||
|
||||
/* Define if the SRB is defined */
|
||||
#undef HAVE_SRB
|
||||
|
||||
/* Define if the Grid Storage is defined */
|
||||
#undef HAVE_GRIDSTORAGE
|
434
fortran/aclocal.m4
vendored
Normal file
434
fortran/aclocal.m4
vendored
Normal file
@ -0,0 +1,434 @@
|
||||
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
|
||||
## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
|
||||
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but
|
||||
## WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## As a special exception to the GNU General Public License, if you
|
||||
## distribute this file as part of a program that contains a
|
||||
## configuration script generated by Autoconf, you may include it under
|
||||
## the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# serial 40 AC_PROG_LIBTOOL
|
||||
AC_DEFUN(AC_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
||||
|
||||
# Save cache, so that ltconfig can load it
|
||||
AC_CACHE_SAVE
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
||||
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Reload cache, that may have been modified by ltconfig
|
||||
AC_CACHE_LOAD
|
||||
|
||||
# This can be used to rebuild libtool when needed
|
||||
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)dnl
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LIBTOOL_SETUP,
|
||||
[AC_PREREQ(2.13)dnl
|
||||
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_LD])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
|
||||
case "$target" in
|
||||
NONE) lt_target="$host" ;;
|
||||
*) lt_target="$target" ;;
|
||||
esac
|
||||
|
||||
# Check for any special flags to pass to ltconfig.
|
||||
libtool_flags="--cache-file=$cache_file"
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
case "$lt_target" in
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
case "`/usr/bin/file conftest.o`" in
|
||||
*32-bit*)
|
||||
LD="${LD-ld} -32"
|
||||
;;
|
||||
*N32*)
|
||||
LD="${LD-ld} -n32"
|
||||
;;
|
||||
*64-bit*)
|
||||
LD="${LD-ld} -64"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
*-*-sco3.2v5*)
|
||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
||||
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
||||
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
||||
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
;;
|
||||
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[*-*-cygwin* | *-*-mingw*)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
])
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
||||
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
||||
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(shared,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_SHARED(no)])
|
||||
|
||||
# AC_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
||||
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(static,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_STATIC(no)])
|
||||
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
||||
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
||||
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(fast-install,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
||||
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_FAST_INSTALL(no)])
|
||||
|
||||
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AC_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
changequote(,)dnl
|
||||
[\\/]* | [A-Za-z]:[\\/]*)
|
||||
re_direlt='/[^/][^/]*/\.\./'
|
||||
changequote([,])dnl
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$ac_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_PROG_LD_GNU
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
ac_cv_prog_gnu_ld=yes
|
||||
else
|
||||
ac_cv_prog_gnu_ld=no
|
||||
fi])
|
||||
])
|
||||
|
||||
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AC_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[if test -n "$NM"; then
|
||||
# Let the user override the test.
|
||||
ac_cv_path_NM="$NM"
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
break
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
break
|
||||
else
|
||||
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
||||
continue # so that we can try to find one that supports BSD flags
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
fi])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
])
|
||||
|
||||
# AC_CHECK_LIBM - check for math library
|
||||
AC_DEFUN(AC_CHECK_LIBM,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
LIBM=
|
||||
case "$lt_target" in
|
||||
*-*-beos* | *-*-cygwin*)
|
||||
# These system don't have libm
|
||||
;;
|
||||
*-ncr-sysv4.3*)
|
||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
||||
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(m, main, LIBM="-lm")
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl convenience library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-convenience to the
|
||||
# configure arguments. Note that LIBLTDL and INCLTDL are not
|
||||
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
||||
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
||||
# with '${top_builddir}/' and INCLTDL will be prefixed with
|
||||
# '${top_srcdir}/' (note the single quotes!). If your package is not
|
||||
# flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
case "$enable_ltdl_convenience" in
|
||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
||||
"") enable_ltdl_convenience=yes
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl installable library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-install to the configure
|
||||
# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
||||
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
||||
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
||||
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
||||
# with '${top_srcdir}/' (note the single quotes!). If your package is
|
||||
# not flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_CHECK_LIB(ltdl, main,
|
||||
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
||||
[if test x"$enable_ltdl_install" = xno; then
|
||||
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
||||
else
|
||||
enable_ltdl_install=yes
|
||||
fi
|
||||
])
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
else
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
INCLTDL=
|
||||
fi
|
||||
])
|
||||
|
||||
dnl old names
|
||||
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
||||
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
|
||||
dnl This is just to silence aclocal about the macro not being used
|
||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
377
fortran/acsite.m4
Normal file
377
fortran/acsite.m4
Normal file
@ -0,0 +1,377 @@
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl
|
||||
dnl Macros for HDF5 Fortran
|
||||
dnl
|
||||
dnl Copyright (C) 2000 National Center for Supercomputing Applications.
|
||||
dnl All rights reserved.
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_PROG_F9X
|
||||
dnl
|
||||
dnl Check for a Fortran 9X compiler.
|
||||
dnl
|
||||
AC_DEFUN(AC_PROG_F9X,
|
||||
[AC_CHECK_PROGS(F9X, f90 pgf90 f95 g95)
|
||||
test -z "$CC" && AC_MSG_ERROR([no acceptable f9X compiler found in \$PATH])
|
||||
|
||||
AC_PROG_F9X_WORKS
|
||||
AC_PROG_F9X_GNU
|
||||
|
||||
if test $ac_cv_prog_g9x = yes; then
|
||||
G9X=yes
|
||||
dnl Check whether -g works, even if FFLAGS is set, in case the package
|
||||
dnl plays around with FFLAGS (such as to build both debugging and
|
||||
dnl normal versions of a library), tasteless as that idea is.
|
||||
ac_test_FFLAGS="${FFLAGS+set}"
|
||||
ac_save_FFLAGS="$FFLAGS"
|
||||
FFLAGS=
|
||||
AC_PROG_F9X_G
|
||||
if test "$ac_test_FFLAGS" = set; then
|
||||
FFLAGS="$ac_save_FFLAGS"
|
||||
elif test $ac_cv_prog_f9x_g = yes; then
|
||||
FFLAGS="-g -O2"
|
||||
else
|
||||
FFLAGS="-O2"
|
||||
fi
|
||||
else
|
||||
G9X=
|
||||
test "${FFLAGS+set}" = set || FFLAGS="-g"
|
||||
fi
|
||||
])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_TRY_F9X_COMPILER()
|
||||
dnl
|
||||
dnl It would be nice if the compiler actually works.
|
||||
dnl
|
||||
AC_DEFUN(AC_TRY_F9X_COMPILER, [
|
||||
cat > conftest.$ac_ext << EOF
|
||||
[$1]
|
||||
EOF
|
||||
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
||||
[$2]=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
[$3]=no
|
||||
else
|
||||
[$3]=yes
|
||||
fi
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.$ac_ext >&AC_FD_CC
|
||||
[$2]=no
|
||||
fi
|
||||
rm -fr conftest*
|
||||
])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_LANG_F9X_WORKS()
|
||||
dnl
|
||||
dnl It would be nice if the compiler actually works.
|
||||
dnl
|
||||
AC_DEFUN(AC_PROG_F9X_WORKS, [
|
||||
AC_MSG_CHECKING([whether the Fortran 9X compiler ($F9X $FFLAGS $LDFLAGS) works])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_FORTRAN9X
|
||||
AC_TRY_F9X_COMPILER([
|
||||
program conftest
|
||||
end
|
||||
], ac_cv_prog_f9x_works, ac_cv_prog_f9x_cross)
|
||||
AC_LANG_RESTORE
|
||||
AC_MSG_RESULT($ac_cv_prog_f9x_works)
|
||||
if test $ac_cv_prog_f9x_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: Fortran 9X compiler cannot create executables.])
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the Fortran 9X compiler ($F9X $FFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_f9x_cross)
|
||||
cross_compiling=$ac_cv_prog_f9x_cross
|
||||
])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_LANG_FORTRAN9X()
|
||||
dnl
|
||||
dnl Generic macro to setup the Fortran 9X specific env variables.
|
||||
dnl
|
||||
AC_DEFUN(AC_LANG_FORTRAN9X, [
|
||||
define([AC_LANG], [FORTRAN9X])
|
||||
ac_ext=f90
|
||||
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&AC_FD_CC'
|
||||
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
|
||||
cross_compiling=$ac_cv_prog_f9x_cross
|
||||
])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_PROG_F9X_GNU
|
||||
dnl
|
||||
dnl Test whether for Fortran 9X compiler is `g95' (the GNU Fortran 95
|
||||
dnl Compiler). This test depends on whether the Fortran 9X compiler
|
||||
dnl can do CPP pre-processing.
|
||||
dnl
|
||||
AC_DEFUN(AC_PROG_F9X_GNU,
|
||||
[AC_CACHE_CHECK(whether we are using GNU Fortran 95, ac_cv_prog_g9x,
|
||||
[cat > conftest.fpp <<EOF
|
||||
#ifdef __GNUC__
|
||||
yes
|
||||
#endif
|
||||
EOF
|
||||
if AC_TRY_COMMAND($F9X -E conftest.fpp) | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_g9x=yes
|
||||
else
|
||||
ac_cv_prog_g9x=no
|
||||
fi])])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_PROG_F9X_G
|
||||
dnl
|
||||
dnl Test whether the Fortran 9X compiler can accept the `-g' option
|
||||
dnl to enable debugging.
|
||||
dnl
|
||||
AC_DEFUN(AC_PROG_F9X_G,
|
||||
[AC_CACHE_CHECK(whether $F9X accepts -g, ac_cv_prog_f9x_g,
|
||||
[cat > conftest.f << EOF
|
||||
program conftest
|
||||
end
|
||||
EOF
|
||||
if test -z "`$F9X -g -c conftest.f 2>&1`"; then
|
||||
ac_cv_prog_f9x_g=yes
|
||||
else
|
||||
ac_cv_prog_f9x_g=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
])])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_F9X_OPT_FLAGS()
|
||||
dnl
|
||||
dnl Check for optimizer flags the Fortran compiler can use.
|
||||
dnl
|
||||
AC_DEFUN(AC_F9X_OPT_FLAGS,
|
||||
[AC_MSG_CHECKING([for $F9X optimizer flags])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_FORTRAN9X
|
||||
|
||||
for flags in "-fast" "-O3" "-O" "";do
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
program main
|
||||
end
|
||||
EOF
|
||||
ac_compile='${F9X-f90} -c $flag $FFLAGS conftest.$ac_ext 1>&AC_FD_CC'
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
if grep 'passed to ld' conftest.out > /dev/null 2>&1; then :; else
|
||||
FFLAGS="$FFLAGS $flags"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if test -n "$flags"; then
|
||||
echo "$flags" 1>&6
|
||||
else
|
||||
echo "none" 1>&6
|
||||
fi
|
||||
rm -f conftest*])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_F9X_MODS()
|
||||
dnl
|
||||
dnl Check how F9X handles modules. This macro also checks which
|
||||
dnl command-line option to use to include the module once it's built.
|
||||
dnl
|
||||
AC_DEFUN(AC_F9X_MODS,
|
||||
[AC_MSG_CHECKING(what $F9X does with modules)
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_FORTRAN9X
|
||||
|
||||
test -d conftestdir || mkdir conftestdir
|
||||
cd conftestdir
|
||||
rm -rf *
|
||||
|
||||
cat >conftest.$ac_ext <<EOF
|
||||
module module
|
||||
integer foo
|
||||
end module module
|
||||
EOF
|
||||
|
||||
eval $ac_compile
|
||||
modfiles=""
|
||||
|
||||
for f in conftest.o module.mod MODULE.mod; do
|
||||
test -f $f && modfiles="$f"
|
||||
done
|
||||
|
||||
echo $modfiles 6>&1
|
||||
if test "$modfiles" = file.o; then
|
||||
echo $ac_n "checking whether $F9X -em is saner""... $ac_c" 1>&6
|
||||
OLD_FFLAGS=$FFLAGS
|
||||
FFLAGS="$FFLAGS -em"
|
||||
eval $ac_compile
|
||||
modfiles=""
|
||||
for f in file.o module.mod MODULE.mod; do
|
||||
test -f $f && modfiles="$f"
|
||||
done
|
||||
if test "$modfiles" = file.o;then
|
||||
FFLAGS=$OLD_FFLAGS
|
||||
echo no 6>&1
|
||||
else
|
||||
echo yes 6>&1
|
||||
fi
|
||||
fi
|
||||
cd ..
|
||||
|
||||
AC_MSG_CHECKING(how $F9X finds modules)
|
||||
|
||||
for flag in "-p" "-M" "-I"; do
|
||||
cat >conftest.$ac_ext <<EOF
|
||||
program conftest
|
||||
use module
|
||||
end program conftest
|
||||
EOF
|
||||
|
||||
ac_compile='${F9X-f90} $FFLAGS ${flag}conftestdir -c conftest.$ac_ext 1>&AC_FD_CC'
|
||||
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
F9XMODFLAG=$flag
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test -n "$F9XMODFLAG"; then
|
||||
echo $F9XMODFLAG 1>&6
|
||||
else
|
||||
echo unknown 1>&6
|
||||
fi
|
||||
AC_SUBST(F9XMODFLAG)
|
||||
rm -rf conftest*])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl
|
||||
dnl Possible future tests for the Fortran stuff...
|
||||
dnl
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl
|
||||
dnl echo $ac_n "checking whether f90 real type has 12 digits of precision""... $ac_c" 1>&6
|
||||
dnl cat >conftest.f90 <<'EOF'
|
||||
dnl program conftest
|
||||
dnl if (selected_real_kind(12) .eq. kind(0.0)) then
|
||||
dnl print '(a)','YES'
|
||||
dnl else
|
||||
dnl print '(a)','NO'
|
||||
dnl end if
|
||||
dnl end program conftest
|
||||
dnl EOF
|
||||
dnl $ac_cv_prog_F90 $FFLAGS -o conftest conftest.f90 > /dev/null 2>&1
|
||||
dnl if test "`./conftest | head -1`" = YES; then
|
||||
dnl echo "yes" 1>&6
|
||||
dnl AC_DEFINE(HIPREC)
|
||||
dnl else
|
||||
dnl echo "no" 1>&6
|
||||
dnl fi
|
||||
|
||||
dnl echo $ac_n "checking whether f90 precision of default real type""... $ac_c" 1>&6
|
||||
dnl cat >conftest.f90 <<'EOF'
|
||||
dnl program conftest
|
||||
dnl if (kind(0.0) .eq. selected_real_kind(12) .or.&
|
||||
dnl &kind(0.0) .eq. selected_real_kind(6) ) then
|
||||
dnl print '(a)','YES'
|
||||
dnl else
|
||||
dnl print '(a)','NO'
|
||||
dnl end if
|
||||
dnl end program conftest
|
||||
dnl EOF
|
||||
dnl $ac_cv_prog_F90 $FFLAGS -o conftest conftest.f90 > /dev/null 2>&1
|
||||
dnl if test "`./conftest | head -1`" = YES; then
|
||||
dnl echo "OK" 1>&6
|
||||
dnl AC_DEFINE(REALOK)
|
||||
dnl else
|
||||
dnl echo "no" 1>&6
|
||||
dnl fi
|
||||
|
||||
dnl echo $ac_n "checking accuracy of arithmetic""... $ac_c" 1>&6
|
||||
dnl cat >conftest.f90 <<'EOF'
|
||||
dnl program conftest
|
||||
dnl integer, parameter :: double=selected_real_kind(12)
|
||||
dnl real(double), parameter :: ulp=2.0_double**(-47)
|
||||
dnl real(double), parameter :: ans=0.92699498904359955986_double
|
||||
dnl real(double) :: x,y,z
|
||||
dnl integer i
|
||||
dnl x=0.0_double
|
||||
dnl y=ulp
|
||||
dnl do i=2,100
|
||||
dnl z=x+y
|
||||
dnl x=y
|
||||
dnl y=z-int(z)
|
||||
dnl end do
|
||||
dnl if (y-ans .lt. ulp/2.0_double) then
|
||||
dnl print '(a)','YES'
|
||||
dnl else
|
||||
dnl print '(a)','NO'
|
||||
dnl end if
|
||||
dnl end program conftest
|
||||
dnl EOF
|
||||
dnl $ac_cv_prog_F90 $FFLAGS -o conftest conftest.f90 > /dev/null 2>&1
|
||||
dnl if test "`./conftest | head -1`" = YES; then
|
||||
dnl echo "OK" 1>&6
|
||||
dnl AC_DEFINE(ARITHOK)
|
||||
dnl else
|
||||
dnl echo "no" 1>&6
|
||||
dnl fi
|
||||
|
||||
dnl echo $ac_n "checking whether int is the fastest way to truncate""... $ac_c" 1>&6
|
||||
dnl cat >conftest.f90 <<'EOF'
|
||||
dnl program conftest
|
||||
dnl integer, parameter :: double=selected_real_kind(12)
|
||||
dnl real(double), parameter :: ulp=2.0_double**(-47)
|
||||
dnl real(double) :: x,y,z,ya,yb
|
||||
dnl integer :: t0,t1,i,timea,timeb
|
||||
dnl
|
||||
dnl x=0.0_double
|
||||
dnl y=ulp
|
||||
dnl call system_clock(t0)
|
||||
dnl do i=2,1000000
|
||||
dnl z=x+y
|
||||
dnl x=y
|
||||
dnl y=z-int(z)
|
||||
dnl end do
|
||||
dnl ya=y
|
||||
dnl call system_clock(t1)
|
||||
dnl timea=t1-t0
|
||||
dnl
|
||||
dnl x=0.0_double
|
||||
dnl y=ulp
|
||||
dnl call system_clock(t0)
|
||||
dnl do i=2,1000000
|
||||
dnl z=x+y
|
||||
dnl x=y
|
||||
dnl if (z.ge.1.0_double) then
|
||||
dnl y=z-1.0_double
|
||||
dnl else
|
||||
dnl y=z
|
||||
dnl end if
|
||||
dnl end do
|
||||
dnl yb=y
|
||||
dnl call system_clock(t1)
|
||||
dnl timeb=t1-t0
|
||||
dnl
|
||||
dnl if (timea.lt.timeb) then
|
||||
dnl print '(a)','YES'
|
||||
dnl else
|
||||
dnl print '(a)','NO'
|
||||
dnl end if
|
||||
dnl print *,ya,yb
|
||||
dnl end program conftest
|
||||
dnl EOF
|
||||
dnl $ac_cv_prog_F90 $FFLAGS -o conftest conftest.f90 > /dev/null 2>&1
|
||||
dnl if test "`./conftest | head -1`" = YES; then
|
||||
dnl echo "yes" 1>&6
|
||||
dnl AC_DEFINE(USEINT)
|
||||
dnl else
|
||||
dnl echo "no" 1>&6
|
||||
dnl fi
|
||||
dnl
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl -------------------------------------------------------------------------
|
1183
fortran/bin/config.guess
vendored
Executable file
1183
fortran/bin/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
1272
fortran/bin/config.sub
vendored
Executable file
1272
fortran/bin/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
251
fortran/bin/install-sh
Executable file
251
fortran/bin/install-sh
Executable file
@ -0,0 +1,251 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
3114
fortran/bin/ltconfig
Executable file
3114
fortran/bin/ltconfig
Executable file
File diff suppressed because it is too large
Load Diff
4024
fortran/bin/ltmain.sh
Normal file
4024
fortran/bin/ltmain.sh
Normal file
File diff suppressed because it is too large
Load Diff
19
fortran/config.h.in
Normal file
19
fortran/config.h.in
Normal file
@ -0,0 +1,19 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if we have parallel support */
|
||||
#undef HAVE_PARALLEL
|
||||
|
||||
/* Define if you have the <zlib.h> header file. */
|
||||
#undef HAVE_ZLIB_H
|
||||
|
||||
/* Define if you have the mpi library (-lmpi). */
|
||||
#undef HAVE_LIBMPI
|
||||
|
||||
/* Define if you have the mpich library (-lmpich). */
|
||||
#undef HAVE_LIBMPICH
|
||||
|
||||
/* Define if you have the mpio library (-lmpio). */
|
||||
#undef HAVE_LIBMPIO
|
||||
|
||||
/* Define if you have the z library (-lz). */
|
||||
#undef HAVE_LIBZ
|
126
fortran/config/BlankForm
Normal file
126
fortran/config/BlankForm
Normal file
@ -0,0 +1,126 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Choosing a C Compiler
|
||||
# ---------------------
|
||||
#
|
||||
# The user should be able to specify the compiler by setting the CC
|
||||
# environment variable to the name of the compiler and any switches it
|
||||
# requires for proper operation. If CC is unset then this script may
|
||||
# set it. If CC is unset by time this script completes then configure
|
||||
# will try `gcc' and `cc' in that order (perhaps some others too).
|
||||
#
|
||||
# Note: Code later in this file may depend on the value of $CC_BASENAME
|
||||
# in order to distinguish between different compilers when
|
||||
# deciding which compiler command-line switches to use. This
|
||||
# variable is set based on the incoming value of $CC and is only
|
||||
# used within this file.
|
||||
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC="/some/default/compiler/named/foo -ansi"
|
||||
CC_BASENAME=foo
|
||||
fi
|
||||
|
||||
|
||||
# C Compiler and Preprocessor Flags
|
||||
# ---------------------------------
|
||||
#
|
||||
# Flags that end with `_CFLAGS' are always passed to the compiler.
|
||||
# Flags that end with `_CPPFLAGS' are passed to the compiler when
|
||||
# compiling but not when linking.
|
||||
#
|
||||
# DEBUG_CFLAGS Flags to pass to the compiler to create a
|
||||
# DEBUG_CPPFLAGS library suitable for use with debugging
|
||||
# tools. Usually this list will exclude
|
||||
# optimization switches (like `-O') and include
|
||||
# switches that turn on symbolic debugging
|
||||
# support (like `-g').
|
||||
#
|
||||
# PROD_CFLAGS Flags to pass to the compiler to create a
|
||||
# PROD_CPPFLAGS production version of the library. These
|
||||
# usualy exclude symbolic debugging switches
|
||||
# (like `-g') and include optimization switches
|
||||
# (like `-O').
|
||||
#
|
||||
# PROFILE_CFLAGS Flags to pass to the compiler to create a
|
||||
# PROFILE_CPPFLAGS library suitable for performance testing (like
|
||||
# `-pg'). This may or may not include debugging
|
||||
# or production flags.
|
||||
#
|
||||
# CFLAGS Flags can be added to this variable which
|
||||
# might already be partially initialized. These
|
||||
# flags will always be passed to the compiler
|
||||
# and should include switches to turn on full
|
||||
# warnings. HDF5 attempts to be ANSI and Posix
|
||||
# compliant and employ good programming
|
||||
# practices resulting in few if any
|
||||
# warnings.
|
||||
#
|
||||
# Warning flags do not have to be added to CFLAGS
|
||||
# variable if the compiler is the GNU gcc
|
||||
# compiler or a descendent of gcc such as EGCS or PGCC.
|
||||
#
|
||||
# The CFLAGS should contains *something* or else
|
||||
# configure will probably add `-g'. For most
|
||||
# systems this isn't a problem but some systems
|
||||
# will disable optimizations in favor of the
|
||||
# `-g'.
|
||||
#
|
||||
#
|
||||
# These flags should be set according to the compiler being used.
|
||||
# There are two ways to check the compiler. You can try using `-v' or
|
||||
# `--version' to see if the compiler will print a version string. You
|
||||
# can use the value of $CC_BASENAME which is the base name of the
|
||||
# first word in $CC (note that the value of CC may have changed
|
||||
# above).
|
||||
|
||||
case $CC_BASENAME in
|
||||
gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O3 -fomit-frame-pointer"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
CFLAGS="$CFLAGS -ansi"
|
||||
DEBUG_CFLAGS="-g"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# Overriding Configure Tests
|
||||
# --------------------------
|
||||
#
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
||||
# Set this to the width required by printf() to print type `long
|
||||
# long'. For instance, if the format would be `%lld' then set it to
|
||||
# `ll' or if the format would be `%qd' set it to `q'.
|
||||
#hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
|
160
fortran/config/commence.in
Normal file
160
fortran/config/commence.in
Normal file
@ -0,0 +1,160 @@
|
||||
##------------------------------------------------------------ -*- makefile -*-
|
||||
## The following section of this makefile comes from the
|
||||
## `./config/commence' file which was generated with config.status
|
||||
## from `./config/commence.in'.
|
||||
##-----------------------------------------------------------------------------
|
||||
|
||||
## Things that Make needs
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .f90 .o .lo
|
||||
@SET_MAKE@
|
||||
|
||||
## Directories to search
|
||||
@SEARCH@
|
||||
|
||||
## Programs
|
||||
SHELL=/bin/sh
|
||||
CC=@CC@
|
||||
F9X=@F9X@
|
||||
CFLAGS=@CFLAGS@
|
||||
CPPFLAGS=@CPPFLAGS@
|
||||
FFLAGS=@FFLAGS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
ROOT=@ROOT@
|
||||
LIBS=@LIBS@
|
||||
AR=@AR@
|
||||
RANLIB=@RANLIB@
|
||||
RM=rm -f
|
||||
CP=cp
|
||||
INSTALL=@INSTALL@
|
||||
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
||||
INSTALL_DATA=@INSTALL_DATA@
|
||||
PARALLEL=@PARALLEL@
|
||||
RUNSERIAL=@RUNSERIAL@
|
||||
RUNPARALLEL=@RUNPARALLEL@
|
||||
RUNTEST=$(RUNSERIAL)
|
||||
TRACE=:
|
||||
|
||||
## Installation points
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
docdir=@exec_prefix@/doc
|
||||
PUB_LIB=$(LIB)
|
||||
|
||||
## Shared libraries
|
||||
DYNAMIC_DIRS=@DYNAMIC_DIRS@
|
||||
LT=$(top_builddir)/libtool
|
||||
LT_CCOMPILE=$(LT) --mode=compile $(CC)
|
||||
LT_LINK_CLIB=$(LT) --mode=link $(CC) -rpath $(libdir)
|
||||
LT_LINK_CEXE=$(LT) --mode=link $(CC) $(DYNAMIC_DIRS) -rpath $(bindir)
|
||||
LT_RUN=$(LT) --mode=execute
|
||||
LT_INSTALL_PROG=$(LT) --mode=install $(INSTALL_PROGRAM)
|
||||
LT_INSTALL_LIB=$(LT) --mode=install $(INSTALL_DATA)
|
||||
LT_UNINSTALL=$(LT) --mode=uninstall $(RM)
|
||||
|
||||
# Fortran compilation/linking stuff
|
||||
LT_FCOMPILE=$(LT) --mode=compile $(F9X)
|
||||
LT_LINK_FLIB=$(LT) --mode=link $(F9X) -static $(DYNAMIC_DIRS)
|
||||
LT_LINK_FEXE=$(LT) --mode=link $(F9X) -static $(DYNAMIC_DIRS)
|
||||
|
||||
## Optional variables. We must declare them here because Irix pmake
|
||||
## complains if it sees a reference to a variable which has never been
|
||||
## defined. The main makefile is free to redefine these to something else.
|
||||
DOCDIR=$(docdir)
|
||||
LIB=
|
||||
LIB_SRC=
|
||||
LIB_OBJ=
|
||||
PUB_HDR=
|
||||
PUB_PROGS=
|
||||
PROGS=
|
||||
TEST_PROGS=
|
||||
TEST_FLAGS=
|
||||
TEST_SCRIPTS=
|
||||
|
||||
## The default is to build the library and/or programs. We must build
|
||||
## them sequentially.
|
||||
all:
|
||||
$(MAKE) lib
|
||||
$(MAKE) progs
|
||||
$(MAKE) tests
|
||||
|
||||
## The following rules insure that the Makefile is up-to-date by rerunning
|
||||
## various autoconf components (although not all versions of make assume
|
||||
## that the makefile is implicitly a target). We use time stamp files to
|
||||
## keep track of the most recent update of H5config.h.in and H5config.h
|
||||
## because autoheader and config.status don't update the modification time
|
||||
## if the contents don't change.
|
||||
## Invoke it by "gmake reconfigure".
|
||||
##
|
||||
## Graphically, the dependencies are:
|
||||
##
|
||||
## configure.in
|
||||
## | |
|
||||
## +-----------------+ +------------+
|
||||
## | |
|
||||
## stamp1 configure
|
||||
## (H5config.h.in) |
|
||||
## | | |
|
||||
## | +---------------+ +-----------+
|
||||
## | | |
|
||||
## | config.status
|
||||
## | |
|
||||
## | +------------------+
|
||||
## | |
|
||||
## stamp2
|
||||
## (H5config.h) Makefile.in et al
|
||||
## | |
|
||||
## +------------------+ +-----------+
|
||||
## | |
|
||||
## Makefile
|
||||
##
|
||||
## A side effect of updating stamp1 is to generate H5config.h.in and a
|
||||
## side effect of updating stamp2 is to generate H5config.h. When using
|
||||
## a version of make that doesn't treat the makefile as the initial target
|
||||
## the user may want to occassionally type `make Makefile' in any source
|
||||
## directory.
|
||||
## The `Makefile' target has been renamed to `reconfigure' so that the
|
||||
## autoconf and make depend processes do not start up automatically.
|
||||
## One must do `make reconfigure' explicitedly to start the process.
|
||||
## (When srcdir is used and if more than one machines are running,
|
||||
## this automatic Makefile/autoconf can get things unstable.)
|
||||
##
|
||||
STAMP1=$(top_builddir)/config/stamp1
|
||||
STAMP2=$(top_builddir)/config/stamp2
|
||||
|
||||
MAKEFILE_PARTS=$(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/config/commence.in \
|
||||
$(top_srcdir)/config/conclude.in \
|
||||
$(top_srcdir)/config/depend1.in \
|
||||
$(top_srcdir)/config/depend2.in \
|
||||
$(top_srcdir)/config/depend3.in \
|
||||
$(top_srcdir)/config/depend4.in \
|
||||
$(top_srcdir)/config/dependN.in
|
||||
|
||||
$(STAMP1): $(top_srcdir)/configure.in
|
||||
touch $(STAMP1)
|
||||
-cd $(top_srcdir); autoheader
|
||||
|
||||
$(STAMP2): $(STAMP1) $(top_builddir)/config.status
|
||||
touch $(STAMP2)
|
||||
-cd $(top_builddir); \
|
||||
CONFIG_FILES= CONFIG_HEADERS=src/H5config.h ./config.status
|
||||
|
||||
$(top_srcdir)/configure: $(top_srcdir)/configure.in
|
||||
-cd $(top_srcdir); autoconf
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(STAMP1)
|
||||
-cd $(top_builddir); ./config.status --recheck
|
||||
|
||||
# rerun the autoconf process if any configure components have changed.
|
||||
reconfigure: $(MAKEFILE_PARTS) $(STAMP2)
|
||||
-cd $(top_builddir); CONFIG_HEADERS= ./config.status
|
||||
|
||||
##-----------------------------------------------------------------------------
|
||||
## The following section of this makefile comes from the middle of
|
||||
## `Makefile.in' from this directory. It was generated by running
|
||||
## `config.status'.
|
||||
##-----------------------------------------------------------------------------
|
185
fortran/config/conclude.in
Normal file
185
fortran/config/conclude.in
Normal file
@ -0,0 +1,185 @@
|
||||
##------------------------------------------------------------ -*- makefile -*-
|
||||
## The following section of this makefile comes from the
|
||||
## `./config/conclude' file which was generated with config.status
|
||||
## from `./config/conclude.in'.
|
||||
##-----------------------------------------------------------------------------
|
||||
|
||||
## This is the target for the library described in the main body of the
|
||||
## makefile.
|
||||
##
|
||||
lib: $(LIB)
|
||||
$(LIB) __no_library__: $(LIB_OBJ)
|
||||
@$(LT_LINK_FLIB) -o $@ $(FFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
|
||||
|
||||
progs: $(LIB) $(PROGS)
|
||||
|
||||
## Build a tags file in this directory.
|
||||
TAGS: $(LIB_SRC)
|
||||
$(RM) $@
|
||||
-etags $(LIB_SRC)
|
||||
|
||||
## Runs each test in order, passing $(TEST_FLAGS) to the program.
|
||||
tests: $(TEST_PROGS) $(LIB)
|
||||
check test _test: tests
|
||||
@for test in $(TEST_PROGS) dummy; do \
|
||||
if test $$test != dummy; then \
|
||||
echo "============================"; \
|
||||
echo "Testing $$test $(TEST_FLAGS)"; \
|
||||
echo "============================"; \
|
||||
PATH=".:$$PATH" srcdir=$(srcdir) \
|
||||
$(RUNTEST) $$test $(TEST_FLAGS) || \
|
||||
exit 1; \
|
||||
echo ""; \
|
||||
fi; \
|
||||
done;
|
||||
@for test in $(TEST_SCRIPTS) dummy; do \
|
||||
if test $$test != dummy; then \
|
||||
echo "============================"; \
|
||||
echo "Testing $$test $(TEST_FLAGS)"; \
|
||||
echo "============================"; \
|
||||
RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
|
||||
srcdir=$(srcdir) \
|
||||
/bin/sh $$test $(TEST_FLAGS) || \
|
||||
exit 1; \
|
||||
echo ""; \
|
||||
fi; \
|
||||
done;
|
||||
|
||||
## Make installation directories directories if they don't exist.
|
||||
$(libdir):
|
||||
mkdir $@ && chmod 755 $@
|
||||
|
||||
$(includedir):
|
||||
mkdir $@ && chmod 755 $@
|
||||
|
||||
$(bindir):
|
||||
mkdir $@ && chmod 755 $@
|
||||
|
||||
$(DOCDIR):
|
||||
mkdir $@ && chmod 755 $@
|
||||
|
||||
## Install the library, the public header files, and public programs.
|
||||
install: $(PUB_LIB) $(PUB_HDR) $(PUB_PROGS) $(libdir) $(includedir) $(bindir)
|
||||
@for f in X $(PUB_LIB); do \
|
||||
if test $$f != X; then \
|
||||
($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
|
||||
fi; \
|
||||
done
|
||||
@if test -f libhdf5.settings; then \
|
||||
(set -x; $(INSTALL_DATA) libhdf5.settings $(libdir)/. || exit 1); \
|
||||
fi
|
||||
@for f in X $(PUB_HDR); do \
|
||||
if test $$f != X; then \
|
||||
if test -f $$f; then \
|
||||
(set -x; $(INSTALL_DATA) $$f $(includedir)/. || exit 1); \
|
||||
else \
|
||||
(set -x; $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/. || \
|
||||
exit 1); \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
@for f in X $(PUB_PROGS); do \
|
||||
if test $$f != X; then \
|
||||
($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
|
||||
fi; \
|
||||
done
|
||||
|
||||
## Install the documents.
|
||||
install-doc: $(PUB_DOCS) $(DOCDIR)
|
||||
@for d in X $(SUBDIRS); do \
|
||||
if test $$d != X; then \
|
||||
(set -x; cd $$d && $(MAKE) $@) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@for f in X $(PUB_DOCS); do \
|
||||
if test $$f != X; then \
|
||||
if test -f $$f; then \
|
||||
(set -x; $(INSTALL_DATA) $$f $(DOCDIR)/. || exit 1); \
|
||||
else \
|
||||
(set -x; $(INSTALL_DATA) $(srcdir)/$$f $(DOCDIR)/. || \
|
||||
exit 1); \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
## Removes those things that `make install' (would have) installed.
|
||||
uninstall:
|
||||
@for f in libhdf5.settings $(LIB); do \
|
||||
$(LT_UNINSTALL) $(libdir)/$$f; \
|
||||
done
|
||||
@if test "X$(PUB_HDR)" != X; then \
|
||||
set -x; cd $(includedir) && $(RM) $(PUB_HDR); \
|
||||
fi
|
||||
@for f in X $(PUB_PROGS); do \
|
||||
if test $$f != X; then \
|
||||
$(LT_UNINSTALL) $(bindir)/$$f; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
## Removes those things that `make install-doc' (would have) installed.
|
||||
uninstall-doc:
|
||||
@for d in X $(SUBDIRS); do \
|
||||
if test $$d != X; then \
|
||||
(set -x; cd $$d && $(MAKE) $@) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@if test "X$(PUB_DOCS)" != X; then \
|
||||
set -x; cd $(DOCDIR) && $(RM) $(PUB_DOCS); \
|
||||
fi
|
||||
|
||||
## Removes temporary files without removing the final target files. That is,
|
||||
## remove things like object files but not libraries or executables.
|
||||
##
|
||||
mostlyclean:
|
||||
-$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
|
||||
-$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
|
||||
-$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
|
||||
|
||||
## Like `mostlyclean' except it also removes the final targets: things like
|
||||
## libraries and executables. This target doesn't remove any file that
|
||||
## is part of the HDF5 distribution.
|
||||
##
|
||||
clean: mostlyclean
|
||||
-$(RM) $(LIB) $(TEST_PROGS) $(PROGS) $(CLEAN)
|
||||
-$(RM) *.M *.a *.mod
|
||||
-$(RM) -r .libs
|
||||
|
||||
## Like `clean' except it also removes files that were created by running
|
||||
## configure. If you've unpacked the source and built HDF5 without creating
|
||||
## any other files, then `make distclean' will leave only the files that were
|
||||
## in the distribution.
|
||||
##
|
||||
distclean: clean
|
||||
-$(RM) .depend TAGS *~ core *.core *.bak *.old *.new $(DISTCLEAN)
|
||||
@if test -f $(srcdir)/Makefile.in; then \
|
||||
(set -x; $(RM) Makefile); \
|
||||
fi
|
||||
|
||||
|
||||
## Like `distclean' except it deletes all files that can be regenerated from
|
||||
## the makefile, including those generated from autoheader and autoconf.
|
||||
##
|
||||
maintainer-clean: distclean
|
||||
-$(RM) *~ core core.* *.core *.bak *.contrib gmon.out
|
||||
|
||||
## Implicit rules
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
||||
|
||||
.c.lo:
|
||||
@$(LT_CCOMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
|
||||
|
||||
.f90.o:
|
||||
$(F9X) $(FFLAGS) -c $<
|
||||
|
||||
.f90.lo:
|
||||
@$(LT_FCOMPILE) $(FFLAGS) -c $<
|
||||
|
||||
##-----------------------------------------------------------------------------
|
||||
## The following section of this makefile contains dependencies between the
|
||||
## source files and the header files.
|
||||
##-----------------------------------------------------------------------------
|
||||
.PHONY: dep depend
|
||||
dep depend: Dependencies
|
||||
|
||||
@DEPEND@
|
92
fortran/config/dec-flags
Normal file
92
fortran/config/dec-flags
Normal file
@ -0,0 +1,92 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file should be sourced into configure if the compiler is a DEC
|
||||
# compiler. It is careful not to do anything if the compiler is not
|
||||
# DEC; otherwise `cc_flags_set' is set to `yes'
|
||||
#
|
||||
|
||||
# Get the compiler version unless it's already known.
|
||||
#
|
||||
# cc_vendor: The compiler vendor: DEC
|
||||
# cc_version: Version number, like: V5.2-038
|
||||
#
|
||||
if test X = "X$cc_flags_set"; then
|
||||
cc_vendor=DEC
|
||||
cc_version="`$CC $CFLAGS -V 2>&1 |head -1 |\
|
||||
sed 's/.*DEC C \(V[0-9][-\.0-9]*\).*/\1/'`"
|
||||
if test X != "$gcc_version"; then
|
||||
echo "compiler '$CC' is $cc_vendor-$cc_version"
|
||||
else
|
||||
cc_vendor=
|
||||
fi
|
||||
fi
|
||||
|
||||
# Warn about old compilers that don't work right.
|
||||
case "$cc_vendor-$cc_version" in
|
||||
DEC-V5.2-038)
|
||||
cat <<EOF
|
||||
**
|
||||
** This compiler may generate incorrect code when optimizations are
|
||||
** enabled. Please upgrade to a newer version (we're not sure which
|
||||
** version actually works) before reporting bugs to the HDF5 team.
|
||||
**
|
||||
EOF
|
||||
sleep 5
|
||||
;;
|
||||
esac
|
||||
|
||||
# Compiler flags
|
||||
case "$cc_vendor-$cc_version" in
|
||||
DEC-V5.*)
|
||||
# Production
|
||||
PROD_CFLAGS="-g0 -verbose -warnprotos -std -O4 $ARCH -ansi_args -fp_reorder -readonly_strings -inline speed"
|
||||
PROD_CPPFLAGS="-D_INTRINSICS -D_INLINE_INTRINSICS"
|
||||
|
||||
# Debug
|
||||
DEBUG_CFLAGS="-g -std -verbose -warnprotos"
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Profile
|
||||
PROFILE_CFLAGS="-pg -std -verbose -warnprotos"
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Flags are set
|
||||
cc_flags_set=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
# If no flags were set then clear the compiler vendor and version info.
|
||||
if test X = "X$cc_flags_set"; then
|
||||
cc_vendor=
|
||||
cc_version=
|
||||
fi
|
||||
|
||||
# The default Fortran 90 compiler
|
||||
|
||||
#
|
||||
# HDF5 integers
|
||||
#
|
||||
# R_LARGE is the number of digits for the bigest integer supported.
|
||||
# R_INTEGER is the number of digits in INTEGER
|
||||
#
|
||||
# (for the Digital UNIX architechture)
|
||||
#
|
||||
R_LARGE=18
|
||||
R_INTEGER=9
|
||||
HSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HSSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HID_T='SELECTED_INT_KIND(R_INTEGER)'
|
||||
SIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
OBJECT_NAMELEN_DEFAULT_F=-1
|
||||
|
||||
if test "X-" = "X-$F9X"; then
|
||||
F9X=f90
|
||||
fi
|
||||
|
||||
if test "X-" = "X-$f9x_flags_set"; then
|
||||
FFLAGS="-Olimit 2048 -std1"
|
||||
DEBUG_FFLAGS="-Olimit 2048 -std1"
|
||||
PROD_FFLAGS="-Olimit 2048 -std1"
|
||||
PROFILE_FFLAGS="-Olimit 2048 -std1"
|
||||
f9x_flags_set=yes
|
||||
fi
|
20
fortran/config/dec-osf4.x
Normal file
20
fortran/config/dec-osf4.x
Normal file
@ -0,0 +1,20 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for detailed information.
|
||||
|
||||
# The default compiler is `cc'
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
|
||||
# Try GNU compiler flags.
|
||||
. $srcdir/config/gnu-flags
|
||||
|
||||
# Try native DEC compiler
|
||||
ARCH=${ARCH:='-arch host -tune host'}
|
||||
. $srcdir/config/dec-flags
|
0
fortran/config/depend
Normal file
0
fortran/config/depend
Normal file
60
fortran/config/depend1.in
Normal file
60
fortran/config/depend1.in
Normal file
@ -0,0 +1,60 @@
|
||||
## -*- makefile -*-
|
||||
|
||||
## We keep a list of dependencies in `.depend' for each of the source
|
||||
## files on which it depends. When one of the source files is modified
|
||||
## we remove its record from .depend and regenerate its dependencies,
|
||||
## tacking them onto the end of .depend. By including the .depend file
|
||||
## into the makefile, we're telling make that the makefile depends on
|
||||
## the dependency list in the .depend file.
|
||||
##
|
||||
## This is as fast as the `.d' method described in the GNU make manual
|
||||
## for automatic dependencies, but has the added advantage that all
|
||||
## dependencies are stored in one place. The advantage over the
|
||||
## `makedepend' program is that only those files that are out of date
|
||||
## have dependency information rebuilt, and the Makefile is not
|
||||
## modified.
|
||||
##
|
||||
## This is also where tracing information is updated. The $(TRACE)
|
||||
## program is run on each source file to make sure that the H5TRACE()
|
||||
## macros are up to date. If they are then the file is not modified,
|
||||
## otherwise the file is changed and a backup is saved by appending a
|
||||
## tilde to the file name.
|
||||
##
|
||||
.PRECIOUS: Dependencies
|
||||
Dependencies: .depend
|
||||
@if test "$(srcdir)" != "."; then \
|
||||
echo '## This file is machine generated on GNU systems.' \
|
||||
>$@; \
|
||||
echo '## Only temporary changes may be made here.' \
|
||||
>>$@; \
|
||||
echo >>$@; \
|
||||
perl -p $(top_srcdir)/bin/distdep .depend >>$@; \
|
||||
fi
|
||||
|
||||
.PRECIOUS: .depend
|
||||
.depend: $(LIB_SRC) $(TEST_SRC) $(PROG_SRC)
|
||||
@touch .depend
|
||||
@for dep in $? dummy; do \
|
||||
if [ $$dep != "dummy" ]; then \
|
||||
echo Building dependencies for $$dep; \
|
||||
obj=`basename $$dep .c`.lo; \
|
||||
sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
|
||||
$(TRACE) $$dep; \
|
||||
$(CC) -M -MG $(CPPFLAGS) $$dep 2>/dev/null | \
|
||||
sed 's% $(srcdir)/% $$(srcdir)/%g' | \
|
||||
sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
|
||||
sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
|
||||
sed 's/\.o/.lo/' >>$@; \
|
||||
fi; \
|
||||
done;
|
||||
@if test "$(srcdir)" != "."; then \
|
||||
echo '## This file is machine generated on GNU systems.' \
|
||||
>Dependencies; \
|
||||
echo '## Only temporary changes may be made here.' \
|
||||
>>Dependencies; \
|
||||
echo >>Dependencies; \
|
||||
perl -p $(top_srcdir)/bin/distdep .depend>>Dependencies;\
|
||||
fi
|
||||
|
||||
-include .depend
|
||||
|
11
fortran/config/depend2.in
Normal file
11
fortran/config/depend2.in
Normal file
@ -0,0 +1,11 @@
|
||||
## -*- makefile -*-
|
||||
|
||||
## This platform doesn't support automatic dependencies because we're
|
||||
## not using GNU gcc. GNU gcc is needed in order to generate the list
|
||||
## of header files included by a source file.
|
||||
|
||||
## Since automatic dependencies are not being used, we attempt to include the
|
||||
## `.distdep' file from the source tree. This file was automatically generated
|
||||
## on some system that satisfies the above requirements.
|
||||
|
||||
-include Dependencies
|
7
fortran/config/depend3.in
Normal file
7
fortran/config/depend3.in
Normal file
@ -0,0 +1,7 @@
|
||||
## -*- makefile -*-
|
||||
|
||||
## Since automatic dependencies are not being used, we attempt to include the
|
||||
## `.distdep' file from the source tree. This file was automatically generated
|
||||
## on some system that satisfies the above requirements.
|
||||
|
||||
.include <Dependencies>
|
7
fortran/config/depend4.in
Normal file
7
fortran/config/depend4.in
Normal file
@ -0,0 +1,7 @@
|
||||
## -*- makefile -*-
|
||||
|
||||
## Since automatic dependencies are not being used, we attempt to include the
|
||||
## `.distdep' file from the source tree. This file was automatically generated
|
||||
## on some system that satisfies the above requirements.
|
||||
|
||||
include Dependencies
|
4
fortran/config/dependN.in
Normal file
4
fortran/config/dependN.in
Normal file
@ -0,0 +1,4 @@
|
||||
## -*- makefile -*-
|
||||
|
||||
## Automatic dependencies are not being used and we cannot include other
|
||||
## files.
|
21
fortran/config/freebsd
Normal file
21
fortran/config/freebsd
Normal file
@ -0,0 +1,21 @@
|
||||
# -*- shell-script -*-
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# The default compiler is `gcc'
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=gcc
|
||||
CC_BASENAME=gcc
|
||||
fi
|
||||
|
||||
# Architecture-specific flags
|
||||
ARCH=
|
||||
|
||||
# Omit frame pointer for optimized code?
|
||||
NOFP=${NOFP:=-fomit-frame-pointer}
|
||||
|
||||
# Figure out compiler flags
|
||||
. $srcdir/config/gnu-flags
|
227
fortran/config/gnu-flags
Normal file
227
fortran/config/gnu-flags
Normal file
@ -0,0 +1,227 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file should be sourced into configure if the compiler is the
|
||||
# GNU gcc compiler or a derivative. It is careful not to do anything
|
||||
# if the compiler is not GNU; otherwise `cc_flags_set' is set to `yes'
|
||||
#
|
||||
|
||||
# Get the compiler version in a way that works for gcc, egcs, and
|
||||
# pgcc unless a compiler version is already known
|
||||
#
|
||||
# cc_vendor: The compiler name: gcc, egcs, or pgcc
|
||||
# cc_version: Version number: 2.91.60, 2.7.2.1
|
||||
#
|
||||
if test X = "X$cc_flags_set"; then
|
||||
cc_version="`$CC $CFLAGS -v 2>&1 |grep 'gcc version' |\
|
||||
sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
|
||||
cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'`
|
||||
cc_version=`echo $cc_version |sed 's/[-a-z]//g'`
|
||||
if test X = "X$cc_vendor" -a X != "X$cc_version"; then
|
||||
cc_vendor=gcc
|
||||
fi
|
||||
if test "-" != "$cc_vendor-$cc_version"; then
|
||||
echo "compiler '$CC' is GNU $cc_vendor-$cc_version"
|
||||
fi
|
||||
|
||||
# Some version numbers
|
||||
cc_vers_major=`echo $cc_version | cut -f1 -d.`
|
||||
cc_vers_minor=`echo $cc_version | cut -f2 -d.`
|
||||
cc_vers_patch=`echo $cc_version | cut -f3 -d.`
|
||||
test -n "$cc_vers_major" || cc_vers_major=0
|
||||
test -n "$cc_vers_minor" || cc_vers_minor=0
|
||||
test -n "$cc_vers_patch" || cc_vers_patch=0
|
||||
cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`
|
||||
fi
|
||||
|
||||
# GCC compilers before gcc-2.8.1 have problems with `long long'.
|
||||
if test gcc = $cc_vendor -a $cc_vers_all -lt 2008001; then
|
||||
cat <<EOF
|
||||
**
|
||||
** This compiler may be unable to properly compile the long long
|
||||
** data type used extensively by hdf5, although specifying
|
||||
** --disable-hsizet for configure may work around those bugs.
|
||||
** There may be other code generation problems also, especially
|
||||
** when optimizations are enabled. Please upgrade to at least GNU
|
||||
** gcc version 2.8.1 before reporting bugs to the HDF5 team.
|
||||
**
|
||||
EOF
|
||||
sleep 5
|
||||
|
||||
# Current EGCS compilers have problems with `long long' and register
|
||||
# allocation when optimizations are turned on for x86 systems.
|
||||
elif test egcs = $cc_vendor -a $cc_vers_all -le 2091066; then
|
||||
cat <<EOF
|
||||
**
|
||||
** This compiler may have problems allocating registers when
|
||||
** optimizations are enabled on some platforms. Specifying
|
||||
** --disable-hsizet usually avoids the bug.
|
||||
**
|
||||
EOF
|
||||
sleep 5
|
||||
|
||||
# All current versions of PGCC have problems also.
|
||||
elif test pgcc = $cc_vendor -a $cc_vers_all -le 2091066; then
|
||||
cat <<EOF
|
||||
**
|
||||
** This compiler may have problems allocating registers for long
|
||||
** long data types when optimizations are enabled. There may be
|
||||
** other code generation problems as well. We know of no version
|
||||
** of pgcc which is capable of compiling HDF5 in production mode.
|
||||
** Please use gcc-2.8 or egcs-1.1.1 before reporting bugs.
|
||||
**
|
||||
EOF
|
||||
sleep 5
|
||||
|
||||
fi
|
||||
|
||||
# Architecture-specific flags
|
||||
case "$host_os-$host_cpu" in
|
||||
# FreeBSD sets the information from "hostname -m" to the general machine
|
||||
# architecture, not the specific CPU for the machine, so even our
|
||||
# Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD
|
||||
# machine, use the "sysctl" command to get the CPU hardware model.
|
||||
freebsd*)
|
||||
host_cpu_model=`sysctl -n hw.model`
|
||||
case "$host_cpu_model" in
|
||||
# Hmm.. this might not catch Celerons, but it won't hurt them either...
|
||||
*Pro*|*II*)
|
||||
# This check should be kept in sync with the *-i686 check below
|
||||
case "$cc_vendor-$cc_version" in
|
||||
gcc-2.95*)
|
||||
ARCH=${ARCH:="-march=i686 -malign-double"}
|
||||
;;
|
||||
gcc-*|egcs-*|pgcc-*)
|
||||
ARCH=${ARCH:="-mcpu=pentiumpro -march=pentiumpro -malign-double"}
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
*-i686)
|
||||
case "$cc_vendor-$cc_version" in
|
||||
gcc-2.95*)
|
||||
ARCH=${ARCH:="-march=i686 -malign-double"}
|
||||
;;
|
||||
gcc-*|egcs-*|pgcc-*)
|
||||
ARCH=${ARCH:="-mcpu=pentiumpro -march=pentiumpro -malign-double"}
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
# Host-specific flags
|
||||
case "`hostname`" in
|
||||
hawkwind.ncsa.uiuc.edu)
|
||||
ARCH="$ARCH -pipe"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Compiler flags
|
||||
case "$cc_vendor-$cc_version" in
|
||||
gcc-2.7*)
|
||||
# General
|
||||
CFLAGS="$CFLAGS $ARCH -ansi"
|
||||
|
||||
# Production
|
||||
PROC_CFLAGS="-O3 $NOFP -finline-functions -Wno-shadow"
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Debug
|
||||
DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow"
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Profile
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Flags are set
|
||||
cc_flags_set=yes
|
||||
;;
|
||||
|
||||
gcc-2.8.*)
|
||||
# General
|
||||
CFLAGS="$CFLAGS $ARCH -Wsign-compare"
|
||||
|
||||
# Production
|
||||
PROD_CFLAGS="-O3 $NOFP -finline-functions -fschedule-insns2 -Wno-shadow"
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Debug
|
||||
DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow"
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Profile
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Flags are set
|
||||
cc_flags_set=yes
|
||||
;;
|
||||
|
||||
gcc-2.95*)
|
||||
# General
|
||||
CFLAGS="$CFLAGS $ARCH -Wsign-compare"
|
||||
|
||||
# Production
|
||||
PROD_CFLAGS="-O6 $NOFP -Wno-shadow"
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Debug
|
||||
DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow"
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Profile
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Flags are set
|
||||
cc_flags_set=yes
|
||||
;;
|
||||
|
||||
egcs-2.*|pgcc-2.*)
|
||||
# General
|
||||
CFLAGS="$CFLAGS $ARCH -Wsign-compare"
|
||||
|
||||
# Production
|
||||
PROD_CFLAGS="-O6 $NOFP -Wno-shadow"
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Debug
|
||||
DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow"
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Profile
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Flags are set
|
||||
cc_flags_set=yes
|
||||
;;
|
||||
|
||||
gcc-*|egcs-*|pgcc-*)
|
||||
# This must be some other GNU compiler that we don't know about.
|
||||
# Just use fairly generic flags.
|
||||
|
||||
# Production
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Debug
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Profile
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Flags are set
|
||||
cc_flags_set=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
# Clear cc info if no flags set
|
||||
if test X = "X$cc_flags_set"; then
|
||||
cc_vendor=
|
||||
cc_version=
|
||||
fi
|
36
fortran/config/hpux10.20
Normal file
36
fortran/config/hpux10.20
Normal file
@ -0,0 +1,36 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# Default compiler is `cc'
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
|
||||
# Flags
|
||||
case "X-$CC" in
|
||||
X-gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O3"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
CFLAGS="$CFLAGS -Ae"
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS="-Ae"
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS="-Ae"
|
||||
PROFILE_CFLAGS=
|
||||
PROFILE_CPPFLAGS="-Ae"
|
||||
;;
|
||||
esac
|
36
fortran/config/hpux11.00
Normal file
36
fortran/config/hpux11.00
Normal file
@ -0,0 +1,36 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# Default compiler is `cc'
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
|
||||
# Flags
|
||||
case "X-$CC" in
|
||||
X-gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O3"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
CFLAGS="$CFLAGS -Ae"
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS="-Ae"
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS="-Ae"
|
||||
PROFILE_CFLAGS=
|
||||
PROFILE_CPPFLAGS="-Ae"
|
||||
;;
|
||||
esac
|
36
fortran/config/hpux9.03
Normal file
36
fortran/config/hpux9.03
Normal file
@ -0,0 +1,36 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details
|
||||
|
||||
# Default compiler is `cc'
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
|
||||
# Flags
|
||||
case "X-$CC" in
|
||||
X-gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O3"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
CFLAGS="$CFLAGS -Ae"
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS=
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS=
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
20
fortran/config/i386-pc-cygwin32
Normal file
20
fortran/config/i386-pc-cygwin32
Normal file
@ -0,0 +1,20 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# The default compiler is `gcc'.
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=gcc
|
||||
CC_BASENAME=gcc
|
||||
LD=ld
|
||||
fi
|
||||
|
||||
# Omit frame pointer for optimized code?
|
||||
NOFP=${NOFP:=-fomit-frame-pointer}
|
||||
|
||||
# Figure out compiler flags
|
||||
. $srcdir/config/gnu-flags
|
83
fortran/config/intel-osf1
Normal file
83
fortran/config/intel-osf1
Normal file
@ -0,0 +1,83 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# This is for the ASCI RED TFLOPS machine
|
||||
|
||||
# The default compiler is `cicc'
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cicc
|
||||
CC_BASENAME=cicc
|
||||
fi
|
||||
|
||||
# The default archiver is `xar'
|
||||
AR=${AR:-xar}
|
||||
|
||||
# There is no ranlib
|
||||
RANLIB=:
|
||||
|
||||
# Additional libraries
|
||||
LDFLAGS="$LDFLAGS -lnoop_stubs"
|
||||
|
||||
# How to run serial and parallel test programs
|
||||
RUNSERIAL="yod -sz 1"
|
||||
RUNPARALLEL="yod -sz 8"
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Turn off shared lib option. It does not work for TFLOPS yet.
|
||||
enable_shared="${enable_shared:-no}"
|
||||
|
||||
# Set this to the width required by printf() to print type `long
|
||||
# long'. For instance, if the format would be `%lld' then set it to
|
||||
# `ll' or if the format would be `%qd' set it to `q'.
|
||||
hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
|
||||
|
||||
# Hard set sizeof_intN_t to 0 because they are not supported.
|
||||
ac_cv_sizeof_int8_t=${ac_cv_sizeof_int8_t='0'}
|
||||
ac_cv_sizeof_int16_t=${ac_cv_sizeof_int16_t='0'}
|
||||
ac_cv_sizeof_int32_t=${ac_cv_sizeof_int32_t='0'}
|
||||
ac_cv_sizeof_int64_t=${ac_cv_sizeof_int64_t='0'}
|
||||
ac_cv_sizeof_uint8_t=${ac_cv_sizeof_uint8_t='0'}
|
||||
ac_cv_sizeof_uint16_t=${ac_cv_sizeof_uint16_t='0'}
|
||||
ac_cv_sizeof_uint32_t=${ac_cv_sizeof_uint32_t='0'}
|
||||
ac_cv_sizeof_uint64_t=${ac_cv_sizeof_uint64_t='0'}
|
||||
|
||||
# Hard set sizeof_int_leastN_t to 0 because they are not supported.
|
||||
ac_cv_sizeof_int_least8_t=${ac_cv_sizeof_int_least8_t='0'}
|
||||
ac_cv_sizeof_int_least16_t=${ac_cv_sizeof_int_least16_t='0'}
|
||||
ac_cv_sizeof_int_least32_t=${ac_cv_sizeof_int_least32_t='0'}
|
||||
ac_cv_sizeof_int_least64_t=${ac_cv_sizeof_int_least64_t='0'}
|
||||
ac_cv_sizeof_uint_least8_t=${ac_cv_sizeof_uint_least8_t='0'}
|
||||
ac_cv_sizeof_uint_least16_t=${ac_cv_sizeof_uint_least16_t='0'}
|
||||
ac_cv_sizeof_uint_least32_t=${ac_cv_sizeof_uint_least32_t='0'}
|
||||
ac_cv_sizeof_uint_least64_t=${ac_cv_sizeof_uint_least64_t='0'}
|
||||
|
||||
# Hard set sizeof_int_fastN_t to 0 because they are not supported.
|
||||
ac_cv_sizeof_int_fast8_t=${ac_cv_sizeof_int_fast8_t='0'}
|
||||
ac_cv_sizeof_int_fast16_t=${ac_cv_sizeof_int_fast16_t='0'}
|
||||
ac_cv_sizeof_int_fast32_t=${ac_cv_sizeof_int_fast32_t='0'}
|
||||
ac_cv_sizeof_int_fast64_t=${ac_cv_sizeof_int_fast64_t='0'}
|
||||
ac_cv_sizeof_uint_fast8_t=${ac_cv_sizeof_uint_fast8_t='0'}
|
||||
ac_cv_sizeof_uint_fast16_t=${ac_cv_sizeof_uint_fast16_t='0'}
|
||||
ac_cv_sizeof_uint_fast32_t=${ac_cv_sizeof_uint_fast32_t='0'}
|
||||
ac_cv_sizeof_uint_fast64_t=${ac_cv_sizeof_uint_fast64_t='0'}
|
||||
|
50
fortran/config/irix5.x
Normal file
50
fortran/config/irix5.x
Normal file
@ -0,0 +1,50 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details
|
||||
|
||||
# The default compiler is `cc' and there is no ranlib.
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
RANLIB=:
|
||||
|
||||
case "X-$CC_BASENAME" in
|
||||
X-gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O3"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
# Do *not* use -ansi because it prevents hdf5 from being able
|
||||
# to read modification dates from the file. On some systems it
|
||||
# can also result in compile errors in system header files
|
||||
# since hdf5 includes a couple non-ANSI header files.
|
||||
#CFLAGS="$CFLAGS -ansi"
|
||||
|
||||
# Always turn off these compiler warnings:
|
||||
CFLAGS="$CFLAGS -woff 799"
|
||||
|
||||
# Extra debugging flags
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Extra production flags
|
||||
# Note: higher optimizations relax alignment requirements needed.
|
||||
PROD_CFLAGS="-O -s"
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Extra profiling flags
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
123
fortran/config/irix6.x
Normal file
123
fortran/config/irix6.x
Normal file
@ -0,0 +1,123 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# Use SGI supplied C compiler by default. There is no ranlib
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC='cc'
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
RANLIB=:
|
||||
|
||||
# Compiler flags
|
||||
case "X-$CC_BASENAME" in
|
||||
X-gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O3"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
# Check for old versions of the compiler that don't work right.
|
||||
case "`$CC -version 2>&1 |head -1`" in
|
||||
"Mongoose Compilers: Version 7.00")
|
||||
echo " +---------------------------------------------------+"
|
||||
echo " | You have an old version of cc (Mongoose Compilers |"
|
||||
echo " | version 7.00). Please upgrade to MIPSpro version |"
|
||||
echo " | 7.2.1.2m (patches are available from the SGI web |"
|
||||
echo " | site). The 7.00 version may generate incorrect |"
|
||||
echo " | code, especially when optimizations are enabled. |"
|
||||
echo " +---------------------------------------------------+"
|
||||
sleep 5
|
||||
;;
|
||||
esac
|
||||
|
||||
# Do *not* use -ansi because it prevents hdf5 from being able
|
||||
# to read modification dates from the file. On some systems it
|
||||
# can also result in compile errors in system header files
|
||||
# since hdf5 includes a couple non-ANSI header files.
|
||||
#CFLAGS="$CFLAGS -ansi"
|
||||
|
||||
# Always turn off these compiler warnings for the -64 compiler:
|
||||
# 1174: function declared but not used
|
||||
# 1196: __vfork() (this is an SGI config problem)
|
||||
# 1209: constant expressions
|
||||
# 1429: the `long long' type is not standard
|
||||
# 1685: turn off warnings about turning off invalid warnings
|
||||
# 3201: remark - parameter not referenced
|
||||
CFLAGS="$CFLAGS -woff 1174,1429,1209,1196,1685,3201"
|
||||
|
||||
# Always turn off these compiler warnings for the old compiler:
|
||||
# 799: the `long long' type is not standard
|
||||
# 803: turn off warnings about turning off invalid warnings
|
||||
# 835: __vfork() (this is an SGI config problem)
|
||||
CFLAGS="$CFLAGS -woff 799,803,835"
|
||||
|
||||
# Always turn off these loader warnings:
|
||||
# (notice the peculiar syntax)
|
||||
# 47: branch instructions that degrade performance on R4000
|
||||
# 84: a library is not used
|
||||
# 85: duplicate definition preemption (from -lnsl)
|
||||
# 134: duplicate weak definition preemption (from -lnsl)
|
||||
CFLAGS="$CFLAGS -Wl,-woff,47,-woff,84,-woff,85,-woff,134"
|
||||
|
||||
# Extra debugging flags
|
||||
DEBUG_CFLAGS="-g -fullwarn"
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# Extra production flags
|
||||
PROD_CFLAGS="-64 -mips4 -O -s"
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Extra profiling flags
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
||||
|
||||
# Use SGI supplied C compiler by default. There is no ranlib
|
||||
if test "X-" = "X-$F9X"; then
|
||||
F9X="f90"
|
||||
FFLAGS="-64 -mips4 -O -s"
|
||||
DEBUG_FFLAGS="-64 -mips4 -O -s"
|
||||
PROD_FFLAGS="-64 -mips4 -O -s"
|
||||
PROFILE_FFLAGS="-64 -mips4 -O -s"
|
||||
fi
|
||||
|
||||
# The default Fortran 90 compiler
|
||||
|
||||
#
|
||||
# HDF5 integers
|
||||
#
|
||||
# R_LARGE is the number of digits for the bigest integer supported.
|
||||
# R_INTEGER is the number of digits in INTEGER
|
||||
#
|
||||
# (for the IRIX architechture)
|
||||
#
|
||||
R_LARGE=18
|
||||
R_INTEGER=9
|
||||
HSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HSSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HID_T='SELECTED_INT_KIND(R_INTEGER)'
|
||||
SIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
OBJECT_NAMELEN_DEFAULT_F=-1
|
||||
|
||||
if test "X-" = "X-$F9X"; then
|
||||
F9X=f90
|
||||
fi
|
||||
|
||||
if test "X-" = "X-$f9x_flags_set"; then
|
||||
FFLAGS="-64 -mips4 -O -s"
|
||||
DEBUG_FFLAGS="-64 -mips4 -O -s"
|
||||
PROD_FFLAGS="-64 -mips4 -O -s"
|
||||
PROFILE_FFLAGS="-64 -mips4 -O -s"
|
||||
f9x_flags_set=yes
|
||||
fi
|
4
fortran/config/linux-gnu
Normal file
4
fortran/config/linux-gnu
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- shell-script -*-
|
||||
# This is the same as linux-gnulibc1
|
||||
|
||||
. $srcdir/config/linux-gnulibc1
|
49
fortran/config/linux-gnulibc1
Normal file
49
fortran/config/linux-gnulibc1
Normal file
@ -0,0 +1,49 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# The default compiler is `gcc'.
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=gcc
|
||||
CC_BASENAME=gcc
|
||||
fi
|
||||
|
||||
# Omit frame pointer for optimized code?
|
||||
NOFP=${NOFP:=-fomit-frame-pointer}
|
||||
|
||||
# Figure out compiler flags
|
||||
. $srcdir/config/gnu-flags
|
||||
|
||||
# The default Fortran 90 compiler
|
||||
|
||||
#
|
||||
# HDF5 integers
|
||||
#
|
||||
# R_LARGE is the number of digits for the bigest integer supported.
|
||||
# R_INTEGER is the number of digits in INTEGER
|
||||
#
|
||||
# (for the Linux architechture)
|
||||
#
|
||||
R_LARGE=18
|
||||
R_INTEGER=9
|
||||
HSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HSSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HID_T='SELECTED_INT_KIND(R_INTEGER)'
|
||||
SIZE_T='SELECTED_INT_KIND(R_INTEGER)'
|
||||
OBJECT_NAMELEN_DEFAULT_F=-1
|
||||
|
||||
if test "X-" = "X-$F9X"; then
|
||||
F9X=pgf90
|
||||
fi
|
||||
|
||||
if test "X-" = "X-$f9x_flags_set"; then
|
||||
FFLAGS=
|
||||
DEBUG_FFLAGS=
|
||||
PROD_FFLAGS=
|
||||
PROFILE_FFLAGS=
|
||||
f9x_flags_set=yes
|
||||
fi
|
10
fortran/config/linux-gnulibc2
Normal file
10
fortran/config/linux-gnulibc2
Normal file
@ -0,0 +1,10 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# Same as with gnulibc1 for now
|
||||
. $srcdir/config/linux-gnulibc1
|
22
fortran/config/powerpc-ibm-aix4.2.1.0
Normal file
22
fortran/config/powerpc-ibm-aix4.2.1.0
Normal file
@ -0,0 +1,22 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# Cross compiling defaults
|
||||
hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
ac_cv_header_stdc=${ac_cv_header_stdc='yes'}
|
||||
ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
|
||||
ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
|
||||
ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
|
||||
ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
|
||||
ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
|
||||
ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
|
||||
ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
|
||||
ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
|
||||
ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
|
||||
ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8}
|
63
fortran/config/powerpc-ibm-aix4.3.2.0
Normal file
63
fortran/config/powerpc-ibm-aix4.3.2.0
Normal file
@ -0,0 +1,63 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
#CFLAGS="$CFLAGS -ansi"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
ac_cv_header_stdc=${ac_cv_header_stdc='yes'}
|
||||
ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
|
||||
ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
|
||||
ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
|
||||
ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
|
||||
ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
|
||||
ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
|
||||
ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
|
||||
ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
|
||||
ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
|
||||
ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8}
|
||||
ac_cv_sizeof_uint8_t=${ac_cv_sizeof_uint8_t=1}
|
||||
ac_cv_sizeof_uint16_t=${ac_cv_sizeof_uint16_t=2}
|
||||
ac_cv_sizeof_uint32_t=${ac_cv_sizeof_uint32_t=4}
|
||||
ac_cv_sizeof_uint64_t=${ac_cv_sizeof_uint64_t=8}
|
||||
ac_cv_sizeof_int8_t=${ac_cv_sizeof_int8_t=1}
|
||||
ac_cv_sizeof_int16_t=${ac_cv_sizeof_int16_t=2}
|
||||
ac_cv_sizeof_int32_t=${ac_cv_sizeof_int32_t=4}
|
||||
ac_cv_sizeof_int64_t=${ac_cv_sizeof_int64_t=8}
|
||||
ac_cv_sizeof___int64=${ac_cv_sizeof___int64=8}
|
||||
ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
|
||||
ac_cv_header_sys_ioctl_h=${ac_cv_header_sys_ioctl_h=yes}
|
||||
ac_cv_path_install=${ac_cv_path_install='cp -r'}
|
||||
RUNPARALLEL="MP_PROCS=2 poe"
|
21
fortran/config/powerpc-ibm-aix4.x
Normal file
21
fortran/config/powerpc-ibm-aix4.x
Normal file
@ -0,0 +1,21 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# Cross compiling defaults
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
ac_cv_header_stdc=${ac_cv_header_stdc='yes'}
|
||||
ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
|
||||
ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
|
||||
ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
|
||||
ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
|
||||
ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
|
||||
ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
|
||||
ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
|
||||
ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
|
||||
ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
|
||||
ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8}
|
10
fortran/config/rs6000-ibm-aix4.x
Normal file
10
fortran/config/rs6000-ibm-aix4.x
Normal file
@ -0,0 +1,10 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details.
|
||||
|
||||
# Cross compiling defaults
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
62
fortran/config/solaris2.x
Normal file
62
fortran/config/solaris2.x
Normal file
@ -0,0 +1,62 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
#
|
||||
# See BlankForm in this directory for details
|
||||
|
||||
# The default compiler is `sunpro cc'
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
|
||||
# Try gcc compiler flags
|
||||
. $srcdir/config/gnu-flags
|
||||
|
||||
# Try solaris native compiler flags
|
||||
if test "X-" = "X-$cc_flags_set"; then
|
||||
CFLAGS="-erroff=%none"
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O -s"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS=-xpg
|
||||
PROFILE_CPPFLAGS=
|
||||
cc_flags_set=yes
|
||||
# Turn off optimization flag for SUNpro compiler versions 4.x which
|
||||
# have an optimization bug. Version 5.0 works.
|
||||
($CC -V 2>&1) | grep -s 'cc: .* C 4\.' >/dev/null 2>&1 \
|
||||
&& PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`"
|
||||
fi
|
||||
|
||||
# The default Fortran 90 compiler
|
||||
|
||||
#
|
||||
# HDF5 integers
|
||||
#
|
||||
# R_LARGE is the number of digits for the bigest integer supported.
|
||||
# R_INTEGER is the number of digits in INTEGER
|
||||
#
|
||||
# (for the Sparc Solaris architechture)
|
||||
#
|
||||
R_LARGE=9
|
||||
R_INTEGER=9
|
||||
HSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HSSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HID_T='SELECTED_INT_KIND(R_INTEGER)'
|
||||
SIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
OBJECT_NAMELEN_DEFAULT_F=-1
|
||||
|
||||
if test "X-" = "X-$F9X"; then
|
||||
F9X=f90
|
||||
fi
|
||||
|
||||
if test "X-" = "X-$f9x_flags_set"; then
|
||||
FFLAGS=
|
||||
DEBUG_FFLAGS=
|
||||
PROD_FFLAGS=
|
||||
PROFILE_FFLAGS=
|
||||
f9x_flags_set=yes
|
||||
fi
|
166
fortran/config/unicos
Normal file
166
fortran/config/unicos
Normal file
@ -0,0 +1,166 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Choosing a C Compiler
|
||||
# ---------------------
|
||||
#
|
||||
# The user should be able to specify the compiler by setting the CC
|
||||
# environment variable to the name of the compiler and any switches it
|
||||
# requires for proper operation. If CC is unset then this script may
|
||||
# set it. If CC is unset by time this script completes then configure
|
||||
# will try `gcc' and `cc' in that order (perhaps some others too).
|
||||
#
|
||||
# Note: Code later in this file may depend on the value of $CC_BASENAME
|
||||
# in order to distinguish between different compilers when
|
||||
# deciding which compiler command-line switches to use. This
|
||||
# variable is set based on the incoming value of $CC and is only
|
||||
# used within this file.
|
||||
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
# no need to use RANLIB
|
||||
RANLIB=:
|
||||
|
||||
|
||||
# C Compiler and Preprocessor Flags
|
||||
# ---------------------------------
|
||||
#
|
||||
# Flags that end with `_CFLAGS' are always passed to the compiler.
|
||||
# Flags that end with `_CPPFLAGS' are passed to the compiler when
|
||||
# compiling but not when linking.
|
||||
#
|
||||
# DEBUG_CFLAGS Flags to pass to the compiler to create a
|
||||
# DEBUG_CPPFLAGS library suitable for use with debugging
|
||||
# tools. Usually this list will exclude
|
||||
# optimization switches (like `-O') and include
|
||||
# switches that turn on symbolic debugging
|
||||
# support (like `-g').
|
||||
#
|
||||
# PROD_CFLAGS Flags to pass to the compiler to create a
|
||||
# PROD_CPPFLAGS production version of the library. These
|
||||
# usualy exclude symbolic debugging switches
|
||||
# (like `-g') and include optimization switches
|
||||
# (like `-O').
|
||||
#
|
||||
# PROFILE_CFLAGS Flags to pass to the compiler to create a
|
||||
# PROFILE_CPPFLAGS library suitable for performance testing (like
|
||||
# `-pg'). This may or may not include debugging
|
||||
# or production flags.
|
||||
#
|
||||
# CFLAGS Flags can be added to this variable which
|
||||
# might already be partially initialized. These
|
||||
# flags will always be passed to the compiler
|
||||
# and should include switches to turn on full
|
||||
# warnings. HDF5 attempts to be ANSI and Posix
|
||||
# compliant and employ good programming
|
||||
# practices resulting in few if any
|
||||
# warnings.
|
||||
#
|
||||
# Warning flags do not have to be added to CFLAGS
|
||||
# variable if the compiler is the GNU gcc
|
||||
# compiler or a descendent of gcc such as EGCS or PGCC.
|
||||
#
|
||||
# The CFLAGS should contains *something* or else
|
||||
# configure will probably add `-g'. For most
|
||||
# systems this isn't a problem but some systems
|
||||
# will disable optimizations in favor of the
|
||||
# `-g'.
|
||||
#
|
||||
#
|
||||
# These flags should be set according to the compiler being used.
|
||||
# There are two ways to check the compiler. You can try using `-v' or
|
||||
# `--version' to see if the compiler will print a version string. You
|
||||
# can use the value of $CC_BASENAME which is the base name of the
|
||||
# first word in $CC (note that the value of CC may have changed
|
||||
# above).
|
||||
|
||||
case $CC_BASENAME in
|
||||
gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
|
||||
PROD_CFLAGS="-O3 -fomit-frame-pointer"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
cc)
|
||||
CFLAGS="$CFLAGS"
|
||||
DEBUG_CFLAGS="-g -h zero -h scalar0"
|
||||
DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
|
||||
PROD_CFLAGS="-O2 -h scalar0"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
CFLAGS="$CFLAGS -ansi"
|
||||
DEBUG_CFLAGS="-g"
|
||||
DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
|
||||
PROD_CFLAGS="-O"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
||||
|
||||
# Overriding Configure Tests
|
||||
# --------------------------
|
||||
#
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
||||
# Set this to the width required by printf() to print type `long
|
||||
# long'. For instance, if the format would be `%lld' then set it to
|
||||
# `ll' or if the format would be `%qd' set it to `q'.
|
||||
#hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
|
||||
|
||||
# The default Fortran 90 compiler
|
||||
|
||||
#
|
||||
# HDF5 integers
|
||||
#
|
||||
# R_LARGE is the number of digits for the bigest integer supported.
|
||||
# R_INTEGER is the number of digits in INTEGER
|
||||
#
|
||||
# (for the UNICOS architechture)
|
||||
#
|
||||
R_LARGE=18
|
||||
R_INTEGER=18
|
||||
HSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HSSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HID_T='SELECTED_INT_KIND(R_INTEGER)'
|
||||
SIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
OBJECT_NAMELEN_DEFAULT_F=-1
|
||||
|
||||
if test "X-" = "X-$F9X"; then
|
||||
F9X=f90
|
||||
fi
|
||||
|
||||
if test "X-" = "X-$f9x_flags_set"; then
|
||||
FFLAGS="-dp"
|
||||
DEBUG_FFLAGS="-dp"
|
||||
PROD_FFLAGS="-dp"
|
||||
PROFILE_FFLAGS="-dp"
|
||||
f9x_flags_set=yes
|
||||
fi
|
168
fortran/config/unicosmk
Normal file
168
fortran/config/unicosmk
Normal file
@ -0,0 +1,168 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Choosing a C Compiler
|
||||
# ---------------------
|
||||
#
|
||||
# The user should be able to specify the compiler by setting the CC
|
||||
# environment variable to the name of the compiler and any switches it
|
||||
# requires for proper operation. If CC is unset then this script may
|
||||
# set it. If CC is unset by time this script completes then configure
|
||||
# will try `gcc' and `cc' in that order (perhaps some others too).
|
||||
#
|
||||
# Note: Code later in this file may depend on the value of $CC_BASENAME
|
||||
# in order to distinguish between different compilers when
|
||||
# deciding which compiler command-line switches to use. This
|
||||
# variable is set based on the incoming value of $CC and is only
|
||||
# used within this file.
|
||||
|
||||
if test "X-" = "X-$CC"; then
|
||||
CC=cc
|
||||
CC_BASENAME=cc
|
||||
fi
|
||||
# no need to use RANLIB
|
||||
RANLIB=:
|
||||
|
||||
|
||||
# C Compiler and Preprocessor Flags
|
||||
# ---------------------------------
|
||||
#
|
||||
# Flags that end with `_CFLAGS' are always passed to the compiler.
|
||||
# Flags that end with `_CPPFLAGS' are passed to the compiler when
|
||||
# compiling but not when linking.
|
||||
#
|
||||
# DEBUG_CFLAGS Flags to pass to the compiler to create a
|
||||
# DEBUG_CPPFLAGS library suitable for use with debugging
|
||||
# tools. Usually this list will exclude
|
||||
# optimization switches (like `-O') and include
|
||||
# switches that turn on symbolic debugging
|
||||
# support (like `-g').
|
||||
#
|
||||
# PROD_CFLAGS Flags to pass to the compiler to create a
|
||||
# PROD_CPPFLAGS production version of the library. These
|
||||
# usualy exclude symbolic debugging switches
|
||||
# (like `-g') and include optimization switches
|
||||
# (like `-O').
|
||||
#
|
||||
# PROFILE_CFLAGS Flags to pass to the compiler to create a
|
||||
# PROFILE_CPPFLAGS library suitable for performance testing (like
|
||||
# `-pg'). This may or may not include debugging
|
||||
# or production flags.
|
||||
#
|
||||
# CFLAGS Flags can be added to this variable which
|
||||
# might already be partially initialized. These
|
||||
# flags will always be passed to the compiler
|
||||
# and should include switches to turn on full
|
||||
# warnings. HDF5 attempts to be ANSI and Posix
|
||||
# compliant and employ good programming
|
||||
# practices resulting in few if any
|
||||
# warnings.
|
||||
#
|
||||
# Warning flags do not have to be added to CFLAGS
|
||||
# variable if the compiler is the GNU gcc
|
||||
# compiler or a descendent of gcc such as EGCS or PGCC.
|
||||
#
|
||||
# The CFLAGS should contains *something* or else
|
||||
# configure will probably add `-g'. For most
|
||||
# systems this isn't a problem but some systems
|
||||
# will disable optimizations in favor of the
|
||||
# `-g'.
|
||||
#
|
||||
#
|
||||
# These flags should be set according to the compiler being used.
|
||||
# There are two ways to check the compiler. You can try using `-v' or
|
||||
# `--version' to see if the compiler will print a version string. You
|
||||
# can use the value of $CC_BASENAME which is the base name of the
|
||||
# first word in $CC (note that the value of CC may have changed
|
||||
# above).
|
||||
|
||||
case $CC_BASENAME in
|
||||
gcc)
|
||||
CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O3 -fomit-frame-pointer"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
cc)
|
||||
CFLAGS="$CFLAGS"
|
||||
DEBUG_CFLAGS="-g -h zero"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O2 -h scalar0"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
|
||||
*)
|
||||
CFLAGS="$CFLAGS -ansi"
|
||||
DEBUG_CFLAGS="-g"
|
||||
DEBUG_CPPFLAGS=
|
||||
PROD_CFLAGS="-O"
|
||||
PROD_CPPFLAGS=
|
||||
PROFILE_CFLAGS="-pg"
|
||||
PROFILE_CPPFLAGS=
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# Overriding Configure Tests
|
||||
# --------------------------
|
||||
#
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
||||
# Set this to the width required by printf() to print type `long
|
||||
# long'. For instance, if the format would be `%lld' then set it to
|
||||
# `ll' or if the format would be `%qd' set it to `q'.
|
||||
#hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
|
||||
|
||||
# The default Fortran 90 compiler
|
||||
|
||||
#
|
||||
# HDF5 integers
|
||||
#
|
||||
# R_LARGE is the number of digits for the bigest integer supported.
|
||||
# R_INTEGER is the number of digits in INTEGER
|
||||
#
|
||||
# (for the UNICOS architechture)
|
||||
#
|
||||
R_LARGE=18
|
||||
R_INTEGER=18
|
||||
HSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HSSIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
HID_T='SELECTED_INT_KIND(R_INTEGER)'
|
||||
SIZE_T='SELECTED_INT_KIND(R_LARGE)'
|
||||
OBJECT_NAMELEN_DEFAULT_F=-1
|
||||
|
||||
if test "X-" = "X-$F9X"; then
|
||||
F9X=f90
|
||||
fi
|
||||
|
||||
if test "X-" = "X-$f9x_flags_set"; then
|
||||
FFLAGS="-dp"
|
||||
DEBUG_FFLAGS="-dp"
|
||||
PROD_FFLAGS="-dp"
|
||||
PROFILE_FFLAGS="-dp"
|
||||
f9x_flags_set=yes
|
||||
fi
|
2981
fortran/configure
vendored
Executable file
2981
fortran/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
586
fortran/configure.in
Normal file
586
fortran/configure.in
Normal file
@ -0,0 +1,586 @@
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Process this file with autoconf to produce configure.
|
||||
dnl
|
||||
dnl Copyright (C) 2000 National Center for Supercomputing Applications.
|
||||
dnl All rights reserved.
|
||||
dnl ----------------------------------------------------------------------
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Initialize configure.
|
||||
dnl
|
||||
AC_REVISION($Id$)
|
||||
AC_INIT(src/HDF5.f90)
|
||||
dnl AC_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_AUX_DIR(bin)
|
||||
AC_CANONICAL_HOST
|
||||
AC_SUBST(CPPFLAGS)
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl HDF5 integer variables for the H5fortran_types.f90 file.
|
||||
dnl
|
||||
AC_SUBST(R_LARGE)
|
||||
AC_SUBST(R_INTEGER)
|
||||
AC_SUBST(HSIZE_T)
|
||||
AC_SUBST(HSSIZE_T)
|
||||
AC_SUBST(HID_T)
|
||||
AC_SUBST(SIZE_T)
|
||||
AC_SUBST(OBJECT_NAMELEN_DEFAULT_F)
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Dump all shell variables values.
|
||||
dnl
|
||||
AC_MSG_CHECKING(shell variables initial values)
|
||||
set >&5
|
||||
AC_MSG_RESULT(done)
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Where is the root of the source tree. Give an absolute address so
|
||||
dnl we can find it no matter which directory of the distribution is our
|
||||
dnl current directory. The built-in pwd fails on some systems, but the
|
||||
dnl /bin/pwd version works OK.
|
||||
dnl
|
||||
if test -x /bin/pwd; then
|
||||
pwd=/bin/pwd
|
||||
else
|
||||
pwd=pwd
|
||||
fi
|
||||
AC_SUBST(ROOT) ROOT=`$pwd`
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check that the cache file was build on the same host as what we're
|
||||
dnl running on now.
|
||||
dnl
|
||||
AC_CACHE_CHECK(for cached host,hdf5_cv_host,hdf5_cv_host="none");
|
||||
if test "X$hdf5_cv_host" = "Xnone"; then
|
||||
hdf5_cv_host=$host
|
||||
elif test "$hdf5_cv_host" != "$host"; then
|
||||
echo "The config.cache file was generated on $hdf5_cv_host but"
|
||||
echo "this is $host. Please remove that file and try again."
|
||||
AC_MSG_ERROR(config.cache file is invalid)
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Source any special files that we need. These files normally aren't
|
||||
dnl present but can be used by the maintainers to fine tune things like
|
||||
dnl turning on debug or profiling flags for the compiler. The search order
|
||||
dnl is:
|
||||
dnl
|
||||
dnl CPU-VENDOR-OS
|
||||
dnl VENDOR-OS
|
||||
dnl CPU-OS
|
||||
dnl CPU-VENDOR
|
||||
dnl OS
|
||||
dnl VENDOR
|
||||
dnl CPU
|
||||
dnl
|
||||
dnl If the `OS' ends with a version number then remove it. For instance,
|
||||
dnl `freebsd3.1' would become `freebsd'
|
||||
case "$host_os" in
|
||||
aix4.*)
|
||||
host_os_novers=aix4.x
|
||||
;;
|
||||
freebsd*)
|
||||
host_os_novers=freebsd
|
||||
;;
|
||||
irix5.*)
|
||||
host_os_novers=irix5.x
|
||||
;;
|
||||
irix6.*)
|
||||
host_os_novers=irix6.x
|
||||
;;
|
||||
osf4.*)
|
||||
host_os_novers=osf4.x
|
||||
;;
|
||||
solaris2.*)
|
||||
host_os_novers=solaris2.x
|
||||
;;
|
||||
*)
|
||||
host_os_novers=$host_os
|
||||
;;
|
||||
esac
|
||||
|
||||
host_config="none"
|
||||
for f in $host_cpu-$host_vendor-$host_os \
|
||||
$host_cpu-$host_vendor-$host_os_novers \
|
||||
$host_vendor-$host_os \
|
||||
$host_vendor-$host_os_novers \
|
||||
$host_cpu-$host_os \
|
||||
$host_cpu-$host_os_novers \
|
||||
$host_cpu-$host_vendor \
|
||||
$host_os \
|
||||
$host_os_novers \
|
||||
$host_vendor \
|
||||
$host_cpu ; do
|
||||
AC_MSG_CHECKING(for config $f)
|
||||
if test -f $srcdir/config/$f; then
|
||||
host_config=$srcdir/config/$f
|
||||
AC_MSG_RESULT(found)
|
||||
break
|
||||
fi
|
||||
AC_MSG_RESULT(no)
|
||||
done
|
||||
if test "X$host_config" != "Xnone"; then
|
||||
CC_BASENAME="`echo $CC |cut -f1 -d' ' |xargs basename 2>/dev/null`"
|
||||
. $host_config
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for programs.
|
||||
dnl
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP dnl this is checked for when AC_HEADER_STDC is done
|
||||
CC_BASENAME="`echo $CC |cut -f1 -d' ' |xargs basename 2>/dev/null`"
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_INSTALL
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
if test -z "$AR"; then
|
||||
AC_CHECK_PROGS(AR,ar xar,:,$PATH)
|
||||
fi
|
||||
AC_SUBST(AR)
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Sometimes makes think the `.PATH:' appearing before the first rule
|
||||
dnl with an action should override the `all' default target. So we have
|
||||
dnl to decide what the proper syntax is.
|
||||
dnl
|
||||
AC_MSG_CHECKING(how make searches directories)
|
||||
while true; do #for break
|
||||
dnl The most common method is `VPATH=DIR1 DIR2 ...'
|
||||
cat >maketest <<EOF
|
||||
VPATH=$srcdir/config $srcdir/src $srcdir/bin
|
||||
.c.o:
|
||||
cp $< H5.o
|
||||
|
||||
foo: H5.o
|
||||
/bin/rm -f H5.o
|
||||
@echo works
|
||||
EOF
|
||||
|
||||
if (${MAKE-make} -f maketest foo) >/dev/null 2>&1; then
|
||||
SEARCH_RULE='VPATH='
|
||||
SEARCH_SEP=' '
|
||||
AC_MSG_RESULT([VPATH=DIR1 DIR2 ...])
|
||||
break
|
||||
fi
|
||||
|
||||
dnl The second most common method is like above except with the
|
||||
dnl directories separated by colons.
|
||||
cat >maketest <<EOF
|
||||
VPATH=$srcdir/config:$srcdir/src:$srcdir/bin
|
||||
.c.o:
|
||||
cp $< H5.o
|
||||
|
||||
foo: H5.o
|
||||
/bin/rm -f H5.o
|
||||
@echo works
|
||||
EOF
|
||||
|
||||
if (${MAKE-make} -f maketest foo) >/dev/null 2>&1; then
|
||||
SEARCH_RULE='VPATH='
|
||||
SEARCH_SEP=':'
|
||||
AC_MSG_RESULT([VPATH=DIR1:DIR2:...])
|
||||
break
|
||||
fi
|
||||
|
||||
dnl pmake uses the construct `.PATH: DIR1 DIR2
|
||||
cat >maketest <<EOF
|
||||
.PATH: $srcdir/config $srcdir/src $srcdir/bin
|
||||
.c.o:
|
||||
cp $< H5.o
|
||||
|
||||
foo: H5.o
|
||||
/bin/rm -f H5.o
|
||||
@echo works
|
||||
EOF
|
||||
if (MAKE= ${MAKE-make} -f maketest foo) >/dev/null 2>&1; then
|
||||
SEARCH_RULE='.PATH: '
|
||||
SEARCH_SEP=' '
|
||||
AC_MSG_RESULT([.PATH: DIR1 DIR2 ...])
|
||||
break
|
||||
fi
|
||||
|
||||
dnl No way for make to search directories
|
||||
SEARCH_RULE='## SEARCH DISABLED: '
|
||||
SEARCH_SEP=' '
|
||||
AC_MSG_RESULT([it doesn't])
|
||||
if test ! -f configure; then
|
||||
AC_MSG_ERROR(${MAKE-make} requires the build and source directories to be the same)
|
||||
fi
|
||||
break
|
||||
done
|
||||
rm maketest
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for a Fortran 9X compiler, how to optimize it, and how to
|
||||
dnl include modules.
|
||||
dnl
|
||||
AC_PROG_F9X
|
||||
dnl AC_F9X_OPT_FLAGS
|
||||
AC_F9X_MODS
|
||||
|
||||
dnl Change back to the C language
|
||||
AC_LANG_C
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Checks for libraries.
|
||||
dnl
|
||||
|
||||
dnl Is the GNU zlib present? It has a header file `zlib.h' and a library
|
||||
dnl `-lz' and their locations might be specified with the `--enable-zlib'
|
||||
dnl command-line switch. The value is an include path and/or a library path.
|
||||
dnl If the library path is specified then it must be preceded by a comma.
|
||||
AC_ARG_WITH(zlib,[ --with-zlib=INC,LIB Use the GNU zlib compression],
|
||||
,withval=yes)
|
||||
case "$withval" in
|
||||
yes)
|
||||
AC_CHECK_HEADERS(zlib.h)
|
||||
AC_CHECK_LIB(z, compress)
|
||||
;;
|
||||
no)
|
||||
AC_MSG_CHECKING(for GNU zlib)
|
||||
AC_MSG_RESULT(suppressed)
|
||||
;;
|
||||
*)
|
||||
zlib_inc="`echo $withval |cut -f1 -d,`"
|
||||
if test -n "$zlib_inc"; then
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -I$zlib_inc"
|
||||
AC_CHECK_HEADERS(zlib.h,,CPPFLAGS="$saved_CPPFLAGS")
|
||||
else
|
||||
AC_CHECK_HEADERS(zlib.h)
|
||||
fi
|
||||
|
||||
zlib_lib="`echo $withval |cut -f2 -d, -s`"
|
||||
if test -n "$zlib_lib"; then
|
||||
saved_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -L$zlib_lib"
|
||||
ZLIB_DIR=$zlib_lib
|
||||
AC_CHECK_LIB(z, compress,,LDFLAGS="$saved_LDFLAGS")
|
||||
else
|
||||
AC_CHECK_LIB(z, compress)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Checks for header files.
|
||||
dnl
|
||||
|
||||
dnl Checkpoint the cache
|
||||
AC_CACHE_SAVE
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl The following variables are used to distinguish between building a
|
||||
dnl serial and parallel library.
|
||||
dnl
|
||||
dnl HAVE_PARALLEL -- defined in H5config.h if we are building
|
||||
dnl a parallel library even if configure wasn't
|
||||
dnl able to find some header file or library that
|
||||
dnl might be required. This is defined if the
|
||||
dnl compiler looks like a parallel compiler (e.g.,
|
||||
dnl mpicc or mpcc) or if the user explicitly states
|
||||
dnl that a parallel library is being built by supplying
|
||||
dnl the `--enable-parallel' configure switch.
|
||||
dnl
|
||||
dnl PARALLEL -- This variable is set to a non-null value if
|
||||
dnl configure thinks we're compiling a parallel
|
||||
dnl version of the library.
|
||||
dnl
|
||||
dnl RUNSERIAL -- This is a command which will be prepended to
|
||||
dnl the executable name to run the executable using
|
||||
dnl a single process. For serial versions of the
|
||||
dnl library this will normally be empty. For parallel
|
||||
dnl versions it might be something like `mpirun -np 1'.
|
||||
dnl The value of this variable is substituted in *.in
|
||||
dnl files.
|
||||
dnl
|
||||
dnl RUNPARALLEL -- This is a command which will be prepended to
|
||||
dnl the executable name to run the executable on
|
||||
dnl multiple processors. For the serial library the
|
||||
dnl value will normally be the empty string. For
|
||||
dnl parallel library it should be something like
|
||||
dnl `mpi -np $$NPROCS' where NPROCS will eventually
|
||||
dnl contain the number of processors on which to run
|
||||
dnl the executable (the double dollarsigns are to
|
||||
dnl protect the expansion until make executes the
|
||||
dnl command). The value of this variable is
|
||||
dnl substituted in *.in files.
|
||||
dnl
|
||||
AC_SUBST(PARALLEL)
|
||||
AC_SUBST(RUNSERIAL)
|
||||
AC_SUBST(RUNPARALLEL)
|
||||
AC_SUBST(TESTPARALLEL)
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl If the compiler is obviously a parallel compiler then we're building
|
||||
dnl a parallel version of hdf5 and should define HAVE_PARALLEL. Furthermore,
|
||||
dnl the name of the compiler might tell us how to run the resulting
|
||||
dnl executable. For `mpicc' the executable should be run with `mpirun' from
|
||||
dnl the same directory as mpicc if it exists.
|
||||
dnl
|
||||
case "$CC_BASENAME" in
|
||||
mpicc)
|
||||
dnl The mpich compiler. Use mpirun from the same directory if it
|
||||
dnl exists.
|
||||
PARALLEL=mpicc
|
||||
AC_MSG_CHECKING(for mpirun)
|
||||
|
||||
dnl Find the path where mpicc is located.
|
||||
cmd=`echo $CC |cut -f1 -d' '`
|
||||
if (echo $cmd |grep / >/dev/null); then
|
||||
path="`echo $cmd |sed 's/\(.*\)\/.*$/\1/'`"
|
||||
else
|
||||
for path in `echo $PATH |tr : ' '`; do
|
||||
if test -x $path/$cmd; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
dnl Is there an mpirun at that path?
|
||||
if test -x $path/mpirun; then
|
||||
AC_MSG_RESULT($path/mpirun)
|
||||
RUNSERIAL="${RUNSERIAL:-none}"
|
||||
if test -z "$RUNPARALLEL"; then
|
||||
RUNPARALLEL="$path/mpirun -np \$\${NPROCS:=2}"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(none)
|
||||
fi
|
||||
;;
|
||||
|
||||
mpcc|mpcc_r)
|
||||
dnl The IBM compiler
|
||||
PARALLEL="$CC_BASENAME"
|
||||
;;
|
||||
|
||||
*)
|
||||
dnl Probably not a parallel compiler, but if `--enable-parallel'
|
||||
dnl is defined below then we're still building a parallel hdf5.
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl What header files and libraries do we have to look for for parallel
|
||||
dnl support? For the most part, search paths are already specified with
|
||||
dnl CPPFLAGS and LDFLAGS or are known to the compiler. If the user says
|
||||
dnl `--disable-parallel' but specifies a known parallel compiler (like mpicc
|
||||
dnl or mpcc) then parallel support is enabled but configure doesn't search
|
||||
dnl for any parallel header files or libraries.
|
||||
dnl
|
||||
AC_ARG_ENABLE(parallel,
|
||||
[ --enable-parallel=TYPE Search for MPI-IO and MPI support files])
|
||||
|
||||
AC_MSG_CHECKING(for parallel support files)
|
||||
case "X-$enable_parallel" in
|
||||
X-|X-no|X-none)
|
||||
dnl Either we are not compiling for parallel or the header and library
|
||||
dnl files and locations are known to the compiler (this is the case
|
||||
dnl for a correct installation of mpicc for instance).
|
||||
AC_MSG_RESULT(skipped)
|
||||
;;
|
||||
|
||||
X-yes)
|
||||
dnl We want to compile a parallel library with a compiler that
|
||||
dnl may already know how to link with MPI and MPI-IO.
|
||||
AC_MSG_RESULT(provided by compiler)
|
||||
PARALLEL=yes
|
||||
|
||||
dnl Try link a simple MPI program. If fail, try again with -lmpi.
|
||||
AC_TRY_LINK(,MPI_Init(),,AC_CHECK_LIB(mpi,MPI_Init,,PARALLEL=no))
|
||||
|
||||
dnl Then try link a simple MPI-IO program. If fail, try again with
|
||||
dnl -lmpio.
|
||||
if test "X$PARALLEL" = "Xyes"; then
|
||||
AC_TRY_LINK(,MPI_File_open(),,
|
||||
AC_CHECK_LIB(mpio,MPI_File_open,,PARALLEL=no))
|
||||
fi
|
||||
|
||||
dnl Set RUNPARALLEL to mpirun if not set yet.
|
||||
if test "X$PARALLEL" = "Xyes" && test -z "$RUNPARALLEL"; then
|
||||
RUNPARALLEL="mpirun -np \$\${NPROCS:=2}"
|
||||
fi
|
||||
;;
|
||||
|
||||
X-mpich)
|
||||
dnl For normal mpich installation the compiler, mpicc, should know
|
||||
dnl where the MPI and MPI-IO header files are located and know which
|
||||
dnl extra libraries need to be linked and will supply appropriate
|
||||
dnl flags to the underlying compiler.
|
||||
AC_MSG_RESULT(mpich)
|
||||
AC_MSG_WARN(*** Why aren't you using an mpicc compiler? ***)
|
||||
|
||||
dnl Apparently mpicc isn't installed correctly so configure must
|
||||
dnl search for the header files and libraries. Actually we only
|
||||
dnl have to search for the libraries in order to get the onto the
|
||||
dnl link line, the user will have already told us about the
|
||||
dnl locations. Fail if something is missing.
|
||||
PARALLEL=mpich
|
||||
AC_CHECK_LIB(mpich,MPI_Init,,AC_MSG_ERROR(no mpich library))
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_RESULT(error)
|
||||
AC_MSG_ERROR(\'$enable_parallel\' is not a valid parallel search type)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Print some other parallel information and do some sanity checks.
|
||||
dnl
|
||||
if test -n "$PARALLEL"; then
|
||||
dnl We are building a parallel library
|
||||
AC_DEFINE(HAVE_PARALLEL)
|
||||
|
||||
dnl Display what we found about running programs
|
||||
AC_MSG_CHECKING(prefix for running on one processor)
|
||||
AC_MSG_RESULT($RUNSERIAL)
|
||||
AC_MSG_CHECKING(prefix for running in parallel)
|
||||
AC_MSG_RESULT($RUNPARALLEL)
|
||||
|
||||
dnl Check that we can link a simple MPI and MPI-IO application
|
||||
AC_MSG_CHECKING(whether a simple MPI-IO program can be linked)
|
||||
AC_TRY_LINK(,[MPI_Init();MPI_File_open();],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR('unable to link a simple MPI-IO application'))
|
||||
|
||||
dnl There *must* be some way to run in parallel even if it's just the
|
||||
dnl word `none'.
|
||||
if test -z "$RUNPARALLEL"; then
|
||||
AC_MSG_ERROR(no way to run a parallel program)
|
||||
fi
|
||||
|
||||
dnl If RUNSERIAL or RUNPARALLEL is the word `none' then replace it with
|
||||
dnl the empty string.
|
||||
if test "X$RUNSERIAL" = "Xnone"; then
|
||||
RUNSERIAL=
|
||||
fi
|
||||
if test "X$RUNPARALLEL" = "Xnone"; then
|
||||
RUNPARALLEL=
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(make)
|
||||
AC_SUBST_FILE(DEPEND)
|
||||
if test "`${MAKE-make} --version -f /dev/null 2>/dev/null |\
|
||||
sed -n 1p|cut -c1-8`" = "GNU Make"; then
|
||||
AC_MSG_RESULT(GNU make)
|
||||
GMAKE=yes
|
||||
if test "X$GCC" = "Xyes"; then
|
||||
DEPEND=config/depend1
|
||||
else
|
||||
DEPEND=config/depend2
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(generic)
|
||||
fi
|
||||
|
||||
dnl How do we include another file into a Makefile?
|
||||
if test -n "$DEPEND"; then
|
||||
AC_MSG_CHECKING(how to include a makefile)
|
||||
|
||||
dnl The include file contains the target for `foo'
|
||||
cat >makeinc <<EOF
|
||||
foo:
|
||||
@:
|
||||
EOF
|
||||
|
||||
while true; do dnl for break
|
||||
dnl pmake. We have to be careful because some pmake think that the
|
||||
dnl contents of the MAKE environment variable is a target.
|
||||
echo '.include <makeinc>' >maketest
|
||||
if (MAKE= ${MAKE-make} -f maketest foo) >/dev/null 2>&1; then
|
||||
AC_MSG_RESULT([.include <FILE>])
|
||||
DEPEND=config/depend3
|
||||
break
|
||||
fi
|
||||
|
||||
dnl Most make's use `include FILE'
|
||||
echo 'include makeinc' >maketest
|
||||
if (${MAKE-make} -f maketest foo) >/dev/null 2>&1; then
|
||||
AC_MSG_RESULT(include FILE)
|
||||
DEPEND=config/depend4
|
||||
break;
|
||||
fi
|
||||
|
||||
dnl default
|
||||
AC_MSG_RESULT(you have a deficient make command)
|
||||
DEPEND=config/dependN
|
||||
break
|
||||
done
|
||||
rm makeinc maketest
|
||||
fi
|
||||
|
||||
dnl Some cleanup stuff
|
||||
rm -f conftest core core.* *.core conftest.o conftest.c dummy.o $ac_clean_files
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Determine the runtime libraries we may need to include in the
|
||||
dnl libtools command so that executables will find the correct dynamic
|
||||
dnl libraries.
|
||||
dnl
|
||||
DYNAMIC_DIRS=""
|
||||
if test -n "$LDFLAGS"; then
|
||||
for d in $LDFLAGS ; do
|
||||
d=`echo $d | sed -e 's/-L//g'`
|
||||
case "$d" in
|
||||
.*)
|
||||
dnl If the path isn't absolute, make it so by prepending the
|
||||
dnl ROOT directory to it.
|
||||
d=${ROOT}/$d
|
||||
;;
|
||||
esac
|
||||
DYNAMIC_DIRS="-R${d} $DYNAMIC_DIRS"
|
||||
done
|
||||
fi
|
||||
AC_SUBST(DYNAMIC_DIRS)
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Build the Makefiles. Almost every Makefile.in will begin with the line
|
||||
dnl `@COMMENCE@' and end with the line `@CONCLUDE@'. These lines insert
|
||||
dnl various files from the config directory into the Makefile.
|
||||
dnl
|
||||
AC_SUBST_FILE(COMMENCE) COMMENCE=config/commence
|
||||
AC_SUBST_FILE(CONCLUDE) CONCLUDE=config/conclude
|
||||
|
||||
dnl The directory search list
|
||||
AC_SUBST(SEARCH) SEARCH='$(srcdir) $(top_builddir)/src $(top_srcdir)/src'
|
||||
cmd='echo $SEARCH |sed "s/ /'$SEARCH_SEP'/g"'
|
||||
SEARCH="$SEARCH_RULE`eval $cmd`"
|
||||
|
||||
dnl We don't need to say when we're entering directories if we're using
|
||||
dnl GNU make becuase make does it for us.
|
||||
if test "X$GMAKE" = "Xyes"; then
|
||||
AC_SUBST(SETX) SETX=":"
|
||||
else
|
||||
AC_SUBST(SETX) SETX="set -x"
|
||||
fi
|
||||
|
||||
dnl Some cleanup stuff
|
||||
rm -rf conftest* confdefs* core core.* *.core dummy.o
|
||||
|
||||
dnl Build config.status, touch the stamp files, and build all the Makefiles.
|
||||
dnl The order is such that the first `make' does not need to update any
|
||||
dnl configuration information. See config/commence.in for the order in which
|
||||
dnl things need to be done.
|
||||
|
||||
dnl First the stamp1 file for H5config.h.in
|
||||
mkdir ./config >/dev/null 2>&1
|
||||
touch ./config/stamp1
|
||||
|
||||
dnl Then the config.status file (but not makefiles)
|
||||
saved_no_create=$no_create
|
||||
no_create=yes
|
||||
AC_OUTPUT(config/depend1 config/depend2 config/depend3 config/depend4 \
|
||||
config/dependN config/commence config/conclude Makefile \
|
||||
src/H5fortran_types.f90 src/Makefile test/Makefile \
|
||||
examples/Makefile)
|
||||
no_create=$saved_no_create
|
||||
|
||||
dnl Then the stamp2 file for H5config.h
|
||||
touch ./config/stamp2
|
||||
|
||||
dnl Finally the makefiles
|
||||
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
|
0
fortran/examples/Dependencies
Normal file
0
fortran/examples/Dependencies
Normal file
86
fortran/examples/Makefile.in
Normal file
86
fortran/examples/Makefile.in
Normal file
@ -0,0 +1,86 @@
|
||||
## HDF5-Fortran test/Makefile(.in)
|
||||
##
|
||||
## Copyright (C) 2000 National Center for Supercomputing Applications.
|
||||
## All rights reserved.
|
||||
##
|
||||
##
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=..
|
||||
srcdir=@srcdir@
|
||||
@COMMENCE@
|
||||
|
||||
hdf5_dir=$(top_srcdir)/../src
|
||||
|
||||
## Add include directory to the C preprocessor flags and the h5test and hdf5
|
||||
## libraries to the library list.
|
||||
LT_LINK_LIB=$(LT) --mode=link $(F9X) -static -rpath $(libdir)
|
||||
MFLAG=@F9XMODFLAG@
|
||||
FFLAGS=$(MFLAG). $(MFLAG)../src
|
||||
FLIB=../src/libhdf5_fortran.la
|
||||
HDF5LIB=$(hdf5_dir)/libhdf5.la
|
||||
|
||||
## These are the programs that `make all' or `make tests' will build and which
|
||||
## `make check' will run. List them in the order they should be run.
|
||||
TEST_PROGS=dsetexample fileexample rwdsetexample attrexample groupexample \
|
||||
grpsexample grpdsetexample hyperslab selectele grpit refobjexample \
|
||||
refregexample mountexample compound
|
||||
|
||||
## These are the files that `make clean' (and derivatives) will remove from
|
||||
## this directory.
|
||||
CLEAN=*.h5
|
||||
|
||||
## List all source files here. The list of object files will be
|
||||
## created by replacing the `.f90' with a `.o'. This list is necessary
|
||||
## for building automatic dependencies.
|
||||
TEST_SRC=dsetexample.f90 fileexample.f90 rwdsetexample.f90 attrexample.f90 \
|
||||
groupexample.f90 grpsexample.f90 grpdsetexample.f90 hyperslab.f90 \
|
||||
selectele.f90 grpit.f90 refobjexample.f90 refregexample.f90 \
|
||||
mountexample.f90 compound.f90
|
||||
TEST_OBJ=$(TEST_SRC:.f90=.lo)
|
||||
|
||||
## How to build the programs... they all depend on the Fortran HDF5 library
|
||||
$(TEST_PROGS): $(FLIB)
|
||||
|
||||
dsetexample: dsetexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ dsetexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
fileexample: fileexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ fileexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
rwdsetexample: rwdsetexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ rwdsetexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
attrexample: attrexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ attrexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
groupexample: groupexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ groupexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
grpsexample: grpsexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ grpsexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
grpdsetexample: grpdsetexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ grpdsetexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
hyperslab: hyperslab.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ hyperslab.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
selectele: selectele.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ selectele.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
grpit: grpit.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ grpit.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
refobjexample: refobjexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ refobjexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
refregexample: refregexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ refregexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
mountexample: mountexample.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ mountexample.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
compound: compound.f90
|
||||
@$(LT_LINK_FEXE) $(FFLAGS) -o $@ compound.f90 $(FLIB) $(LIBS) $(HDF5LIB)
|
||||
|
||||
@CONCLUDE@
|
102
fortran/examples/attrexample.f90
Normal file
102
fortran/examples/attrexample.f90
Normal file
@ -0,0 +1,102 @@
|
||||
! This example shows how to create and write a dataset attribute.
|
||||
! It opens the existing file 'dset.h5', obtains the identifier of
|
||||
! the dataset "/dset", defines attribute's dataspace,
|
||||
! creates dataset attribute, writes the attribute, and then closes
|
||||
! the attribute's dataspace, attribute, dataset, and file.
|
||||
|
||||
PROGRAM ATTREXAMPLE
|
||||
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=8), PARAMETER :: filename = "dsetf.h5" ! File name
|
||||
CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name
|
||||
CHARACTER(LEN=9), PARAMETER :: aname = "attr_long" ! Attribute name
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: dset_id ! Dataset identifier
|
||||
INTEGER(HID_T) :: attr_id ! Attribute identifier
|
||||
INTEGER(HID_T) :: aspace_id ! Attribute Dataspace identifier
|
||||
INTEGER(HID_T) :: atype_id ! Attribute Dataspace identifier
|
||||
INTEGER(HSIZE_T), DIMENSION(1) :: adims = (/2/) ! Attribute dimension
|
||||
INTEGER :: arank = 1 ! Attribure rank
|
||||
INTEGER(SIZE_T) :: attrlen ! Length of the attribute string
|
||||
|
||||
! CHARACTER*27, DIMENSION(2) :: attr_data ! Attribute data
|
||||
CHARACTER*80, DIMENSION(2) :: attr_data ! Attribute data
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
|
||||
|
||||
!
|
||||
! Initialize attribute's data
|
||||
!
|
||||
attr_data(1) = "Dataset character attribute"
|
||||
attr_data(2) = "Some other string here "
|
||||
! attrlen = 27
|
||||
attrlen = 80
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
! Open an existing file.
|
||||
!
|
||||
CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)
|
||||
|
||||
!
|
||||
! Open an existing dataset.
|
||||
!
|
||||
CALL h5dopen_f(file_id, dsetname, dset_id, error)
|
||||
|
||||
!
|
||||
! Create scalar data space for the attribute.
|
||||
!
|
||||
CALL h5screate_simple_f(arank, adims, aspace_id, error)
|
||||
!
|
||||
! Create datatype for the attribute.
|
||||
!
|
||||
CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype_id, error)
|
||||
CALL h5tset_size_f(atype_id, attrlen, error)
|
||||
|
||||
!
|
||||
! Create dataset attribute.
|
||||
!
|
||||
CALL h5acreate_f(dset_id, aname, atype_id, aspace_id, &
|
||||
attr_id, error)
|
||||
|
||||
!
|
||||
! Write the attribute data.
|
||||
!
|
||||
CALL h5awrite_f(attr_id, atype_id, attr_data, error)
|
||||
|
||||
!
|
||||
! Close the attribute.
|
||||
!
|
||||
CALL h5aclose_f(attr_id, error)
|
||||
|
||||
!
|
||||
! Terminate access to the data space.
|
||||
!
|
||||
CALL h5sclose_f(aspace_id, error)
|
||||
|
||||
!
|
||||
! End access to the dataset and release resources used by it.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM ATTREXAMPLE
|
||||
|
215
fortran/examples/compound.f90
Normal file
215
fortran/examples/compound.f90
Normal file
@ -0,0 +1,215 @@
|
||||
!
|
||||
! This program creates a dataset that is one dimensional array of
|
||||
! structures {
|
||||
! character*2
|
||||
! integer
|
||||
! double precision
|
||||
! real
|
||||
! }
|
||||
! Data is written and read back by fields.
|
||||
!
|
||||
|
||||
PROGRAM COMPOUNDEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=11), PARAMETER :: filename = "compound.h5" ! File name
|
||||
CHARACTER(LEN=8), PARAMETER :: dsetname = "Compound" ! Dataset name
|
||||
INTEGER, PARAMETER :: dimsize = 6 ! Size of the dataset
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: dset_id ! Dataset identifier
|
||||
INTEGER(HID_T) :: dspace_id ! Dataspace identifier
|
||||
INTEGER(HID_T) :: dtype_id ! Compound datatype identifier
|
||||
INTEGER(HID_T) :: dt1_id ! Memory datatype identifier (for character field)
|
||||
INTEGER(HID_T) :: dt2_id ! Memory datatype identifier (for integer field)
|
||||
INTEGER(HID_T) :: dt3_id ! Memory datatype identifier (for double precision field)
|
||||
INTEGER(HID_T) :: dt4_id ! Memory datatype identifier (for real field)
|
||||
INTEGER(HID_T) :: dt5_id ! Memory datatype identifier
|
||||
INTEGER(HID_T) :: plist_id ! Dataset trasfer property
|
||||
INTEGER(SIZE_T) :: typesize
|
||||
|
||||
|
||||
INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/dimsize/) ! Dataset dimensions
|
||||
INTEGER :: rank = 1 ! Dataset rank
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
INTEGER(SIZE_T) :: type_size ! Size of the datatype
|
||||
INTEGER(SIZE_T) :: type_sizec ! Size of the character datatype
|
||||
INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
|
||||
INTEGER(SIZE_T) :: type_sized ! Size of the double precision datatype
|
||||
INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
|
||||
INTEGER(SIZE_T) :: offset ! Member's offset
|
||||
CHARACTER*2, DIMENSION(dimsize) :: char_member
|
||||
CHARACTER*2, DIMENSION(dimsize) :: char_member_out ! Buffer to read data out
|
||||
INTEGER, DIMENSION(dimsize) :: int_member
|
||||
DOUBLE PRECISION, DIMENSION(dimsize) :: double_member
|
||||
REAL, DIMENSION(dimsize) :: real_member
|
||||
INTEGER :: i
|
||||
!
|
||||
! Initialize data buffer.
|
||||
!
|
||||
do i = 1, dimsize
|
||||
char_member(i)(1:1) = char(65+i)
|
||||
char_member(i)(2:2) = char(65+i)
|
||||
char_member_out(i)(1:1) = char(65)
|
||||
char_member_out(i)(2:2) = char(65)
|
||||
int_member(i) = i
|
||||
double_member(i) = 2.* i
|
||||
real_member(i) = 3. * i
|
||||
enddo
|
||||
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
!
|
||||
! Set dataset transfer property to preserve partially initialized fields
|
||||
! during write/read to/from dataset with compound datatype.
|
||||
!
|
||||
CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error)
|
||||
CALL h5pset_preserve_f(plist_id, 1, error)
|
||||
|
||||
!
|
||||
! Create a new file using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
!
|
||||
! Create the dataspace.
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims, dspace_id, error)
|
||||
!
|
||||
! Create compound datatype.
|
||||
!
|
||||
! First calculate total size by calculating sizes of each member
|
||||
!
|
||||
CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dt5_id, error)
|
||||
typesize = 2
|
||||
CALL h5tset_size_f(dt5_id, typesize, error)
|
||||
CALL h5tget_size_f(dt5_id, type_sizec, error)
|
||||
CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, error)
|
||||
CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, error)
|
||||
CALL h5tget_size_f(H5T_NATIVE_REAL, type_sizer, error)
|
||||
type_size = type_sizec + type_sizei + type_sized + type_sizer
|
||||
CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dtype_id, error)
|
||||
!
|
||||
! Insert memebers
|
||||
!
|
||||
! CHARACTER*2 memeber
|
||||
!
|
||||
offset = 0
|
||||
CALL h5tinsert_f(dtype_id, "char_field", offset, dt5_id, error)
|
||||
!
|
||||
! INTEGER member
|
||||
!
|
||||
offset = offset + type_sizec ! Offset of the second memeber is 2
|
||||
CALL h5tinsert_f(dtype_id, "integer_field", offset, H5T_NATIVE_INTEGER, error)
|
||||
!
|
||||
! DOUBLE PRECISION member
|
||||
!
|
||||
offset = offset + type_sizei ! Offset of the third memeber is 6
|
||||
CALL h5tinsert_f(dtype_id, "double_field", offset, H5T_NATIVE_DOUBLE, error)
|
||||
!
|
||||
! REAL member
|
||||
!
|
||||
offset = offset + type_sized ! Offset of the last member is 14
|
||||
CALL h5tinsert_f(dtype_id, "real_field", offset, H5T_NATIVE_REAL, error)
|
||||
|
||||
!
|
||||
! Create the dataset with compound datatype.
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetname, dtype_id, dspace_id, &
|
||||
dset_id, error)
|
||||
!
|
||||
! Create memory types. We have to create a compound datatype
|
||||
! for each member we want to write.
|
||||
!
|
||||
CALL h5tcreate_f(H5T_COMPOUND_F, type_sizec, dt1_id, error)
|
||||
offset = 0
|
||||
CALL h5tinsert_f(dt1_id, "char_field", offset, dt5_id, error)
|
||||
!
|
||||
CALL h5tcreate_f(H5T_COMPOUND_F, type_sizei, dt2_id, error)
|
||||
offset = 0
|
||||
CALL h5tinsert_f(dt2_id, "integer_field", offset, H5T_NATIVE_INTEGER, error)
|
||||
!
|
||||
CALL h5tcreate_f(H5T_COMPOUND_F, type_sized, dt3_id, error)
|
||||
offset = 0
|
||||
CALL h5tinsert_f(dt3_id, "double_field", offset, H5T_NATIVE_DOUBLE, error)
|
||||
!
|
||||
CALL h5tcreate_f(H5T_COMPOUND_F, type_sizer, dt4_id, error)
|
||||
offset = 0
|
||||
CALL h5tinsert_f(dt4_id, "real_field", offset, H5T_NATIVE_REAL, error)
|
||||
!
|
||||
! Write data by fields in the datatype. Fields order is not important.
|
||||
!
|
||||
CALL h5dwrite_f(dset_id, dt4_id, real_member, error, xfer_prp = plist_id)
|
||||
CALL h5dwrite_f(dset_id, dt1_id, char_member, error, xfer_prp = plist_id)
|
||||
CALL h5dwrite_f(dset_id, dt3_id, double_member, error, xfer_prp = plist_id)
|
||||
CALL h5dwrite_f(dset_id, dt2_id, int_member, error, xfer_prp = plist_id)
|
||||
|
||||
!
|
||||
! End access to the dataset and release resources used by it.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
|
||||
!
|
||||
! Terminate access to the data space.
|
||||
!
|
||||
CALL h5sclose_f(dspace_id, error)
|
||||
!
|
||||
! Terminate access to the datatype
|
||||
!
|
||||
CALL h5tclose_f(dtype_id, error)
|
||||
CALL h5tclose_f(dt1_id, error)
|
||||
CALL h5tclose_f(dt2_id, error)
|
||||
CALL h5tclose_f(dt3_id, error)
|
||||
CALL h5tclose_f(dt4_id, error)
|
||||
CALL h5tclose_f(dt5_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
!
|
||||
! Open the file.
|
||||
!
|
||||
CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)
|
||||
!
|
||||
! Open the dataset.
|
||||
!
|
||||
CALL h5dopen_f(file_id, dsetname, dset_id, error)
|
||||
!
|
||||
! Create memeory datatyoe to read character member of the compound datatype.
|
||||
!
|
||||
CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dt2_id, error)
|
||||
typesize = 2
|
||||
CALL h5tset_size_f(dt2_id, typesize, error)
|
||||
CALL h5tget_size_f(dt2_id, type_size, error)
|
||||
CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dt1_id, error)
|
||||
offset = 0
|
||||
CALL h5tinsert_f(dt1_id, "char_field", offset, dt2_id, error)
|
||||
!
|
||||
! Read part of the datatset and display it.
|
||||
!
|
||||
CALL h5dread_f(dset_id, dt1_id, char_member_out, error)
|
||||
write(*,*) (char_member_out(i), i=1, dimsize)
|
||||
|
||||
!
|
||||
! Close all open objects.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
CALL h5tclose_f(dt1_id, error)
|
||||
CALL h5tclose_f(dt2_id, error)
|
||||
CALL h5fclose_f(file_id, error)
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM COMPOUNDEXAMPLE
|
||||
|
||||
|
70
fortran/examples/dsetexample.f90
Normal file
70
fortran/examples/dsetexample.f90
Normal file
@ -0,0 +1,70 @@
|
||||
!
|
||||
! The following example shows how to create an empty dataset.
|
||||
! It creates a file called 'dsetf.h5', defines the
|
||||
! dataset dataspace, creates a dataset which is a 4x6 integer array,
|
||||
! and then closes the dataspace, the dataset, and the file.
|
||||
!
|
||||
|
||||
PROGRAM DSETEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=8), PARAMETER :: filename = "dsetf.h5" ! File name
|
||||
CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: dset_id ! Dataset identifier
|
||||
INTEGER(HID_T) :: dspace_id ! Dataspace identifier
|
||||
|
||||
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions
|
||||
INTEGER :: rank = 2 ! Dataset rank
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
! Create a new file using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
!
|
||||
! Create the dataspace.
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims, dspace_id, error)
|
||||
|
||||
!
|
||||
! Create the dataset with default properties.
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, &
|
||||
dset_id, error)
|
||||
|
||||
!
|
||||
! End access to the dataset and release resources used by it.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
|
||||
!
|
||||
! Terminate access to the data space.
|
||||
!
|
||||
CALL h5sclose_f(dspace_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM DSETEXAMPLE
|
||||
|
||||
|
27
fortran/examples/fileexample.f90
Normal file
27
fortran/examples/fileexample.f90
Normal file
@ -0,0 +1,27 @@
|
||||
!
|
||||
! The following example demonstrates how to create and close an HDF5 file.
|
||||
! It creates a file called 'file.h5', and then closes the file.
|
||||
!
|
||||
|
||||
PROGRAM FILEEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=8), PARAMETER :: filename = "filef.h5" ! File name
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
|
||||
!
|
||||
! Create a new file using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
!
|
||||
! Terminate access to the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
END PROGRAM FILEEXAMPLE
|
42
fortran/examples/groupexample.f90
Normal file
42
fortran/examples/groupexample.f90
Normal file
@ -0,0 +1,42 @@
|
||||
!
|
||||
! The following example shows how to create and close a group.
|
||||
! It creates a file called 'group.h5', creates a group
|
||||
! called MyGroup in the root group, and then closes the group and file.
|
||||
!
|
||||
|
||||
|
||||
PROGRAM GROUPEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=9), PARAMETER :: filename = "groupf.h5" ! File name
|
||||
CHARACTER(LEN=7), PARAMETER :: groupname = "MyGroup" ! Group name
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: group_id ! Group identifier
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
|
||||
!
|
||||
! Create a new file using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
!
|
||||
! Create a group named "/MyGroup" in the file.
|
||||
!
|
||||
CALL h5gcreate_f(file_id, groupname, group_id, error)
|
||||
|
||||
!
|
||||
! Close the group.
|
||||
!
|
||||
CALL h5gclose_f(group_id, error)
|
||||
|
||||
!
|
||||
! Terminate access to the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
END PROGRAM GROUPEXAMPLE
|
136
fortran/examples/grpdsetexample.f90
Normal file
136
fortran/examples/grpdsetexample.f90
Normal file
@ -0,0 +1,136 @@
|
||||
!
|
||||
! This example shows how to create a dataset in a particular group.
|
||||
! It opens the file created in the previous example and creates two datasets.
|
||||
! Absolute and relative dataset names are used.
|
||||
!
|
||||
|
||||
|
||||
PROGRAM GRPDSETEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=10), PARAMETER :: filename = "groupsf.h5" ! File name
|
||||
CHARACTER(LEN=15), PARAMETER :: groupname = "MyGroup/Group_A" ! Group name
|
||||
CHARACTER(LEN=13), PARAMETER :: dsetname1 = "MyGroup/dset1" ! Dataset name
|
||||
CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! dataset name
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: group_id ! Group identifier
|
||||
INTEGER(HID_T) :: dataset_id ! Dataset identifier
|
||||
INTEGER(HID_T) :: dataspace_id ! Data space identifier
|
||||
|
||||
INTEGER :: i, j
|
||||
INTEGER :: error ! Error flag
|
||||
|
||||
INTEGER, DIMENSION(3,3) :: dset1_data ! Data arrays
|
||||
INTEGER, DIMENSION(2,10) :: dset2_data !
|
||||
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/3,3/) ! Datasets dimensions
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims2 = (/2,10/)!
|
||||
|
||||
INTEGER :: rank = 2 ! Datasets rank
|
||||
|
||||
!
|
||||
!Initialize dset1_data array
|
||||
!
|
||||
do i = 1, 3
|
||||
do j = 1, 3
|
||||
dset1_data(i,j) = j;
|
||||
end do
|
||||
end do
|
||||
|
||||
|
||||
!
|
||||
!Initialize dset2_data array
|
||||
!
|
||||
do i = 1, 2
|
||||
do j = 1, 10
|
||||
dset2_data(i,j) = j;
|
||||
end do
|
||||
end do
|
||||
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
! Open an existing file.
|
||||
!
|
||||
CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)
|
||||
|
||||
!
|
||||
! Create the data space for the first dataset.
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims1, dataspace_id, error)
|
||||
|
||||
!
|
||||
! Create a dataset in group "MyGroup" with default properties.
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetname1, H5T_NATIVE_INTEGER, dataspace_id, &
|
||||
dataset_id, error)
|
||||
|
||||
!
|
||||
! Write the first dataset.
|
||||
!
|
||||
CALL h5dwrite_f(dataset_id, H5T_NATIVE_INTEGER, dset1_data, error)
|
||||
|
||||
!
|
||||
! Close the dataspace for the first dataset.
|
||||
!
|
||||
CALL h5sclose_f(dataspace_id, error)
|
||||
|
||||
!
|
||||
! Close the first dataset.
|
||||
!
|
||||
CALL h5dclose_f(dataset_id, error)
|
||||
|
||||
!
|
||||
! Open an existing group in the specified file.
|
||||
!
|
||||
CALL h5gopen_f(file_id, groupname, group_id, error)
|
||||
|
||||
!
|
||||
!Create the data space for the second dataset.
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims2, dataspace_id, error)
|
||||
|
||||
!
|
||||
! Create the second dataset in group "Group_A" with default properties.
|
||||
!
|
||||
CALL h5dcreate_f(group_id, dsetname2, H5T_NATIVE_INTEGER, dataspace_id, &
|
||||
dataset_id, error)
|
||||
|
||||
!
|
||||
! Write the second dataset.
|
||||
!
|
||||
CALL h5dwrite_f(dataset_id, H5T_NATIVE_INTEGER, dset2_data, error)
|
||||
|
||||
!
|
||||
! Close the dataspace for the second dataset.
|
||||
!
|
||||
CALL h5sclose_f(dataspace_id, error)
|
||||
|
||||
!
|
||||
! Close the second dataset.
|
||||
!
|
||||
CALL h5dclose_f(dataset_id, error)
|
||||
|
||||
!
|
||||
! Close the group.
|
||||
!
|
||||
CALL h5gclose_f(group_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM GRPDSETEXAMPLE
|
189
fortran/examples/grpit.f90
Normal file
189
fortran/examples/grpit.f90
Normal file
@ -0,0 +1,189 @@
|
||||
!
|
||||
! In this example we iterate through the members of the groups.
|
||||
!
|
||||
|
||||
|
||||
PROGRAM GRPITEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=11), PARAMETER :: filename = "iteratef.h5" ! File name
|
||||
CHARACTER(LEN=7), PARAMETER :: groupname1 = "MyGroup" ! Group name
|
||||
CHARACTER(LEN=15), PARAMETER :: groupname2 = "Group_A" ! Group name
|
||||
CHARACTER(LEN=13), PARAMETER :: dsetname1 = "dset1" ! Dataset name
|
||||
CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" !
|
||||
|
||||
CHARACTER(LEN=20) :: name_buffer ! Buffer to hold object's name
|
||||
INTEGER :: type ! Type of the object
|
||||
INTEGER :: nmembers ! Number of group members
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: dataset1_id ! Dataset1 identifier
|
||||
INTEGER(HID_T) :: dataset2_id ! Dataset2 identifier
|
||||
INTEGER(HID_T) :: dataspace1_id ! Data space identifier
|
||||
INTEGER(HID_T) :: dataspace2_id ! Data space identifier
|
||||
INTEGER(HID_T) :: group1_id, group2_id ! Group identifiers
|
||||
|
||||
INTEGER :: i, j
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
|
||||
INTEGER, DIMENSION(3,3) :: dset1_data ! Arrays to hold data
|
||||
INTEGER, DIMENSION(2,10) :: dset2_data !
|
||||
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/3,3/) ! Dataset dimensions
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims2 = (/2,10/)!
|
||||
INTEGER :: rank = 2 ! Datasets rank
|
||||
|
||||
!
|
||||
! Initialize dset1_data array.
|
||||
!
|
||||
do i = 1, 3
|
||||
do j = 1, 3
|
||||
dset1_data(i,j) = j;
|
||||
end do
|
||||
end do
|
||||
|
||||
|
||||
!
|
||||
! Initialize dset2_data array.
|
||||
!
|
||||
do i = 1, 2
|
||||
do j = 1, 10
|
||||
dset2_data(i,j) = j;
|
||||
end do
|
||||
end do
|
||||
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
! Create a new file using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
!
|
||||
! Create group "MyGroup" in the root group using absolute name.
|
||||
!
|
||||
CALL h5gcreate_f(file_id, groupname1, group1_id, error)
|
||||
|
||||
!
|
||||
! Create group "Group_A" in group "MyGroup" using relative name.
|
||||
!
|
||||
CALL h5gcreate_f(group1_id, groupname2, group2_id, error)
|
||||
|
||||
!
|
||||
! Create the data space for the first dataset.
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims1, dataspace1_id, error)
|
||||
|
||||
!
|
||||
! Create a dataset in group "MyGroup" with default properties.
|
||||
!
|
||||
CALL h5dcreate_f(group1_id, dsetname1, H5T_NATIVE_INTEGER, dataspace1_id, &
|
||||
dataset1_id, error)
|
||||
|
||||
!
|
||||
! Write the first dataset.
|
||||
!
|
||||
CALL h5dwrite_f(dataset1_id, H5T_NATIVE_INTEGER, dset1_data, error)
|
||||
|
||||
!
|
||||
! Create the data space for the second dataset.
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims2, dataspace2_id, error)
|
||||
|
||||
!
|
||||
! Create the second dataset in group "Group_A" with default properties
|
||||
!
|
||||
CALL h5dcreate_f(group2_id, dsetname2, H5T_NATIVE_INTEGER, dataspace2_id, &
|
||||
dataset2_id, error)
|
||||
|
||||
!
|
||||
! Write the second dataset
|
||||
!
|
||||
CALL h5dwrite_f(dataset2_id, H5T_NATIVE_INTEGER, dset2_data, error)
|
||||
|
||||
!
|
||||
! Get number of members in the root group.
|
||||
!
|
||||
CALL h5gn_members_f(file_id, "/", nmembers, error)
|
||||
write(*,*) "Number of root group member is " , nmembers
|
||||
|
||||
!
|
||||
! Print each group member's name and type.
|
||||
!
|
||||
do i = 0, nmembers - 1
|
||||
CALL h5gget_obj_info_idx_f(file_id, "/", i, name_buffer, type, &
|
||||
error)
|
||||
write(*,*) name_buffer, type
|
||||
end do
|
||||
|
||||
!
|
||||
! Get number of members in MyGroup.
|
||||
!
|
||||
CALL h5gn_members_f(file_id, "MyGroup", nmembers, error)
|
||||
write(*,*) "Number of group MyGroup member is ", nmembers
|
||||
|
||||
!
|
||||
! Print each group member's name and type in "MyGroup" group.
|
||||
!
|
||||
do i = 0, nmembers - 1
|
||||
CALL h5gget_obj_info_idx_f(file_id, groupname1, i, name_buffer, type, &
|
||||
error)
|
||||
write(*,*) name_buffer, type
|
||||
end do
|
||||
|
||||
|
||||
!
|
||||
! Get number of members in MyGroup/Group_A.
|
||||
!
|
||||
CALL h5gn_members_f(file_id, "MyGroup/Group_A", nmembers, error)
|
||||
write(*,*) "Number of group MyGroup/Group_A member is ", nmembers
|
||||
|
||||
!
|
||||
! Print each group member's name and type in "MyGroup/Group_A" group.
|
||||
!
|
||||
do i = 0, nmembers - 1
|
||||
CALL h5gget_obj_info_idx_f(file_id,"MyGroup/Group_A" , i, name_buffer, type, &
|
||||
error)
|
||||
write(*,*) name_buffer, type
|
||||
end do
|
||||
|
||||
!
|
||||
! Close the dataspace for the first dataset.
|
||||
!
|
||||
CALL h5sclose_f(dataspace1_id, error)
|
||||
|
||||
!
|
||||
! Close the first dataset.
|
||||
!
|
||||
CALL h5dclose_f(dataset1_id, error)
|
||||
|
||||
!
|
||||
! Close the dataspace for the second dataset.
|
||||
!
|
||||
CALL h5sclose_f(dataspace2_id, error)
|
||||
|
||||
!
|
||||
! Close the second dataset.
|
||||
!
|
||||
CALL h5dclose_f(dataset2_id, error)
|
||||
|
||||
!
|
||||
! Close the groups.
|
||||
!
|
||||
CALL h5gclose_f(group1_id, error)
|
||||
|
||||
CALL h5gclose_f(group2_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
END PROGRAM GRPITEXAMPLE
|
59
fortran/examples/grpsexample.f90
Normal file
59
fortran/examples/grpsexample.f90
Normal file
@ -0,0 +1,59 @@
|
||||
!
|
||||
! The following example code shows how to create groups
|
||||
! using absolute and relative names. It creates three groups:
|
||||
! the first two groups are created using the file identifier and
|
||||
! the group absolute names, and the third group is created using
|
||||
! a group identifier and the name relative to the specified group.
|
||||
!
|
||||
|
||||
|
||||
PROGRAM GRPSEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=10), PARAMETER :: filename = "groupsf.h5" ! File name
|
||||
CHARACTER(LEN=8), PARAMETER :: groupname1 = "/MyGroup" ! Group name
|
||||
CHARACTER(LEN=16), PARAMETER :: groupname2 = "/MyGroup/Group_A"
|
||||
! Group name
|
||||
CHARACTER(LEN=7), PARAMETER :: groupname3 = "Group_B" ! Group name
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: group1_id, group2_id, group3_id ! Group identifiers
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
|
||||
!
|
||||
! Create a new file using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
!
|
||||
! Create group "MyGroup" in the root group using absolute name.
|
||||
!
|
||||
CALL h5gcreate_f(file_id, groupname1, group1_id, error)
|
||||
|
||||
!
|
||||
! Create group "Group_A" in group "MyGroup" using absolute name.
|
||||
!
|
||||
CALL h5gcreate_f(file_id, groupname2, group2_id, error)
|
||||
|
||||
!
|
||||
! Create group "Group_B" in group "MyGroup" using relative name.
|
||||
!
|
||||
CALL h5gcreate_f(group1_id, groupname3, group3_id, error)
|
||||
|
||||
!
|
||||
! Close the groups.
|
||||
!
|
||||
CALL h5gclose_f(group1_id, error)
|
||||
CALL h5gclose_f(group2_id, error)
|
||||
CALL h5gclose_f(group3_id, error)
|
||||
|
||||
!
|
||||
! Terminate access to the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
END PROGRAM GRPSEXAMPLE
|
199
fortran/examples/hyperslab.f90
Normal file
199
fortran/examples/hyperslab.f90
Normal file
@ -0,0 +1,199 @@
|
||||
!
|
||||
! This example shows how to write and read a hyperslab.
|
||||
!
|
||||
|
||||
PROGRAM SELECTEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=7), PARAMETER :: filename = "sdsf.h5" ! File name
|
||||
CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" ! Dataset name
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: dset_id ! Dataset identifier
|
||||
INTEGER(HID_T) :: dataspace ! Dataspace identifier
|
||||
INTEGER(HID_T) :: memspace ! memspace identifier
|
||||
|
||||
INTEGER(HSIZE_T), DIMENSION(3) :: dimsm = (/7,7,3/) ! Dataset dimensions
|
||||
! in memory
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims_out ! Buffer to read in dataset
|
||||
! dimesions
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/5,6/) ! Dataset dimensions.
|
||||
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: count = (/3,4/)
|
||||
! Size of the hyperslab in the file
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: offset = (/1,2/)
|
||||
!hyperslab offset in the file
|
||||
INTEGER(HSIZE_T), DIMENSION(3) :: count_out = (/3,4,1/)
|
||||
!Size of the hyperslab in memory
|
||||
INTEGER(HSIZE_T), DIMENSION(3) :: offset_out = (/3,0,0/)
|
||||
!hyperslab offset in memory
|
||||
INTEGER, DIMENSION(5,6) :: data ! Data to write
|
||||
INTEGER, DIMENSION(7,7,3) :: data_out ! Output buffer
|
||||
INTEGER :: dsetrank = 2 ! Dataset rank ( in file )
|
||||
INTEGER :: memrank = 3 ! Dataset rank ( in memory )
|
||||
INTEGER :: rank
|
||||
INTEGER :: i, j, k
|
||||
|
||||
INTEGER :: error, error_n ! Error flags
|
||||
|
||||
|
||||
!
|
||||
! Write data to the HDF5 file.
|
||||
!
|
||||
|
||||
!
|
||||
! Data initialization.
|
||||
!
|
||||
do i = 1, 5
|
||||
do j = 1, 6
|
||||
data(i,j) = (i-1) + (j-1);
|
||||
end do
|
||||
end do
|
||||
!
|
||||
! 0, 1, 2, 3, 4, 5
|
||||
! 1, 2, 3, 4, 5, 6
|
||||
! 2, 3, 4, 5, 6, 7
|
||||
! 3, 4, 5, 6, 7, 8
|
||||
! 4, 5, 6, 7, 8, 9
|
||||
!
|
||||
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
! Create a new file using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
!
|
||||
! Create the data space for the dataset.
|
||||
!
|
||||
CALL h5screate_simple_f(dsetrank, dimsf, dataspace, error)
|
||||
|
||||
!
|
||||
! Create the dataset with default properties.
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, &
|
||||
dset_id, error)
|
||||
|
||||
!
|
||||
! Write the dataset.
|
||||
!
|
||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, error)
|
||||
|
||||
!
|
||||
! Close the dataspace for the dataset.
|
||||
!
|
||||
CALL h5sclose_f(dataspace, error)
|
||||
|
||||
!
|
||||
! Close the dataset.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
!
|
||||
! This part of the code reads the hyperslab from the sds.h5 file just
|
||||
! created, into a 2-dimensional plane of the 3-dimensional dataset.
|
||||
!
|
||||
|
||||
!
|
||||
! Initialize data_out array.
|
||||
!
|
||||
do i = 1, 7
|
||||
do j = 1, 7
|
||||
do k = 1,3
|
||||
data_out(i,j,k) = 0;
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
||||
!
|
||||
! Open the file.
|
||||
!
|
||||
CALL h5fopen_f (filename, H5F_ACC_RDONLY_F, file_id, error)
|
||||
|
||||
!
|
||||
! Open the dataset.
|
||||
!
|
||||
CALL h5dopen_f(file_id, dsetname, dset_id, error)
|
||||
|
||||
!
|
||||
! Get dataset's dataspace identifier.
|
||||
!
|
||||
CALL h5dget_space_f(dset_id, dataspace, error)
|
||||
|
||||
!
|
||||
! Select hyperslab in the dataset.
|
||||
!
|
||||
CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, &
|
||||
offset, count, error)
|
||||
!
|
||||
! Create memory dataspace.
|
||||
!
|
||||
CALL h5screate_simple_f(memrank, dimsm, memspace, error)
|
||||
|
||||
!
|
||||
! Select hyperslab in memory.
|
||||
!
|
||||
CALL h5sselect_hyperslab_f(memspace, H5S_SELECT_SET_F, &
|
||||
offset_out, count_out, error)
|
||||
|
||||
!
|
||||
! Read data from hyperslab in the file into the hyperslab in
|
||||
! memory and display.
|
||||
!
|
||||
CALL H5Dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, error, &
|
||||
memspace, dataspace)
|
||||
|
||||
!
|
||||
! Display data_out array
|
||||
!
|
||||
do i = 1, 7
|
||||
print *, (data_out(i,j,1), j = 1,7)
|
||||
end do
|
||||
|
||||
! 0 0 0 0 0 0 0
|
||||
! 0 0 0 0 0 0 0
|
||||
! 0 0 0 0 0 0 0
|
||||
! 3 4 5 6 0 0 0
|
||||
! 4 5 6 7 0 0 0
|
||||
! 5 6 7 8 0 0 0
|
||||
! 0 0 0 0 0 0 0
|
||||
!
|
||||
|
||||
!
|
||||
! Close the dataspace for the dataset.
|
||||
!
|
||||
CALL h5sclose_f(dataspace, error)
|
||||
|
||||
!
|
||||
! Close the memoryspace.
|
||||
!
|
||||
CALL h5sclose_f(memspace, error)
|
||||
|
||||
!
|
||||
! Close the dataset.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM SELECTEXAMPLE
|
183
fortran/examples/mountexample.f90
Normal file
183
fortran/examples/mountexample.f90
Normal file
@ -0,0 +1,183 @@
|
||||
!
|
||||
!In the following example we create one file with a group in it,
|
||||
!and another file with a dataset. Mounting is used to
|
||||
!access the dataset from the second file as a member of a group
|
||||
!in the first file.
|
||||
!
|
||||
|
||||
PROGRAM MOUNTEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
!
|
||||
!the respective filename is "mount1.h5" and "mount2.h5"
|
||||
!
|
||||
CHARACTER(LEN=9), PARAMETER :: filename1 = "mount1.h5"
|
||||
CHARACTER(LEN=9), PARAMETER :: filename2 = "mount2.h5"
|
||||
|
||||
!
|
||||
!data space rank and dimensions
|
||||
!
|
||||
INTEGER, PARAMETER :: RANK = 2
|
||||
INTEGER, PARAMETER :: NX = 4
|
||||
INTEGER, PARAMETER :: NY = 5
|
||||
|
||||
!
|
||||
! File identifiers
|
||||
!
|
||||
INTEGER(HID_T) :: file1_id, file2_id
|
||||
|
||||
!
|
||||
! Group identifier
|
||||
!
|
||||
INTEGER(HID_T) :: gid
|
||||
|
||||
!
|
||||
! dataset identifier
|
||||
!
|
||||
INTEGER(HID_T) :: dset_id
|
||||
|
||||
!
|
||||
! data space identifier
|
||||
!
|
||||
INTEGER(HID_T) :: dataspace
|
||||
|
||||
!
|
||||
! data type identifier
|
||||
!
|
||||
INTEGER(HID_T) :: dtype_id
|
||||
|
||||
!
|
||||
!The dimensions for the dataset.
|
||||
!
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/)
|
||||
|
||||
!
|
||||
!flag to check operation success
|
||||
!
|
||||
INTEGER :: error
|
||||
|
||||
!
|
||||
!general purpose integer
|
||||
!
|
||||
INTEGER :: i, j
|
||||
|
||||
!
|
||||
!data buffers
|
||||
!
|
||||
INTEGER, DIMENSION(NX,NY) :: data_in, data_out
|
||||
|
||||
!
|
||||
!Initialize FORTRAN predifined datatypes
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
!Initialize data_in buffer
|
||||
!
|
||||
do i = 1, NX
|
||||
do j = 1, NY
|
||||
data_in(i,j) = (i-1) + (j-1)
|
||||
end do
|
||||
end do
|
||||
|
||||
!
|
||||
!Create first file "mount1.h5" using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename1, H5F_ACC_TRUNC_F, file1_id, error)
|
||||
|
||||
!
|
||||
!Create group "/G" inside file "mount1.h5".
|
||||
!
|
||||
CALL h5gcreate_f(file1_id, "/G", gid, error)
|
||||
|
||||
!
|
||||
!close file and group identifiers.
|
||||
!
|
||||
CALL h5gclose_f(gid, error)
|
||||
CALL h5fclose_f(file1_id, error)
|
||||
|
||||
!
|
||||
!Create second file "mount2.h5" using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename2, H5F_ACC_TRUNC_F, file2_id, error)
|
||||
|
||||
!
|
||||
!Create data space for the dataset.
|
||||
!
|
||||
CALL h5screate_simple_f(RANK, dims, dataspace, error)
|
||||
|
||||
!
|
||||
!Create dataset "/D" inside file "mount2.h5".
|
||||
!
|
||||
CALL h5dcreate_f(file2_id, "/D", H5T_NATIVE_INTEGER, dataspace, &
|
||||
dset_id, error)
|
||||
|
||||
!
|
||||
! Write data_in to the dataset
|
||||
!
|
||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, error)
|
||||
|
||||
!
|
||||
!close file, dataset and dataspace identifiers.
|
||||
!
|
||||
CALL h5sclose_f(dataspace, error)
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
CALL h5fclose_f(file2_id, error)
|
||||
|
||||
!
|
||||
!reopen both files.
|
||||
!
|
||||
CALL h5fopen_f (filename1, H5F_ACC_RDWR_F, file1_id, error)
|
||||
CALL h5fopen_f (filename2, H5F_ACC_RDWR_F, file2_id, error)
|
||||
|
||||
!
|
||||
!mount the second file under the first file's "/G" group.
|
||||
!
|
||||
CALL h5fmount_f (file1_id, "/G", file2_id, error)
|
||||
|
||||
|
||||
!
|
||||
!Access dataset D in the first file under /G/D name.
|
||||
!
|
||||
CALL h5dopen_f(file1_id, "/G/D", dset_id, error)
|
||||
|
||||
!
|
||||
!Get dataset's data type.
|
||||
!
|
||||
CALL h5dget_type_f(dset_id, dtype_id, error)
|
||||
|
||||
!
|
||||
!Read the dataset.
|
||||
!
|
||||
CALL h5dread_f(dset_id, dtype_id, data_out, error)
|
||||
|
||||
!
|
||||
!Print out the data.
|
||||
!
|
||||
do i = 1, NX
|
||||
print *, (data_out(i,j), j = 1, NY)
|
||||
end do
|
||||
|
||||
|
||||
!
|
||||
!Close dset_id and dtype_id.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
CALL h5tclose_f(dtype_id, error)
|
||||
|
||||
!
|
||||
!unmount the second file.
|
||||
!
|
||||
CALL h5funmount_f(file1_id, "/G", error);
|
||||
|
||||
!
|
||||
!Close both files.
|
||||
!
|
||||
CALL h5fclose_f(file1_id, error)
|
||||
CALL h5fclose_f(file2_id, error)
|
||||
|
||||
END PROGRAM MOUNTEXAMPLE
|
||||
|
136
fortran/examples/refobjexample.f90
Normal file
136
fortran/examples/refobjexample.f90
Normal file
@ -0,0 +1,136 @@
|
||||
!
|
||||
! This program shows how to create and store references to the objects.
|
||||
! Program creates a file, two groups, a dataset to store integer data and
|
||||
! a dataset to store references to the objects.
|
||||
! Stored references are used to open the objects they are point to.
|
||||
! Data is written to the dereferenced dataset, and class type is displayed for
|
||||
! the shared datatype.
|
||||
!
|
||||
PROGRAM OBJ_REFERENCES
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=10), PARAMETER :: filename = "FORTRAN.h5" ! File
|
||||
CHARACTER(LEN=8), PARAMETER :: dsetnamei = "INTEGERS" ! Dataset with the integer data
|
||||
CHARACTER(LEN=17), PARAMETER :: dsetnamer = "OBJECT_REFERENCES" ! Dataset wtih object
|
||||
! references
|
||||
CHARACTER(LEN=6), PARAMETER :: groupname1 = "GROUP1" ! Groups in the file
|
||||
CHARACTER(LEN=6), PARAMETER :: groupname2 = "GROUP2" !
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: grp1_id ! Group identifiers
|
||||
INTEGER(HID_T) :: grp2_id !
|
||||
INTEGER(HID_T) :: dset_id ! Dataset identifiers
|
||||
INTEGER(HID_T) :: dsetr_id !
|
||||
INTEGER(HID_T) :: type_id ! Type identifier
|
||||
INTEGER(HID_T) :: space_id ! Dataspace identifiers
|
||||
INTEGER(HID_T) :: spacer_id !
|
||||
INTEGER :: error
|
||||
INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/5/)
|
||||
INTEGER(HSIZE_T), DIMENSION(1) :: dimsr= (/4/)
|
||||
INTEGER(HSIZE_T), DIMENSION(1) :: my_maxdims = (/5/)
|
||||
INTEGER :: rank = 1
|
||||
INTEGER :: rankr = 1
|
||||
TYPE(hobj_ref_t_f), DIMENSION(4) :: ref
|
||||
TYPE(hobj_ref_t_f), DIMENSION(4) :: ref_out
|
||||
INTEGER, DIMENSION(5) :: data = (/1, 2, 3, 4, 5/)
|
||||
INTEGER :: class
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
!
|
||||
! Create a file
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
! Default file access and file creation
|
||||
! properties are used.
|
||||
!
|
||||
! Create a group in the file
|
||||
!
|
||||
CALL h5gcreate_f(file_id, groupname1, grp1_id, error)
|
||||
!
|
||||
! Create a group inside the created gorup
|
||||
!
|
||||
CALL h5gcreate_f(grp1_id, groupname2, grp2_id, error)
|
||||
!
|
||||
! Create dataspaces for datasets
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims, space_id, error, maxdims=my_maxdims)
|
||||
CALL h5screate_simple_f(rankr, dimsr, spacer_id, error)
|
||||
!
|
||||
! Create integer dataset
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetnamei, H5T_NATIVE_INTEGER, space_id, &
|
||||
dset_id, error)
|
||||
!
|
||||
! Create dataset to store references to the objects
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_OBJ, spacer_id, &
|
||||
dsetr_id, error)
|
||||
!
|
||||
! Create a datatype and store in the file
|
||||
!
|
||||
CALL h5tcopy_f(H5T_NATIVE_REAL, type_id, error)
|
||||
CALL h5tcommit_f(file_id, "MyType", type_id, error)
|
||||
!
|
||||
! Close dataspaces, groups and integer dataset
|
||||
!
|
||||
CALL h5sclose_f(space_id, error)
|
||||
CALL h5sclose_f(spacer_id, error)
|
||||
CALL h5tclose_f(type_id, error)
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
CALL h5gclose_f(grp1_id, error)
|
||||
CALL h5gclose_f(grp2_id, error)
|
||||
!
|
||||
! Create references to two groups, integer dataset and shared datatype
|
||||
! and write it to the dataset in the file
|
||||
!
|
||||
CALL h5rcreate_f(file_id, groupname1, ref(1), error)
|
||||
CALL h5rcreate_f(file_id, "/GROUP1/GROUP2", ref(2), error)
|
||||
CALL h5rcreate_f(file_id, dsetnamei, ref(3), error)
|
||||
CALL h5rcreate_f(file_id, "MyType", ref(4), error)
|
||||
CALL h5dwrite_f(dsetr_id, H5T_STD_REF_OBJ, ref, error)
|
||||
!
|
||||
! Close the dataset
|
||||
!
|
||||
CALL h5dclose_f(dsetr_id, error)
|
||||
!
|
||||
! Reopen the dataset with object references and read references to the buffer
|
||||
!
|
||||
CALL h5dopen_f(file_id, dsetnamer,dsetr_id,error)
|
||||
CALL h5dread_f(dsetr_id, H5T_STD_REF_OBJ, ref_out, error)
|
||||
!
|
||||
! Dereference the third reference. We know that it is a dataset. On practice
|
||||
! one should use h5rget_object_type_f function to find out
|
||||
! the type of an object the reference points to.
|
||||
!
|
||||
CALL h5rdereference_f(dsetr_id, ref(3), dset_id, error)
|
||||
!
|
||||
! Write data to the dataset.
|
||||
!
|
||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, error)
|
||||
if (error .eq. 0) write(*,*) "Data has been successfully written to the dataset "
|
||||
!
|
||||
! Dereference the fourth reference. We know that it is a datatype. On practice
|
||||
! one should use h5rget_object_type_f function to find out
|
||||
! the type of an object the reference points to.
|
||||
!
|
||||
CALL h5rdereference_f(dsetr_id, ref(4), type_id, error)
|
||||
!
|
||||
! Get datatype class and display it if it is of a FLOAT class.
|
||||
!
|
||||
CALL h5tget_class_f(type_id, class, error)
|
||||
if(class .eq. H5T_FLOAT_F) write(*,*) "Stored datatype is of a FLOAT class"
|
||||
!
|
||||
! Close all objects.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
CALL h5tclose_f(type_id, error)
|
||||
CALL h5dclose_f(dsetr_id, error)
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
END PROGRAM OBJ_REFERENCES
|
||||
|
||||
|
159
fortran/examples/refregexample.f90
Normal file
159
fortran/examples/refregexample.f90
Normal file
@ -0,0 +1,159 @@
|
||||
!
|
||||
! This program shows how to create, store and dereference references
|
||||
! to the dataset regions.
|
||||
! Program creates a file and writes two dimensional integer dataset
|
||||
! to it. Then program creates and stores references to the hyperslab
|
||||
! and 3 points selected in the integer dataset, in the second dataset.
|
||||
! Program reopens the second dataset, reads and dereferences region
|
||||
! references, and then reads and displays selected data from the
|
||||
! integer dataset.
|
||||
!
|
||||
PROGRAM REG_REFERENCE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=10), PARAMETER :: filename = "FORTRAN.h5"
|
||||
CHARACTER(LEN=6), PARAMETER :: dsetnamev = "MATRIX"
|
||||
CHARACTER(LEN=17), PARAMETER :: dsetnamer = "REGION_REFERENCES"
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: space_id ! Dataspace identifier
|
||||
INTEGER(HID_T) :: spacer_id ! Dataspace identifier
|
||||
INTEGER(HID_T) :: dsetv_id ! Dataset identifier
|
||||
INTEGER(HID_T) :: dsetr_id ! Dataset identifier
|
||||
INTEGER :: error
|
||||
TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref ! Buffers to store references
|
||||
TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out !
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions
|
||||
INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) !
|
||||
INTEGER(HSSIZE_T), DIMENSION(2) :: start
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: count
|
||||
INTEGER :: rankr = 1
|
||||
INTEGER :: rank = 2
|
||||
INTEGER , DIMENSION(2,9) :: data
|
||||
INTEGER , DIMENSION(2,9) :: data_out = 0
|
||||
INTEGER(HSSIZE_T) , DIMENSION(2,3) :: coord
|
||||
INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points
|
||||
INTEGER :: i, j
|
||||
coord = reshape((/1,1,2,7,1,9/), (/2,3/)) ! Coordinates of selected points
|
||||
data = reshape ((/1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6/), (/2,9/))
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
!
|
||||
! Create a new file.
|
||||
!
|
||||
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
! Default file access and file creation
|
||||
! properties are used.
|
||||
!
|
||||
! Create dataspaces:
|
||||
!
|
||||
! for dataset with references to dataset regions
|
||||
!
|
||||
CALL h5screate_simple_f(rankr, dimsr, spacer_id, error)
|
||||
!
|
||||
! for integer dataset
|
||||
!
|
||||
CALL h5screate_simple_f(rank, dims, space_id, error)
|
||||
!
|
||||
! Create and write datasets:
|
||||
!
|
||||
! Integer dataset
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetnamev, H5T_NATIVE_INTEGER, space_id, &
|
||||
dsetv_id, error)
|
||||
CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, data, error)
|
||||
CALL h5dclose_f(dsetv_id, error)
|
||||
!
|
||||
! Dataset with references
|
||||
!
|
||||
CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, &
|
||||
dsetr_id, error)
|
||||
!
|
||||
! Create a reference to the hyperslab selection.
|
||||
!
|
||||
start(1) = 0
|
||||
start(2) = 3
|
||||
count(1) = 2
|
||||
count(2) = 3
|
||||
CALL h5sselect_hyperslab_f(space_id, H5S_SELECT_SET_F, &
|
||||
start, count, error)
|
||||
CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(1), error)
|
||||
!
|
||||
! Create a reference to elements selection.
|
||||
!
|
||||
CALL h5sselect_none_f(space_id, error)
|
||||
CALL h5sselect_elements_f(space_id, H5S_SELECT_SET_F, rank, num_points,&
|
||||
coord, error)
|
||||
CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(2), error)
|
||||
!
|
||||
! Write dataset with the references.
|
||||
!
|
||||
CALL h5dwrite_f(dsetr_id, H5T_STD_REF_DSETREG, ref, error)
|
||||
!
|
||||
! Close all objects.
|
||||
!
|
||||
CALL h5sclose_f(space_id, error)
|
||||
CALL h5sclose_f(spacer_id, error)
|
||||
CALL h5dclose_f(dsetr_id, error)
|
||||
CALL h5fclose_f(file_id, error)
|
||||
!
|
||||
! Reopen the file to test selections.
|
||||
!
|
||||
CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)
|
||||
CALL h5dopen_f(file_id, dsetnamer, dsetr_id, error)
|
||||
!
|
||||
! Read references to the dataset regions.
|
||||
!
|
||||
CALL h5dread_f(dsetr_id, H5T_STD_REF_DSETREG, ref_out, error)
|
||||
!
|
||||
! Dereference the first reference.
|
||||
!
|
||||
CALL H5rdereference_f(dsetr_id, ref_out(1), dsetv_id, error)
|
||||
CALL H5rget_region_f(dsetr_id, ref_out(1), space_id, error)
|
||||
!
|
||||
! Read selected data from the dataset.
|
||||
!
|
||||
CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, error, &
|
||||
mem_space_id = space_id, file_space_id = space_id)
|
||||
write(*,*) "Hypeslab selection"
|
||||
write(*,*)
|
||||
do i = 1,2
|
||||
write(*,*) (data_out (i,j), j = 1,9)
|
||||
enddo
|
||||
write(*,*)
|
||||
CALL h5sclose_f(space_id, error)
|
||||
CALL h5dclose_f(dsetv_id, error)
|
||||
data_out = 0
|
||||
!
|
||||
! Dereference the second reference.
|
||||
!
|
||||
CALL H5rdereference_f(dsetr_id, ref_out(2), dsetv_id, error)
|
||||
CALL H5rget_region_f(dsetr_id, ref_out(2), space_id, error)
|
||||
!
|
||||
! Read selected data from the dataset.
|
||||
!
|
||||
CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, error, &
|
||||
mem_space_id = space_id, file_space_id = space_id)
|
||||
write(*,*) "Point selection"
|
||||
write(*,*)
|
||||
do i = 1,2
|
||||
write(*,*) (data_out (i,j), j = 1,9)
|
||||
enddo
|
||||
!
|
||||
! Close all objects
|
||||
!
|
||||
CALL h5sclose_f(space_id, error)
|
||||
CALL h5dclose_f(dsetv_id, error)
|
||||
CALL h5dclose_f(dsetr_id, error)
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM REG_REFERENCE
|
||||
|
||||
|
13
fortran/examples/run_examples.sh
Executable file
13
fortran/examples/run_examples.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/csh
|
||||
./dsetexample
|
||||
./fileexample
|
||||
./rwdsetexample
|
||||
./attrexample
|
||||
./groupexample
|
||||
./grpsexample
|
||||
./grpdsetexample
|
||||
./hyperslab
|
||||
./selectele
|
||||
./grpit
|
||||
./refobjexample
|
||||
./refregexample
|
78
fortran/examples/rwdsetexample.f90
Normal file
78
fortran/examples/rwdsetexample.f90
Normal file
@ -0,0 +1,78 @@
|
||||
!
|
||||
! The following example shows how to write and read to/from an existing dataset.
|
||||
! It opens the file created in the previous example, obtains the dataset
|
||||
! identifier, writes the data to the dataset in the file,
|
||||
! then reads the dataset to memory.
|
||||
!
|
||||
|
||||
|
||||
PROGRAM RWDSETEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=8), PARAMETER :: filename = "dsetf.h5" ! File name
|
||||
CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name
|
||||
|
||||
INTEGER(HID_T) :: file_id ! File identifier
|
||||
INTEGER(HID_T) :: dset_id ! Dataset identifier
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
INTEGER :: i, j
|
||||
|
||||
INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers
|
||||
|
||||
!
|
||||
! Initialize the dset_data array.
|
||||
!
|
||||
do i = 1, 4
|
||||
do j = 1, 6
|
||||
dset_data(i,j) = (i-1)*6 + j;
|
||||
end do
|
||||
end do
|
||||
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
! Open an existing file.
|
||||
!
|
||||
CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)
|
||||
|
||||
!
|
||||
! Open an existing dataset.
|
||||
!
|
||||
CALL h5dopen_f(file_id, dsetname, dset_id, error)
|
||||
|
||||
!
|
||||
! Write the dataset.
|
||||
!
|
||||
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, error)
|
||||
|
||||
!
|
||||
! Read the dataset.
|
||||
!
|
||||
CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, error)
|
||||
|
||||
!
|
||||
! Close the dataset.
|
||||
!
|
||||
CALL h5dclose_f(dset_id, error)
|
||||
|
||||
!
|
||||
! Close the file.
|
||||
!
|
||||
CALL h5fclose_f(file_id, error)
|
||||
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM RWDSETEXAMPLE
|
||||
|
||||
|
||||
|
282
fortran/examples/selectele.f90
Normal file
282
fortran/examples/selectele.f90
Normal file
@ -0,0 +1,282 @@
|
||||
!
|
||||
! This program creates two files, copy1.h5, and copy2.h5.
|
||||
! In copy1.h5, it creates a 3x4 dataset called 'Copy1',
|
||||
! and write 0's to this dataset.
|
||||
! In copy2.h5, it create a 3x4 dataset called 'Copy2',
|
||||
! and write 1's to this dataset.
|
||||
! It closes both files, reopens both files, selects two
|
||||
! points in copy1.h5 and writes values to them. Then it
|
||||
! uses an H5Scopy to write the same selection to copy2.h5.
|
||||
! Program reopens the files, and reads and prints the contents of
|
||||
! the two datasets.
|
||||
!
|
||||
|
||||
PROGRAM SELECTEXAMPLE
|
||||
|
||||
USE HDF5 ! This module contains all necessary modules
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(LEN=8), PARAMETER :: filename1 = "copy1.h5" ! File name
|
||||
CHARACTER(LEN=8), PARAMETER :: filename2 = "copy2.h5" !
|
||||
CHARACTER(LEN=5), PARAMETER :: dsetname1 = "Copy1" ! Dataset name
|
||||
CHARACTER(LEN=5), PARAMETER :: dsetname2 = "Copy2" !
|
||||
|
||||
INTEGER, PARAMETER :: RANK = 2 ! Dataset rank
|
||||
|
||||
INTEGER(SIZE_T), PARAMETER :: NUMP = 2 ! Number of points selected
|
||||
|
||||
INTEGER(HID_T) :: file1_id ! File1 identifier
|
||||
INTEGER(HID_T) :: file2_id ! File2 identifier
|
||||
INTEGER(HID_T) :: dset1_id ! Dataset1 identifier
|
||||
INTEGER(HID_T) :: dset2_id ! Dataset2 identifier
|
||||
INTEGER(HID_T) :: dataspace1 ! Dataspace identifier
|
||||
INTEGER(HID_T) :: dataspace2 ! Dataspace identifier
|
||||
INTEGER(HID_T) :: memspace ! memspace identifier
|
||||
|
||||
INTEGER(HSIZE_T), DIMENSION(1) :: dimsm = (/2/)
|
||||
! Memory dataspace dimensions
|
||||
INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/3,4/)
|
||||
! File dataspace dimensions
|
||||
INTEGER(HSSIZE_T), DIMENSION(RANK,NUMP) :: coord ! Elements coordinates
|
||||
! in the file
|
||||
|
||||
INTEGER, DIMENSION(3,4) :: buf1, buf2, bufnew ! Data buffers
|
||||
INTEGER, DIMENSION(2) :: val = (/53, 59/) ! Values to write
|
||||
|
||||
INTEGER :: memrank = 1 ! Rank of the dataset in memory
|
||||
|
||||
INTEGER :: i, j
|
||||
|
||||
INTEGER :: error ! Error flag
|
||||
LOGICAL :: status
|
||||
|
||||
|
||||
!
|
||||
! Create two files containing identical datasets. Write 0's to one
|
||||
! and 1's to the other.
|
||||
!
|
||||
|
||||
!
|
||||
! Data initialization.
|
||||
!
|
||||
do i = 1, 3
|
||||
do j = 1, 4
|
||||
buf1(i,j) = 0;
|
||||
end do
|
||||
end do
|
||||
|
||||
do i = 1, 3
|
||||
do j = 1, 4
|
||||
buf2(i,j) = 1;
|
||||
end do
|
||||
end do
|
||||
|
||||
!
|
||||
! Initialize FORTRAN predefined datatypes
|
||||
!
|
||||
CALL h5init_types_f(error)
|
||||
|
||||
!
|
||||
! Create file1, file2 using default properties.
|
||||
!
|
||||
CALL h5fcreate_f(filename1, H5F_ACC_TRUNC_F, file1_id, error)
|
||||
|
||||
CALL h5fcreate_f(filename2, H5F_ACC_TRUNC_F, file2_id, error)
|
||||
|
||||
!
|
||||
! Create the data space for the datasets.
|
||||
!
|
||||
CALL h5screate_simple_f(RANK, dimsf, dataspace1, error)
|
||||
|
||||
CALL h5screate_simple_f(RANK, dimsf, dataspace2, error)
|
||||
|
||||
!
|
||||
! Create the datasets with default properties.
|
||||
!
|
||||
CALL h5dcreate_f(file1_id, dsetname1, H5T_NATIVE_INTEGER, dataspace1, &
|
||||
dset1_id, error)
|
||||
|
||||
CALL h5dcreate_f(file2_id, dsetname2, H5T_NATIVE_INTEGER, dataspace2, &
|
||||
dset2_id, error)
|
||||
|
||||
!
|
||||
! Write the datasets.
|
||||
!
|
||||
CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, buf1, error)
|
||||
|
||||
CALL h5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, buf2, error)
|
||||
|
||||
!
|
||||
! Close the dataspace for the datasets.
|
||||
!
|
||||
CALL h5sclose_f(dataspace1, error)
|
||||
|
||||
CALL h5sclose_f(dataspace2, error)
|
||||
|
||||
!
|
||||
! Close the datasets.
|
||||
!
|
||||
CALL h5dclose_f(dset1_id, error)
|
||||
|
||||
CALL h5dclose_f(dset2_id, error)
|
||||
|
||||
!
|
||||
! Close the files.
|
||||
!
|
||||
CALL h5fclose_f(file1_id, error)
|
||||
|
||||
CALL h5fclose_f(file2_id, error)
|
||||
|
||||
!
|
||||
! Open the two files. Select two points in one file, write values to
|
||||
! those point locations, then do H5Scopy and write the values to the
|
||||
! other file. Close files.
|
||||
!
|
||||
|
||||
!
|
||||
! Open the files.
|
||||
!
|
||||
CALL h5fopen_f (filename1, H5F_ACC_RDWR_F, file1_id, error)
|
||||
|
||||
CALL h5fopen_f (filename2, H5F_ACC_RDWR_F, file2_id, error)
|
||||
|
||||
!
|
||||
! Open the datasets.
|
||||
!
|
||||
CALL h5dopen_f(file1_id, dsetname1, dset1_id, error)
|
||||
|
||||
CALL h5dopen_f(file2_id, dsetname2, dset2_id, error)
|
||||
|
||||
!
|
||||
! Get dataset1's dataspace identifier.
|
||||
!
|
||||
CALL h5dget_space_f(dset1_id, dataspace1, error)
|
||||
|
||||
!
|
||||
! Create memory dataspace.
|
||||
!
|
||||
CALL h5screate_simple_f(memrank, dimsm, memspace, error)
|
||||
|
||||
!
|
||||
! Set the selected point positions. Because Fortran array index starts
|
||||
! from 1, so add one to the actual select points in C.
|
||||
!
|
||||
coord(1,1) = 1
|
||||
coord(2,1) = 2
|
||||
coord(1,2) = 1
|
||||
coord(2,2) = 4
|
||||
|
||||
!
|
||||
! Select the elements in file space.
|
||||
!
|
||||
CALL h5sselect_elements_f(dataspace1, H5S_SELECT_SET_F, RANK, NUMP,&
|
||||
coord, error)
|
||||
|
||||
!
|
||||
! Write value into the selected points in dataset1.
|
||||
!
|
||||
CALL H5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, val, error, &
|
||||
mem_space_id=memspace, file_space_id=dataspace1)
|
||||
|
||||
!
|
||||
! Copy the daspace1 into dataspace2.
|
||||
!
|
||||
CALL h5scopy_f(dataspace1, dataspace2, error)
|
||||
|
||||
!
|
||||
! Write value into the selected points in dataset2.
|
||||
!
|
||||
CALL H5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, val, error, &
|
||||
mem_space_id=memspace, file_space_id=dataspace2)
|
||||
|
||||
!
|
||||
! Close the dataspace for the datasets.
|
||||
!
|
||||
CALL h5sclose_f(dataspace1, error)
|
||||
|
||||
CALL h5sclose_f(dataspace2, error)
|
||||
|
||||
!
|
||||
! Close the memoryspace.
|
||||
!
|
||||
CALL h5sclose_f(memspace, error)
|
||||
|
||||
!
|
||||
! Close the datasets.
|
||||
!
|
||||
CALL h5dclose_f(dset1_id, error)
|
||||
|
||||
CALL h5dclose_f(dset2_id, error)
|
||||
|
||||
!
|
||||
! Close the files.
|
||||
!
|
||||
CALL h5fclose_f(file1_id, error)
|
||||
|
||||
CALL h5fclose_f(file2_id, error)
|
||||
|
||||
!
|
||||
! Open both files and print the contents of the datasets.
|
||||
!
|
||||
|
||||
!
|
||||
! Open the files.
|
||||
!
|
||||
CALL h5fopen_f (filename1, H5F_ACC_RDWR_F, file1_id, error)
|
||||
|
||||
CALL h5fopen_f (filename2, H5F_ACC_RDWR_F, file2_id, error)
|
||||
|
||||
!
|
||||
! Open the datasets.
|
||||
!
|
||||
CALL h5dopen_f(file1_id, dsetname1, dset1_id, error)
|
||||
|
||||
CALL h5dopen_f(file2_id, dsetname2, dset2_id, error)
|
||||
|
||||
!
|
||||
! Read dataset from the first file.
|
||||
!
|
||||
CALL h5dread_f(dset1_id, H5T_NATIVE_INTEGER, bufnew, error)
|
||||
|
||||
!
|
||||
! Display the data read from dataset "Copy1"
|
||||
!
|
||||
write(*,*) "The data in dataset Copy1 is: "
|
||||
do i = 1, 3
|
||||
print *, (bufnew(i,j), j = 1,4)
|
||||
end do
|
||||
|
||||
!
|
||||
! Read dataset from the second file.
|
||||
!
|
||||
CALL h5dread_f(dset2_id, H5T_NATIVE_INTEGER, bufnew, error)
|
||||
|
||||
!
|
||||
! Display the data read from dataset "Copy2"
|
||||
!
|
||||
write(*,*) "The data in dataset Copy2 is: "
|
||||
do i = 1, 3
|
||||
print *, (bufnew(i,j), j = 1,4)
|
||||
end do
|
||||
|
||||
!
|
||||
! Close datasets.
|
||||
!
|
||||
CALL h5dclose_f(dset1_id, error)
|
||||
|
||||
CALL h5dclose_f(dset2_id, error)
|
||||
|
||||
!
|
||||
! Close files.
|
||||
!
|
||||
CALL h5fclose_f(file1_id, error)
|
||||
|
||||
CALL h5fclose_f(file2_id, error)
|
||||
|
||||
!
|
||||
! Close FORTRAN predefined datatypes.
|
||||
!
|
||||
CALL h5close_types_f(error)
|
||||
|
||||
END PROGRAM SELECTEXAMPLE
|
4284
fortran/libtool
Executable file
4284
fortran/libtool
Executable file
File diff suppressed because it is too large
Load Diff
0
fortran/src/Dependencies
Normal file
0
fortran/src/Dependencies
Normal file
433
fortran/src/H5Af.c
Normal file
433
fortran/src/H5Af.c
Normal file
@ -0,0 +1,433 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5acreate_c
|
||||
* Purpose: Call H5Acreate to create an attribute
|
||||
* Inputs: obj_id - object identifier
|
||||
* name - name of the attribute
|
||||
* namelen - name length
|
||||
* type_id - datatype identifier
|
||||
* space_id - dataspace identifier
|
||||
* crt_pr - identifier of creation property list
|
||||
* Outputs: attr_id - attribute identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5acreate_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_obj_id;
|
||||
hid_t c_type_id;
|
||||
hid_t c_space_id;
|
||||
hid_t c_attr_id;
|
||||
hid_t c_crt_prp;
|
||||
/*
|
||||
* Define creation property
|
||||
*/
|
||||
c_crt_prp = *crt_prp;
|
||||
if ( H5P_DEFAULT_F == c_crt_prp ) c_crt_prp = H5P_DEFAULT;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Acreate function.
|
||||
*/
|
||||
c_obj_id = *obj_id;
|
||||
c_type_id = *type_id;
|
||||
c_space_id = *space_id;
|
||||
c_attr_id = H5Acreate(c_obj_id, c_name, c_type_id, c_space_id, c_crt_prp);
|
||||
|
||||
|
||||
if (c_attr_id < 0) return ret_value;
|
||||
*attr_id = (hid_t_f)c_attr_id;
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aopen_name _c
|
||||
* Purpose: Call H5Aopen_name to open an attribute
|
||||
* Inputs: obj_id - object identifier
|
||||
* name - name of the attribute
|
||||
* namelen - name length
|
||||
* Outputs: attr_id - dataset identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5aopen_name_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *attr_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_obj_id;
|
||||
hid_t c_attr_id;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
/*
|
||||
* Call H5Aopen function.
|
||||
*/
|
||||
c_obj_id = *obj_id;
|
||||
c_attr_id = H5Aopen_name(c_obj_id, c_name);
|
||||
|
||||
if (c_attr_id < 0) return ret_value;
|
||||
*attr_id = (hid_t_f)c_attr_id;
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5awritec_c
|
||||
* Purpose: Call h5awrite_c to write a character attribute
|
||||
* Inputs: attr_id - dataset identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* buf - character data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday , August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
|
||||
/*
|
||||
* Call h5awrite_c function.
|
||||
*/
|
||||
ret_value = nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf));
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5awrite_c
|
||||
* Purpose: Call H5Awrite to write a attribute
|
||||
* Inputs: attr_id - attribute identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* buf - data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
herr_t ret;
|
||||
hid_t c_attr_id;
|
||||
hid_t c_mem_type_id;
|
||||
|
||||
/*
|
||||
* Call H5Awrite function.
|
||||
*/
|
||||
c_attr_id = *attr_id;
|
||||
c_mem_type_id = *mem_type_id;
|
||||
ret = H5Awrite(c_attr_id, c_mem_type_id, buf);
|
||||
|
||||
if (ret < 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5areadc_c
|
||||
* Purpose: Call h5aread_c to read character attribute
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* Outputs: buf - character data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
|
||||
/*
|
||||
* Call h5aread_c function.
|
||||
*/
|
||||
ret_value = nh5aread_c(attr_id, mem_type_id, (_fcdtocp(buf)));
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aread_c
|
||||
* Purpose: Call H5Araed to read an attribute
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* Outputs: buf - data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
herr_t ret;
|
||||
hid_t c_attr_id;
|
||||
hid_t c_mem_type_id;
|
||||
|
||||
/*
|
||||
* Call H5Aread function.
|
||||
*/
|
||||
c_attr_id = *attr_id;
|
||||
c_mem_type_id = *mem_type_id;
|
||||
ret = H5Aread(c_attr_id, c_mem_type_id, buf);
|
||||
|
||||
if (ret < 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aclose_c
|
||||
* Purpose: Call H5Aclose to close an attribute
|
||||
* Inputs: attr_id - identifier of an attribute to be closed
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5aclose_c ( hid_t_f *attr_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_attr_id;
|
||||
c_attr_id = *attr_id;
|
||||
if ( H5Aclose(c_attr_id) < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5adelete_c
|
||||
* Purpose: Call H5Adelete to delete an attribute
|
||||
* Inputs: obj_id - object identifier
|
||||
* name - name of the attribute
|
||||
* namelen - name length
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5adelete_c (hid_t_f *obj_id, _fcd name, int_f *namelen)
|
||||
{
|
||||
int ret_value = -1;
|
||||
herr_t status;
|
||||
hid_t c_obj_id;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Adelete function.
|
||||
*/
|
||||
c_obj_id = *obj_id;
|
||||
status = H5Adelete(c_obj_id, c_name);
|
||||
|
||||
if (status < 0) return ret_value;
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aopen_idx_c
|
||||
* Purpose: Call H5Aopen_idx to open an attribute
|
||||
* Inputs: obj_id - object identifier
|
||||
* idx - attribute index ( zero based)
|
||||
* Outputs: attr_id - attribute identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_obj_id;
|
||||
hid_t c_attr_id;
|
||||
unsigned c_idx;
|
||||
c_idx = (unsigned)*idx;
|
||||
|
||||
/*
|
||||
* Call H5Aopen_idx function.
|
||||
*/
|
||||
c_obj_id = *obj_id;
|
||||
c_attr_id = H5Aopen_idx(c_obj_id, c_idx);
|
||||
|
||||
if (c_attr_id < 0) return ret_value;
|
||||
*attr_id = (hid_t_f)c_attr_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aget_space_c
|
||||
* Purpose: Call H5Aget_space to get attribute's dataspace
|
||||
* Inputs: attr_id - attribute identifier
|
||||
* Outputs: space_id - dataspace identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_attr_id;
|
||||
hid_t c_space_id;
|
||||
|
||||
/*
|
||||
* Call H5Aget_space function.
|
||||
*/
|
||||
c_attr_id = *attr_id;
|
||||
c_space_id = H5Aget_space(c_attr_id);
|
||||
|
||||
if (c_space_id < 0) return ret_value;
|
||||
*space_id = (hid_t_f)c_space_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aget_type_c
|
||||
* Purpose: Call H5Aget_space to get attribute's datatype
|
||||
* Inputs: attr_id - attribute identifier
|
||||
* Outputs: type_id - datatype identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_attr_id;
|
||||
hid_t c_type_id;
|
||||
|
||||
/*
|
||||
* Call H5Aget_type function.
|
||||
*/
|
||||
c_attr_id = *attr_id;
|
||||
c_type_id = H5Aget_type(c_attr_id);
|
||||
|
||||
if (c_type_id < 0) return ret_value;
|
||||
*type_id = (hid_t_f)c_type_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aget_num_attrs_c
|
||||
* Purpose: Call H5Aget_num_attrs to determine number of
|
||||
* attributes of an object
|
||||
* Inputs: obj_id - object identifier
|
||||
* attr_num - number of attributes
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_obj_id;
|
||||
int c_attr_num;
|
||||
|
||||
/*
|
||||
* Call H5Aget_num_attrs function.
|
||||
*/
|
||||
c_obj_id = *obj_id;
|
||||
c_attr_num = H5Aget_num_attrs(c_obj_id);
|
||||
|
||||
if (c_attr_num < 0) return ret_value;
|
||||
*attr_num = c_attr_num;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5aget_name_c
|
||||
* Purpose: Call H5Aget_name to get attribute's name
|
||||
* Inputs: attr_id - attribute identifier
|
||||
* bufsize -size of the buffer
|
||||
* Outputs: buf - buffer to hold the name
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_attr_id;
|
||||
ssize_t c_size;
|
||||
size_t c_bufsize;
|
||||
char *c_buf =NULL;
|
||||
|
||||
/*
|
||||
* Allocate buffer to hold name of an attribute
|
||||
*/
|
||||
c_bufsize = *bufsize;
|
||||
c_buf = (char *)HDmalloc(c_bufsize +1);
|
||||
if (c_buf == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Aget_name function
|
||||
*/
|
||||
c_attr_id = *attr_id;
|
||||
c_size = H5Aget_name(c_attr_id, c_bufsize, c_buf);
|
||||
if (c_size < 0) return ret_value;
|
||||
|
||||
/*
|
||||
* Convert C name to FORTRAN and place it in the given buffer
|
||||
*/
|
||||
|
||||
HDpackFstring(c_buf, _fcdtocp(buf), c_bufsize);
|
||||
HDfree( c_buf);
|
||||
ret_value = c_size;
|
||||
return ret_value;
|
||||
}
|
1024
fortran/src/H5Aff.f90
Normal file
1024
fortran/src/H5Aff.f90
Normal file
File diff suppressed because it is too large
Load Diff
391
fortran/src/H5Df.c
Normal file
391
fortran/src/H5Df.c
Normal file
@ -0,0 +1,391 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dcreate_c
|
||||
* Purpose: Call H5Dcreate to create a dataset
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the dataset
|
||||
* namelen - name length
|
||||
* type_id - datatype identifier
|
||||
* space_id - dataspace identifier
|
||||
* crt_pr - identifier of creation property list
|
||||
* Outputs: dset_id - dataset identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 4, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_loc_id;
|
||||
hid_t c_type_id;
|
||||
hid_t c_space_id;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_crt_prp;
|
||||
|
||||
/*
|
||||
* Define creation property
|
||||
*/
|
||||
c_crt_prp = *crt_prp;
|
||||
if ( H5P_DEFAULT_F == c_crt_prp ) c_crt_prp = H5P_DEFAULT;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Dcreate function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_type_id = *type_id;
|
||||
c_space_id = *space_id;
|
||||
c_dset_id = H5Dcreate(c_loc_id, c_name, c_type_id, c_space_id, c_crt_prp);
|
||||
if (c_dset_id < 0) return ret_value;
|
||||
*dset_id = (hid_t_f)c_dset_id;
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dopen_c
|
||||
* Purpose: Call H5Dopen to open a dataset
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the dataset
|
||||
* namelen - name length
|
||||
* Outputs: dset_id - dataset identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 4, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_loc_id;
|
||||
hid_t c_dset_id;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Dopen function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_dset_id = H5Dopen(c_loc_id, c_name);
|
||||
|
||||
if (c_dset_id < 0) return ret_value;
|
||||
*dset_id = (hid_t_f)c_dset_id;
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dwritec_c
|
||||
* Purpose: Call h5dwrite_c to write a dataset of characters
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* mem_space_id - memory dataspace identifier
|
||||
* file_space_id - memory dataspace identifier
|
||||
* xfer_pr - identifier of transfer property list
|
||||
* buf - character data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 6, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
|
||||
/*
|
||||
* Call h5dwrite_c function.
|
||||
*/
|
||||
ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf));
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dwrite_c
|
||||
* Purpose: Call H5Dwrite to write a dataset
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* mem_space_id - memory dataspace identifier
|
||||
* file_space_id - memory dataspace identifier
|
||||
* xfer_pr - identifier of transfer property list
|
||||
* buf - data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 6, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
herr_t ret;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_mem_type_id;
|
||||
hid_t c_mem_space_id;
|
||||
hid_t c_file_space_id;
|
||||
hid_t c_xfer_prp;
|
||||
|
||||
/*
|
||||
* Define transfer property
|
||||
*/
|
||||
c_xfer_prp = *xfer_prp;
|
||||
if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT;
|
||||
|
||||
/*
|
||||
* Call H5Dwrite function.
|
||||
*/
|
||||
c_dset_id = *dset_id;
|
||||
c_mem_type_id = *mem_type_id;
|
||||
c_mem_space_id = *mem_space_id;
|
||||
c_file_space_id = *file_space_id;
|
||||
ret = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf);
|
||||
|
||||
if (ret < 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dreadc_c
|
||||
* Purpose: Call h5dread_c to read a dataset of characters
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* mem_space_id - memory dataspace identifier
|
||||
* file_space_id - memory dataspace identifier
|
||||
* xfer_pr - identifier of transfer property list
|
||||
* Outputs: buf - character data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Monday, August 9, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
|
||||
/*
|
||||
* Call h5dread_c function.
|
||||
*/
|
||||
ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf));
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dread_c
|
||||
* Purpose: Call H5Draed to read a dataset
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* mem_type_id - memory datatype identifier
|
||||
* mem_space_id - memory dataspace identifier
|
||||
* file_space_id - memory dataspace identifier
|
||||
* xfer_pr - identifier of transfer property list
|
||||
* Outputs: buf - data buffer
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Monday, August 9, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
herr_t ret;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_mem_type_id;
|
||||
hid_t c_mem_space_id;
|
||||
hid_t c_file_space_id;
|
||||
hid_t c_xfer_prp;
|
||||
|
||||
/*
|
||||
* Define transfer property
|
||||
*/
|
||||
c_xfer_prp = *xfer_prp;
|
||||
if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT;
|
||||
|
||||
/*
|
||||
* Call H5Dread function.
|
||||
*/
|
||||
c_dset_id = *dset_id;
|
||||
c_mem_type_id = *mem_type_id;
|
||||
c_mem_space_id = *mem_space_id;
|
||||
c_file_space_id = *file_space_id;
|
||||
ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf);
|
||||
|
||||
if (ret < 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dclose_c
|
||||
* Purpose: Call H5Dclose to close a dataset
|
||||
* Inputs: dset_id - identifier of the dataset to be closed
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 4, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5dclose_c ( hid_t_f *dset_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_dset_id;
|
||||
c_dset_id = *dset_id;
|
||||
if ( H5Dclose(c_dset_id) < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dget_space_c
|
||||
* Purpose: Call H5Dget_space to obtain dataspace of a dataset
|
||||
* Inputs: dset_id - identifier of the dataset
|
||||
* Outputs: space_id - identifier of the dataset's dataspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 19, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_space_id;
|
||||
|
||||
c_dset_id = *dset_id;
|
||||
c_space_id = H5Dget_space(c_dset_id);
|
||||
if(c_space_id < 0 ) return ret_value;
|
||||
ret_value = 0;
|
||||
*space_id = (hid_t_f)c_space_id;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dget_type_c
|
||||
* Purpose: Call H5Dget_type to obtain datatype of a dataset
|
||||
* Inputs: dset_id - identifier of the dataset
|
||||
* Outputs: type_id - identifier of the dataset's datatype
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 19, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_type_id;
|
||||
|
||||
c_dset_id = *dset_id;
|
||||
c_type_id = H5Dget_type(c_dset_id);
|
||||
|
||||
if(c_type_id < 0 ) return ret_value;
|
||||
|
||||
*type_id = (hid_t_f)c_type_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dget_create_plist_c
|
||||
* Purpose: Call H5Dget_create_plist to obtain creation property list
|
||||
* of a dataset
|
||||
* Inputs: dset_id - identifier of the dataset
|
||||
* Outputs: plist_id - identifier of he dataset creation property list
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 19, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_plist_id;
|
||||
|
||||
c_dset_id = *dset_id;
|
||||
c_plist_id = H5Dget_create_plist(c_dset_id);
|
||||
|
||||
if(c_plist_id < 0 ) return ret_value;
|
||||
|
||||
ret_value = 0;
|
||||
*plist_id = (hid_t_f)c_plist_id;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dextend_c
|
||||
* Purpose: Call H5Dextend to extend dataset with unlimited dimensions
|
||||
* Inputs: dset_id - identifier of the dataset
|
||||
* Outputs: dims - array with the dimension sizes
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, August 19, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hsize_t *c_dims;
|
||||
int status;
|
||||
int rank;
|
||||
int i;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_space_id;
|
||||
|
||||
c_dset_id = *dset_id;
|
||||
c_space_id = H5Dget_space(c_dset_id);
|
||||
if (c_space_id < 0) return ret_value;
|
||||
|
||||
rank = H5Sget_simple_extent_ndims(c_space_id);
|
||||
if (rank < 0) return ret_value;
|
||||
|
||||
c_dims = malloc(sizeof(hsize_t)*rank);
|
||||
if (!c_dims) return ret_value;
|
||||
|
||||
/*
|
||||
* Reverse dimensions due to C-FORTRAN storage order.
|
||||
*/
|
||||
for (i=0; i < rank; i++)
|
||||
c_dims[i] = dims[rank - i - 1];
|
||||
|
||||
status = H5Dextend(c_dset_id, c_dims);
|
||||
|
||||
if ( status >= 0 ) ret_value = 0;
|
||||
HDfree(c_dims);
|
||||
return ret_value;
|
||||
}
|
||||
|
2441
fortran/src/H5Dff.f90
Normal file
2441
fortran/src/H5Dff.f90
Normal file
File diff suppressed because it is too large
Load Diff
169
fortran/src/H5Ef.c
Normal file
169
fortran/src/H5Ef.c
Normal file
@ -0,0 +1,169 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5eclear_c
|
||||
* Purpose: Call H5Eclear to clear the error stack for the current thread
|
||||
* Inputs:
|
||||
* Outputs:
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, March 29, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5eclear_c( )
|
||||
{
|
||||
int ret_val = -1;
|
||||
herr_t status;
|
||||
|
||||
/*
|
||||
* Call H5Eclear function.
|
||||
*/
|
||||
status = H5Eclear();
|
||||
if(status < 0) return ret_val;
|
||||
ret_val = 0;
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5eprint_c1
|
||||
* Purpose: Call H5Eprint to print the error stack in a default manner.
|
||||
* Inputs: name - file name
|
||||
* namelen - length of name
|
||||
* Outputs:
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, March 29, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5eprint_c1(_fcd name, int_f* namelen)
|
||||
{
|
||||
int ret_val = -1;
|
||||
herr_t status;
|
||||
FILE * file;
|
||||
char* c_name;
|
||||
int c_namelen;
|
||||
c_namelen = *namelen;
|
||||
c_name = (char*)HD5f2cstring(name, c_namelen);
|
||||
file = fopen(c_name, "w");
|
||||
|
||||
/*
|
||||
* Call H5Eprint function.
|
||||
*/
|
||||
status = H5Eprint(file);
|
||||
if(status < 0) return ret_val;
|
||||
ret_val = 0;
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5eprint_c2
|
||||
* Purpose: Call H5Eprint to print the error stack to stderr
|
||||
* in a default manner.
|
||||
* Inputs:
|
||||
* Outputs:
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, March 29, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5eprint_c2()
|
||||
{
|
||||
int ret_val = -1;
|
||||
herr_t status;
|
||||
|
||||
/*
|
||||
* Call H5Eprint function.
|
||||
*/
|
||||
status = H5Eprint(NULL);
|
||||
if(status < 0) return ret_val;
|
||||
ret_val = 0;
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5eget_major_c
|
||||
* Purpose: Call H5Eget_major to get a character string
|
||||
* describing an error specified by a major error number.
|
||||
* Inputs: error_no - Major error number
|
||||
* Outputs: name - character string describing the error
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, March 29, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5eget_major_c(int_f* error_no, _fcd name)
|
||||
{
|
||||
int ret_val = -1;
|
||||
const char* c_name;
|
||||
H5E_major_t c_error_no;
|
||||
c_error_no = (H5E_major_t)*error_no;
|
||||
|
||||
/*
|
||||
* Call H5Eget_major function.
|
||||
*/
|
||||
c_name = H5Eget_major(c_error_no);
|
||||
HDpackFstring((char*)c_name, _fcdtocp(name), strlen(c_name));
|
||||
|
||||
if(!strcmp(c_name, "Invalid major error number")) return ret_val;
|
||||
ret_val = 0;
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5eget_minor_c
|
||||
* Purpose: Call H5Eget_minor to get a character string
|
||||
* describing an error specified by a minor error number.
|
||||
* Inputs: error_no - Major error number
|
||||
* Outputs: name - character string describing the error
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, March 29, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5eget_minor_c(int_f* error_no, _fcd name)
|
||||
{
|
||||
int ret_val = -1;
|
||||
const char* c_name;
|
||||
H5E_minor_t c_error_no;
|
||||
c_error_no = (H5E_minor_t)*error_no;
|
||||
|
||||
/*
|
||||
* Call H5Eget_minor function.
|
||||
*/
|
||||
c_name = H5Eget_minor(c_error_no);
|
||||
HDpackFstring((char*)c_name, _fcdtocp(name), strlen(c_name));
|
||||
|
||||
if(!strcmp(c_name, "Invalid minor error number")) return ret_val;
|
||||
ret_val = 0;
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5eset_auto_c
|
||||
* Purpose: Call H5Eset_auto to turn automatic error printing on or off.
|
||||
* Inputs: printflag - flag to turn automatic error printing on or off.
|
||||
* Outputs:
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, March 29, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5eset_auto_c(int_f* printflag)
|
||||
{
|
||||
int ret_val = -1;
|
||||
herr_t status;
|
||||
|
||||
if (*printflag == 1)
|
||||
status = H5Eset_auto((H5E_auto_t)H5Eprint, stderr);
|
||||
if (status >= 0) ret_val = 0;
|
||||
return ret_val;
|
||||
}
|
62
fortran/src/H5Eff.f90
Normal file
62
fortran/src/H5Eff.f90
Normal file
@ -0,0 +1,62 @@
|
||||
!
|
||||
! This file contains FORTRAN90 interfaces for H5E functions
|
||||
!
|
||||
MODULE H5E
|
||||
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
CONTAINS
|
||||
|
||||
SUBROUTINE h5eclear_f(hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5eclear_c
|
||||
|
||||
hdferr = h5eclear_c()
|
||||
END SUBROUTINE h5eclear_f
|
||||
|
||||
SUBROUTINE h5eprint_f(hdferr, name)
|
||||
CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: name ! File name
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5eprint_c1, h5eprint_c2
|
||||
|
||||
INTEGER :: namelen
|
||||
|
||||
namelen = LEN(NAME)
|
||||
if (present(name)) hdferr = h5eprint_c1(name, namelen)
|
||||
hdferr = h5eprint_c2()
|
||||
END SUBROUTINE h5eprint_f
|
||||
|
||||
SUBROUTINE h5eget_major_f(error_no, name, hdferr)
|
||||
INTEGER, INTENT(IN) :: error_no !Major error number
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name ! File name
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5eget_major_c
|
||||
|
||||
hdferr = h5eget_major_c(error_no, name)
|
||||
END SUBROUTINE h5eget_major_f
|
||||
|
||||
SUBROUTINE h5eget_minor_f(error_no, name, hdferr)
|
||||
INTEGER, INTENT(IN) :: error_no !Major error number
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name ! File name
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5eget_minor_c
|
||||
|
||||
hdferr = h5eget_minor_c(error_no, name)
|
||||
END SUBROUTINE h5eget_minor_f
|
||||
|
||||
SUBROUTINE h5eset_auto_f(printflag, hdferr)
|
||||
INTEGER, INTENT(IN) :: printflag !flag to turn automatic error
|
||||
!printing on or off
|
||||
!possible values are:
|
||||
!printon (1)
|
||||
!printoff(0)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5eset_auto_c
|
||||
|
||||
hdferr = h5eset_auto_c(printflag)
|
||||
END SUBROUTINE h5eset_auto_f
|
||||
|
||||
END MODULE H5E
|
||||
|
451
fortran/src/H5Ff.c
Normal file
451
fortran/src/H5Ff.c
Normal file
@ -0,0 +1,451 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fcreate_c
|
||||
* Purpose: Call H5Fcreate to create the file
|
||||
* Inputs: name - name of the file
|
||||
* namelen - name length
|
||||
* access_flags - file access flags
|
||||
* crt_pr - identifier of creation property list
|
||||
* acc_prp - identifier of access property list
|
||||
* Outputs: file_id - file identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Monday, July 26, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, hid_t_f *acc_prp, hid_t_f *file_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_file_id;
|
||||
unsigned c_access_flags;
|
||||
hid_t c_crt_prp;
|
||||
hid_t c_acc_prp;
|
||||
int CASE;
|
||||
hid_t CASE_prp;
|
||||
|
||||
/*
|
||||
* Define access flags
|
||||
*/
|
||||
CASE = (int)*access_flags;
|
||||
switch (CASE) {
|
||||
|
||||
case H5F_ACC_RDWR_F:
|
||||
c_access_flags = H5F_ACC_RDWR;
|
||||
break;
|
||||
|
||||
case H5F_ACC_RDONLY_F:
|
||||
c_access_flags = H5F_ACC_RDONLY;
|
||||
break;
|
||||
|
||||
case H5F_ACC_TRUNC_F:
|
||||
c_access_flags = H5F_ACC_TRUNC;
|
||||
break;
|
||||
|
||||
case H5F_ACC_EXCL_F:
|
||||
c_access_flags = H5F_ACC_EXCL;
|
||||
break;
|
||||
|
||||
case H5F_ACC_DEBUG_F:
|
||||
c_access_flags = H5F_ACC_DEBUG;
|
||||
break;
|
||||
|
||||
default:
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Define creation property
|
||||
*/
|
||||
c_crt_prp = *crt_prp;
|
||||
if ( H5P_DEFAULT_F == c_crt_prp ) c_crt_prp = H5P_DEFAULT;
|
||||
|
||||
/*
|
||||
* Define access property
|
||||
*/
|
||||
c_acc_prp = *acc_prp;
|
||||
if ( H5P_DEFAULT_F == c_acc_prp ) c_acc_prp = H5P_DEFAULT;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Fcreate function.
|
||||
*/
|
||||
c_file_id = H5Fcreate(c_name, c_access_flags, c_crt_prp, c_acc_prp);
|
||||
|
||||
if (c_file_id < 0) return ret_value;
|
||||
*file_id = c_file_id;
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fflush_c
|
||||
* Purpose: Call H5Fflush to flush the object
|
||||
* Inputs: object_id - identifier of either a file, a dataset,
|
||||
* a group, an attribute or a named data type
|
||||
* scope - integer to specify the flushing action, either
|
||||
* H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Friday, November 5, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5fflush_c (hid_t_f *object_id, int_f *scope)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_file_id;
|
||||
int CASE;
|
||||
H5F_scope_t c_scope;
|
||||
htri_t status;
|
||||
|
||||
/*
|
||||
* Define scope flags
|
||||
*/
|
||||
CASE = (int)*scope;
|
||||
switch (CASE) {
|
||||
|
||||
case H5F_SCOPE_LOCAL_F:
|
||||
c_scope = H5F_SCOPE_LOCAL;
|
||||
break;
|
||||
|
||||
case H5F_SCOPE_GLOBAL_F:
|
||||
c_scope = H5F_SCOPE_GLOBAL;
|
||||
break;
|
||||
|
||||
default:
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call H5Fflush function.
|
||||
*/
|
||||
|
||||
c_file_id = *object_id;
|
||||
|
||||
status = H5Fflush(c_file_id, c_scope);
|
||||
|
||||
if (status >= 0) ret_value = 0;
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fmount_c
|
||||
* Purpose: Call H5Fmount to mount the file
|
||||
* Inputs: loc_id - Identifier for file or group
|
||||
* dsetname - name of dataset
|
||||
* namelen - dsetname length
|
||||
* file_id - file identifier for the file to be mounted
|
||||
* acc_prp - identifier of access property list
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Monday, October 25, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_loc_id;
|
||||
hid_t c_file_id;
|
||||
hid_t c_acc_prp;
|
||||
htri_t status;
|
||||
|
||||
/*
|
||||
* Define access property
|
||||
*/
|
||||
c_acc_prp = *acc_prp;
|
||||
if ( H5P_DEFAULT_F == c_acc_prp ) c_acc_prp = H5P_DEFAULT;
|
||||
|
||||
c_loc_id = *loc_id;
|
||||
c_file_id = *file_id;
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Fmount function.
|
||||
*/
|
||||
status = H5Fmount(c_loc_id, c_name, c_file_id, c_acc_prp);
|
||||
|
||||
if (status >= 0) ret_value = 0;
|
||||
|
||||
HDfree(c_name);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5funmount_c
|
||||
* Purpose: Call H5Funmount to unmount the file
|
||||
* Inputs: loc_id - Identifier for file or group
|
||||
* dsetname - name of dataset
|
||||
* namelen - dsetname length
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Monday, October 25, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_loc_id;
|
||||
htri_t status;
|
||||
|
||||
c_loc_id = *loc_id;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Fmount function.
|
||||
*/
|
||||
status = H5Funmount(c_loc_id, c_name);
|
||||
|
||||
if (status >= 0) ret_value = 0;
|
||||
|
||||
HDfree(c_name);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fopen_c
|
||||
* Purpose: Call H5Fopen to open the file
|
||||
* Inputs: name - name of the file
|
||||
* namelen - name length
|
||||
* access_flags - file access flags
|
||||
* acc_prp - identifier of access property list
|
||||
* Outputs: file_id - file identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 3, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_file_id;
|
||||
unsigned c_access_flags;
|
||||
hid_t c_acc_prp;
|
||||
int CASE;
|
||||
hid_t CASE_prp;
|
||||
|
||||
/*
|
||||
* Define access flags
|
||||
*/
|
||||
CASE = (int)*access_flags;
|
||||
switch (CASE) {
|
||||
|
||||
case H5F_ACC_RDWR_F:
|
||||
c_access_flags = H5F_ACC_RDWR;
|
||||
break;
|
||||
|
||||
case H5F_ACC_RDONLY_F:
|
||||
c_access_flags = H5F_ACC_RDONLY;
|
||||
break;
|
||||
|
||||
case H5F_ACC_TRUNC_F:
|
||||
c_access_flags = H5F_ACC_TRUNC;
|
||||
break;
|
||||
|
||||
case H5F_ACC_EXCL_F:
|
||||
c_access_flags = H5F_ACC_EXCL;
|
||||
break;
|
||||
|
||||
case H5F_ACC_DEBUG_F:
|
||||
c_access_flags = H5F_ACC_DEBUG;
|
||||
break;
|
||||
|
||||
default:
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Define access property
|
||||
*/
|
||||
c_acc_prp = *acc_prp;
|
||||
if ( H5P_DEFAULT_F == c_acc_prp ) c_acc_prp = H5P_DEFAULT;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Fopen function.
|
||||
*/
|
||||
c_file_id = H5Fopen(c_name, c_access_flags, c_acc_prp);
|
||||
|
||||
if (c_file_id < 0) return ret_value;
|
||||
*file_id = (hid_t_f)c_file_id;
|
||||
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5freopen_c
|
||||
* Purpose: Call H5Freopen to open the file
|
||||
* Inputs: file_id1 - file identifier
|
||||
* Outputs: file_id2 - file identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, November 3, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_file_id1, c_file_id2;
|
||||
|
||||
c_file_id1 = *file_id1;
|
||||
c_file_id2 = H5Freopen(c_file_id1);
|
||||
|
||||
if (c_file_id2 < 0) return ret_value;
|
||||
*file_id2 = (hid_t_f)c_file_id2;
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fget_create_plist_c
|
||||
* Purpose: Call H5Fget_create_plist to get the file creation property list
|
||||
* Inputs: file_id - file identifier
|
||||
* Outputs: prop_id - creation property list identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, November 3, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_file_id, c_prop_id;
|
||||
|
||||
c_file_id = *file_id;
|
||||
c_prop_id = H5Fget_create_plist(c_file_id);
|
||||
|
||||
if (c_prop_id < 0) return ret_value;
|
||||
*prop_id = (hid_t_f)c_prop_id;
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fget_access_plist_c
|
||||
* Purpose: Call H5Fget_access_plist to get the file access property list
|
||||
* Inputs: file_id - file identifier
|
||||
* Outputs: access_id - access property list identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Friday, November 5, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_file_id, c_access_id;
|
||||
|
||||
c_file_id = *file_id;
|
||||
c_access_id = H5Fget_access_plist(c_file_id);
|
||||
|
||||
if (c_access_id < 0) return ret_value;
|
||||
*access_id = (hid_t_f)c_access_id;
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fis_hdf5_c
|
||||
* Purpose: Call H5Fis_hdf5 to determone if the file is an HDF5 file
|
||||
* Inputs: name - name of the file
|
||||
* namelen - name length
|
||||
* Outputs: flag - 0 if file is not HDF5 file , positive if a file
|
||||
* is an HDF5 file, and negative on failure.
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 3, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
htri_t status;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Fopen function.
|
||||
*/
|
||||
status = H5Fis_hdf5(c_name);
|
||||
*flag = (int_f)status;
|
||||
if (status >= 0) ret_value = 0;
|
||||
|
||||
HDfree(c_name);
|
||||
return ret_value;
|
||||
}
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5fclose_c
|
||||
* Purpose: Call H5Fclose to close the file
|
||||
* Inputs: file_id - identifier of the file to be closed
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Monday, July 26, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5fclose_c ( hid_t_f *file_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_file_id;
|
||||
|
||||
c_file_id = *file_id;
|
||||
if ( H5Fclose(c_file_id) < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
199
fortran/src/H5Fff.f90
Normal file
199
fortran/src/H5Fff.f90
Normal file
@ -0,0 +1,199 @@
|
||||
!
|
||||
! This file contains Fortran90 interfaces for H5F functions.
|
||||
!
|
||||
MODULE H5F
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
CONTAINS
|
||||
|
||||
SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, &
|
||||
creation_prp, access_prp)
|
||||
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file
|
||||
INTEGER, INTENT(IN) :: access_flags ! File access flags
|
||||
INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp
|
||||
! File creation propertly
|
||||
! list identifier
|
||||
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
|
||||
! File access property list
|
||||
! identifier
|
||||
INTEGER :: creation_prp_default
|
||||
INTEGER :: access_prp_default
|
||||
INTEGER :: namelen ! Length of the name character string
|
||||
INTEGER, EXTERNAL :: h5fcreate_c
|
||||
|
||||
creation_prp_default = H5P_DEFAULT_F
|
||||
access_prp_default = H5P_DEFAULT_F
|
||||
|
||||
if (present(creation_prp)) creation_prp_default = creation_prp
|
||||
if (present(access_prp)) access_prp_default = access_prp
|
||||
namelen = LEN(name)
|
||||
hdferr = h5fcreate_c(name, namelen, access_flags, &
|
||||
creation_prp_default, access_prp_default, file_id)
|
||||
|
||||
END SUBROUTINE h5fcreate_f
|
||||
|
||||
SUBROUTINE h5fflush_f(object_id, scope, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: object_id !identifier for any object
|
||||
!associate with a file,
|
||||
!including the file itself,
|
||||
!a dataset, a group, an
|
||||
!attribute, or a named
|
||||
!data type
|
||||
|
||||
INTEGER, INTENT(IN) :: scope !scope of the flushing
|
||||
!action, possible values
|
||||
!are: H5F_SCOPE_GLOBAL_F
|
||||
! which flushes the entire
|
||||
!virtual file,
|
||||
!and H5F_SCOPE_LOCAL_F
|
||||
!which flushes only the
|
||||
!specified file.
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5fflush_c
|
||||
|
||||
hdferr = h5fflush_c(object_id, scope)
|
||||
|
||||
END SUBROUTINE h5fflush_f
|
||||
|
||||
|
||||
SUBROUTINE h5fmount_f(loc_id, dsetname, file_id, hdferr, access_prp)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group
|
||||
! in which dsetname is defined
|
||||
CHARACTER(LEN=*), INTENT(IN) :: dsetname ! Name of the dataset
|
||||
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier for the
|
||||
! file to be mounted
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
|
||||
! File access property list
|
||||
! identifier
|
||||
INTEGER :: access_prp_default
|
||||
INTEGER :: namelen ! Length of the dsetname character string
|
||||
INTEGER, EXTERNAL :: h5fmount_c
|
||||
|
||||
access_prp_default = H5P_DEFAULT_F
|
||||
if (present(access_prp)) access_prp_default = access_prp
|
||||
namelen = LEN(dsetname)
|
||||
hdferr = h5fmount_c(loc_id, dsetname, namelen, file_id, access_prp_default)
|
||||
|
||||
END SUBROUTINE h5fmount_f
|
||||
|
||||
|
||||
SUBROUTINE h5funmount_f(loc_id, dsetname, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group
|
||||
! in which dsetname is defined
|
||||
CHARACTER(LEN=*), INTENT(IN) :: dsetname ! Name of the dataset
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen ! Length of the dsetname character string
|
||||
INTEGER, EXTERNAL :: h5funmount_c
|
||||
|
||||
namelen = LEN(dsetname)
|
||||
hdferr = h5funmount_c(loc_id, dsetname, namelen)
|
||||
|
||||
END SUBROUTINE h5funmount_f
|
||||
|
||||
SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, &
|
||||
access_prp)
|
||||
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file
|
||||
INTEGER, INTENT(IN) :: access_flags ! File access flags
|
||||
INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
|
||||
! File access property list
|
||||
! identifier
|
||||
INTEGER :: access_prp_default
|
||||
INTEGER :: namelen ! Length of the name character string
|
||||
INTEGER, EXTERNAL :: h5fopen_c
|
||||
|
||||
access_prp_default = H5P_DEFAULT_F
|
||||
if (present(access_prp)) access_prp_default = access_prp
|
||||
namelen = LEN(name)
|
||||
hdferr = h5fopen_c(name, namelen, access_flags, &
|
||||
access_prp_default, file_id)
|
||||
|
||||
END SUBROUTINE h5fopen_f
|
||||
|
||||
SUBROUTINE h5freopen_f(file_id, ret_file_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
||||
INTEGER(HID_T), INTENT(OUT) :: ret_file_id ! New File identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5freopen_c
|
||||
|
||||
hdferr = h5freopen_c(file_id, ret_file_id)
|
||||
|
||||
END SUBROUTINE h5freopen_f
|
||||
|
||||
SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
||||
INTEGER(HID_T), INTENT(OUT) :: prop_id ! File creation property
|
||||
! list identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5fget_create_plist_c
|
||||
|
||||
hdferr = h5fget_create_plist_c(file_id, prop_id)
|
||||
|
||||
END SUBROUTINE h5fget_create_plist_f
|
||||
|
||||
SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
||||
INTEGER(HID_T), INTENT(OUT) :: access_id ! File access property
|
||||
! list identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5fget_access_plist_c
|
||||
|
||||
hdferr = h5fget_access_plist_c(file_id, access_id)
|
||||
|
||||
END SUBROUTINE h5fget_access_plist_f
|
||||
|
||||
|
||||
SUBROUTINE h5fis_hdf5_f(name, status, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file
|
||||
LOGICAL, INTENT(OUT) :: status ! Indicates if file
|
||||
! is an HDF5 file
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen ! Length of the name character string
|
||||
INTEGER :: flag ! "TRUE/FALSE" flag from C routine
|
||||
! to define status value.
|
||||
INTEGER, EXTERNAL :: h5fis_hdf5_c
|
||||
|
||||
namelen = LEN(name)
|
||||
hdferr = h5fis_hdf5_c(name, namelen, flag)
|
||||
status = .TRUE.
|
||||
if (flag .EQ. 0) status = .FALSE.
|
||||
|
||||
END SUBROUTINE h5fis_hdf5_f
|
||||
|
||||
SUBROUTINE h5fclose_f(file_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5fclose_c
|
||||
|
||||
hdferr = h5fclose_c(file_id)
|
||||
|
||||
END SUBROUTINE h5fclose_f
|
||||
|
||||
END MODULE H5F
|
536
fortran/src/H5Gf.c
Normal file
536
fortran/src/H5Gf.c
Normal file
@ -0,0 +1,536 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gcreate_c
|
||||
* Purpose: Call H5Gcreate to create a group
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the group
|
||||
* namelen - name length
|
||||
* size_hint - length of names in the group
|
||||
* Outputs: grp_id - group identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 5, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
size_t c_size_hint;
|
||||
hid_t c_grp_id;
|
||||
hid_t c_loc_id;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
/*
|
||||
* Call H5Gcreate function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F )
|
||||
c_grp_id = H5Gcreate(c_loc_id, c_name, NULL);
|
||||
else {
|
||||
c_size_hint = *size_hint;
|
||||
c_grp_id = H5Gcreate(c_loc_id, c_name, c_size_hint);
|
||||
}
|
||||
if (c_grp_id < 0) return ret_value;
|
||||
*grp_id = (hid_t_f)c_grp_id;
|
||||
HDfree(c_name);
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gopen_c
|
||||
* Purpose: Call H5Gopen to open a dataset
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the group
|
||||
* namelen - name length
|
||||
* Outputs: grp_id - group identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 5, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hid_t c_grp_id;
|
||||
hid_t c_loc_id;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Gopen function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_grp_id = H5Gopen(c_loc_id, c_name);
|
||||
|
||||
HDfree(c_name);
|
||||
if (c_grp_id < 0) return ret_value;
|
||||
*grp_id = (hid_t_f)c_grp_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gget_obj_info_idx_c
|
||||
* Purpose: Call H5Gget_obj_info to return name and the type of group
|
||||
* member
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the group
|
||||
* namelen - name length
|
||||
* idx - index of the group member
|
||||
* Outputs: obj_name - buffer to store member's name
|
||||
* obj_namelen - length of the buffer
|
||||
* obj_type - type of the object
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 5, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5gget_obj_info_idx_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
int c_obj_namelen;
|
||||
char *c_obj_name = NULL;
|
||||
int type;
|
||||
int c_idx;
|
||||
herr_t c_ret_value;
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Allocate buffer to hold name of the object
|
||||
*/
|
||||
if (*obj_namelen) c_obj_name = (char *)HDmalloc(*obj_namelen + 1);
|
||||
if (c_obj_name == NULL) return ret_value;
|
||||
/*
|
||||
* Call H5Gget_obj_info_idx function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_idx = *idx;
|
||||
c_ret_value = H5Gget_obj_info_idx(c_loc_id, c_name, c_idx, &c_obj_name, &type);
|
||||
|
||||
if (c_ret_value < 0) {
|
||||
HDfree(c_obj_name);
|
||||
return ret_value;
|
||||
}
|
||||
switch (type) {
|
||||
case H5G_LINK:
|
||||
*obj_type = H5G_LINK_F;
|
||||
break;
|
||||
|
||||
case H5G_GROUP:
|
||||
*obj_type = H5G_GROUP_F;
|
||||
break;
|
||||
|
||||
case H5G_DATASET:
|
||||
*obj_type = H5G_DATASET_F;
|
||||
break;
|
||||
|
||||
case H5G_TYPE:
|
||||
*obj_type = H5G_TYPE_F;
|
||||
break;
|
||||
default:
|
||||
return ret_value;
|
||||
}
|
||||
/*
|
||||
* Convert C name to FORTRAN and place it in the given buffer
|
||||
*/
|
||||
c_obj_namelen = *obj_namelen;
|
||||
HDpackFstring(c_obj_name, _fcdtocp(obj_name), c_obj_namelen);
|
||||
if (c_obj_name) HDfree(c_obj_name);
|
||||
if (c_name) HDfree(c_name);
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gn_members_c
|
||||
* Purpose: Call H5Gn_members to find number of objects in the group
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the group
|
||||
* namelen - name length
|
||||
* Outputs: nmemebers - number of members
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 5, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
int c_nmembers;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Gn_members function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_nmembers = H5Gn_members(c_loc_id, c_name);
|
||||
|
||||
HDfree(c_name);
|
||||
if (c_nmembers < 0) return ret_value;
|
||||
*nmembers = (int_f)c_nmembers;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gclose_c
|
||||
* Purpose: Call H5Gclose to close the group
|
||||
* Inputs: grp_id - identifier of the group to be closed
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 5, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5gclose_c ( hid_t_f *grp_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_grp_id;
|
||||
|
||||
c_grp_id = *grp_id;
|
||||
if ( H5Gclose(c_grp_id) < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5glink_c
|
||||
* Purpose: Call H5Glink to link the specified type
|
||||
* Inputs: loc_id - identifier of file or group
|
||||
* link_type - link type
|
||||
* current_name - name of the existing object for hard link,
|
||||
* anything for the soft link
|
||||
* current_namelen - current name lenghth
|
||||
* new_name - new name for the object
|
||||
* new_namelen - new_name lenghth
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Mingshi Chen
|
||||
* Friday, August 6, 1999
|
||||
* Modifications: Elena Pourmal
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
H5G_link_t c_link_type;
|
||||
char *c_current_name, *c_new_name;
|
||||
int c_current_namelen, c_new_namelen;
|
||||
herr_t c_ret_value;
|
||||
/*
|
||||
* Convert Fortran name to C name
|
||||
*/
|
||||
c_current_namelen =*current_namelen;
|
||||
c_new_namelen =*new_namelen;
|
||||
c_current_name = (char *)HD5f2cstring(current_name, c_current_namelen);
|
||||
c_new_name = (char *)HD5f2cstring(new_name, c_new_namelen);
|
||||
if((c_current_name == NULL)||(c_new_name == NULL))
|
||||
return ret_value;
|
||||
/*
|
||||
* Call H5Glink function
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_link_type = (H5G_link_t)*link_type;
|
||||
c_ret_value = H5Glink(c_loc_id, c_link_type, c_current_name, c_new_name);
|
||||
if(c_current_name) HDfree(c_current_name);
|
||||
if(c_new_name) HDfree(c_new_name);
|
||||
if(c_ret_value < 0) return ret_value;
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value ;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gunlink_c
|
||||
* Purpose: Call H5Gunlink to remove the specified name
|
||||
* Inputs: loc_id - identifier of file or group
|
||||
* name - name of the object to unlink
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Mingshi Chen
|
||||
* Friday, August 6, 1999
|
||||
* Modifications: Elena Pourmal
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5gunlink_c(hid_t_f *loc_id, _fcd name, int_f *namelen)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
herr_t c_ret_value;
|
||||
/*
|
||||
* Convert Fortran name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if(c_name == NULL) return ret_value;
|
||||
/*
|
||||
* Call H5Gunlink function
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_ret_value = H5Gunlink(c_loc_id, c_name);
|
||||
if(c_name) HDfree(c_name);
|
||||
if(c_ret_value < 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value ;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gmove_c
|
||||
* Purpose: Call H5Gmove to rename an object within an HDF5 file
|
||||
* Inputs: loc_id - identifier of file or group
|
||||
* src_name - name of the original object
|
||||
* src_namelen - original name lenghth
|
||||
* dst_name - new name for the object
|
||||
* dst_namelen - new name lenghth
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Mingshi Chen
|
||||
* Friday, August 6, 1999
|
||||
* Modifications: Elena Pourmal
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f*dst_namelen)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
char *c_src_name, *c_dst_name;
|
||||
int c_src_namelen, c_dst_namelen;
|
||||
herr_t c_ret_value;
|
||||
/*
|
||||
* Convert Fortran name to C name
|
||||
*/
|
||||
c_src_namelen = *src_namelen;
|
||||
c_dst_namelen = *dst_namelen;
|
||||
c_src_name = (char *)HD5f2cstring(src_name, c_src_namelen);
|
||||
c_dst_name = (char *)HD5f2cstring(dst_name, c_dst_namelen);
|
||||
if((c_src_name == NULL)||(c_dst_name == NULL))
|
||||
return ret_value;
|
||||
/*
|
||||
* Call H5Gmove function
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_ret_value = H5Gmove(c_loc_id, c_src_name, c_dst_name);
|
||||
if(c_src_name) HDfree(c_src_name);
|
||||
if(c_dst_name) HDfree(c_dst_name);
|
||||
if(c_ret_value < 0) return ret_value;
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value ;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gget_linkval_c
|
||||
* Purpose: Call H5Gget_linkval to return the name of object
|
||||
* Inputs: loc_id - identifier of file or group
|
||||
* name - name of the object that symbolic link points to
|
||||
* namelen - the name lenghth
|
||||
* size - lenghth of retrurned value
|
||||
* Outputs: value - name to be returned
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Mingshi Chen
|
||||
* Friday, August 6, 1999
|
||||
* Modifications: Elena Pourmal
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value )
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
char *c_value = NULL;
|
||||
size_t c_size;
|
||||
herr_t c_ret_value;
|
||||
/*
|
||||
* Convert Fortran name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if(c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Allocate buffer to hold name of the value
|
||||
*/
|
||||
if(*size) c_value = (char *)HDmalloc(*size);
|
||||
if(c_value == NULL) {
|
||||
HDfree(c_name);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call H5Gget_linkval function
|
||||
*/
|
||||
|
||||
c_size = (size_t)*size;
|
||||
c_loc_id = *loc_id;
|
||||
c_ret_value = H5Gget_linkval(c_loc_id, c_name, c_size, c_value);
|
||||
if(c_ret_value < 0) {
|
||||
if(c_value) HDfree(c_value);
|
||||
if(c_name) HDfree(c_name);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert C name to FORTRAN and place it in the given buffer
|
||||
*/
|
||||
HDpackFstring(c_value, _fcdtocp(value), (int)*size);
|
||||
|
||||
if(c_value) HDfree(c_value);
|
||||
if(c_name) HDfree(c_name);
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value ;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gset_comment_c
|
||||
* Purpose: Call H5Gset_comment to set comments for the specified object
|
||||
* Inputs: loc_id - identifier of file or group
|
||||
* name - name of object whose comment is to be set or reset
|
||||
* namelen - the name lenghth
|
||||
* comment - the new comment
|
||||
* commentlen - new comment lenghth
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Mingshi Chen
|
||||
* Friday, August 6, 1999
|
||||
* Modifications: Elena Pourmal
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5gset_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f*commentlen)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
char *c_name, *c_comment;
|
||||
int c_namelen, c_commentlen;
|
||||
herr_t c_ret_value;
|
||||
/*
|
||||
* Convert Fortran name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_commentlen =*commentlen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
c_comment = (char *)HD5f2cstring(comment, c_commentlen);
|
||||
if((c_name == NULL)||(c_comment == NULL))
|
||||
return ret_value;
|
||||
/*
|
||||
* Call H5Gset_comment function
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_ret_value = H5Gset_comment(c_loc_id, c_name, c_comment);
|
||||
if(c_name) HDfree(c_name);
|
||||
if(c_comment) HDfree(c_comment);
|
||||
if(c_ret_value < 0) return ret_value;
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value ;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5gget_comment_c
|
||||
* Purpose: Call H5Gget_comment to retrieve comments for the specified object
|
||||
* Inputs: loc_id - identifier of file or group
|
||||
* name - name of object whose comment is to be set or reset
|
||||
* namelen - the name lenghth
|
||||
* bufsize - at most bufsize characters
|
||||
* comment - the new comment
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Mingshi Chen
|
||||
* Friday, August 6, 1999
|
||||
* Modifications: Elena Pourmal
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
char *c_comment = NULL;
|
||||
size_t c_bufsize;
|
||||
herr_t c_ret_value;
|
||||
|
||||
/*
|
||||
* Convert Fortran name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if(c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Allocate buffer to hold the comment
|
||||
*/
|
||||
c_bufsize = (size_t)*bufsize;
|
||||
if(c_bufsize) c_comment = (char *)malloc(c_bufsize);
|
||||
if(c_comment == NULL) {
|
||||
HDfree(c_name);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call H5Gget_comment function
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_ret_value = H5Gget_comment(c_loc_id, c_name, c_bufsize, c_comment);
|
||||
if(c_ret_value < 0) {
|
||||
HDfree(c_name);
|
||||
HDfree(c_comment);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert C name to FORTRAN and place it in the given buffer
|
||||
*/
|
||||
HDpackFstring(c_comment, _fcdtocp(comment), (int)*bufsize);
|
||||
|
||||
if(c_name) HDfree(c_name);
|
||||
if(c_comment) HDfree(c_comment);
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value ;
|
||||
}
|
234
fortran/src/H5Gff.f90
Normal file
234
fortran/src/H5Gff.f90
Normal file
@ -0,0 +1,234 @@
|
||||
!
|
||||
! This file contains Fortran90 interfaces for H5F functions.
|
||||
!
|
||||
MODULE H5G
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
CONTAINS
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
|
||||
INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint
|
||||
! Parameter indicating
|
||||
! the number of bytes
|
||||
! to reserve for the
|
||||
! names that will appear
|
||||
! in the group
|
||||
INTEGER :: namelen ! Length of the name character string
|
||||
INTEGER(SIZE_T) :: size_hint_default
|
||||
INTEGER, EXTERNAL :: h5gcreate_c
|
||||
size_hint_default = OBJECT_NAMELEN_DEFAULT_F
|
||||
if (present(size_hint)) size_hint_default = size_hint
|
||||
namelen = LEN(name)
|
||||
hdferr = h5gcreate_c(loc_id, name, namelen, size_hint_default, &
|
||||
grp_id)
|
||||
|
||||
END SUBROUTINE h5gcreate_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
|
||||
INTEGER(HID_T), INTENT(OUT) :: grp_id ! File identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Length of the name character string
|
||||
INTEGER, EXTERNAL :: h5gopen_c
|
||||
|
||||
namelen = LEN(name)
|
||||
hdferr = h5gopen_c(loc_id, name, namelen, grp_id)
|
||||
|
||||
END SUBROUTINE h5gopen_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gclose_f(grp_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5gclose_c
|
||||
|
||||
hdferr = h5gclose_c(grp_id)
|
||||
|
||||
END SUBROUTINE h5gclose_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, &
|
||||
obj_name, obj_type, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
|
||||
INTEGER, INTENT(IN) :: idx ! Index of member object
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: obj_name ! Name of the object
|
||||
INTEGER, INTENT(OUT) :: obj_type ! Object type
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Length of the name character string
|
||||
INTEGER :: obj_namelen ! Length of the obj_name character string
|
||||
INTEGER, EXTERNAL :: h5gget_obj_info_idx_c
|
||||
|
||||
namelen = LEN(name)
|
||||
obj_namelen = LEN(obj_name)
|
||||
hdferr = h5gget_obj_info_idx_c(loc_id, name, namelen, idx, &
|
||||
obj_name, obj_namelen, obj_type)
|
||||
|
||||
END SUBROUTINE h5gget_obj_info_idx_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
|
||||
INTEGER, INTENT(OUT) :: nmembers ! Number of members in the
|
||||
! group
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Length of the name character string
|
||||
INTEGER, EXTERNAL :: h5gn_members_c
|
||||
|
||||
namelen = LEN(name)
|
||||
hdferr = h5gn_members_c(loc_id, name, namelen, nmembers)
|
||||
|
||||
END SUBROUTINE h5gn_members_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5glink_f(loc_id, link_type, current_name, &
|
||||
new_name, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
INTEGER, INTENT(IN) :: link_type ! link type
|
||||
! Possible values are:
|
||||
! H5G_LINK_HARD_F (0) or
|
||||
! H5G_LINK_SOFT_F (1)
|
||||
|
||||
CHARACTER(LEN=*), INTENT(IN) :: current_name
|
||||
! Current name of an object
|
||||
CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: current_namelen ! Lenghth of the current_name string
|
||||
INTEGER :: new_namelen ! Lenghth of the new_name string
|
||||
INTEGER, EXTERNAL :: h5glink_c
|
||||
|
||||
current_namelen = LEN(current_name)
|
||||
new_namelen = LEN(new_name)
|
||||
hdferr = h5glink_c(loc_id, link_type, current_name, &
|
||||
current_namelen, new_name, new_namelen)
|
||||
END SUBROUTINE h5glink_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gunlink_f(loc_id, name, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an object
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Lenghth of the name character string
|
||||
|
||||
INTEGER, EXTERNAL :: h5gunlink_c
|
||||
|
||||
namelen = LEN(name)
|
||||
hdferr = h5gunlink_c(loc_id, name, namelen)
|
||||
END SUBROUTINE h5gunlink_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object
|
||||
CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Lenghth of the current_name string
|
||||
INTEGER :: new_namelen ! Lenghth of the new_name string
|
||||
INTEGER, EXTERNAL :: h5gmove_c
|
||||
|
||||
namelen = LEN(name)
|
||||
new_namelen = LEN(new_name)
|
||||
hdferr = h5gmove_c(loc_id, name, namelen, new_name, new_namelen)
|
||||
END SUBROUTINE h5gmove_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object
|
||||
INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer
|
||||
CHARACTER(LEN=size), INTENT(OUT) :: buffer
|
||||
! Buffer to hold a name of
|
||||
! the object symbolic link
|
||||
! points to
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Lenghth of the current_name string
|
||||
INTEGER, EXTERNAL :: h5gget_linkval_c
|
||||
|
||||
namelen = LEN(name)
|
||||
hdferr = h5gget_linkval_c(loc_id, name, namelen, size, buffer)
|
||||
END SUBROUTINE h5gget_linkval_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object
|
||||
CHARACTER(LEN=*), INTENT(IN) :: comment ! New name of an object
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Lenghth of the current_name string
|
||||
INTEGER :: commentlen ! Lenghth of the comment string
|
||||
INTEGER, EXTERNAL :: h5gset_comment_c
|
||||
|
||||
namelen = LEN(name)
|
||||
commentlen = LEN(comment)
|
||||
hdferr = h5gset_comment_c(loc_id, name, namelen, comment, commentlen)
|
||||
END SUBROUTINE h5gset_comment_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object
|
||||
INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer
|
||||
CHARACTER(LEN=size), INTENT(OUT) :: buffer
|
||||
! Buffer to hold a comment
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Lenghth of the current_name string
|
||||
INTEGER, EXTERNAL :: h5gget_comment_c
|
||||
|
||||
namelen = LEN(name)
|
||||
hdferr = h5gget_comment_c(loc_id, name, namelen, size, buffer)
|
||||
END SUBROUTINE h5gget_comment_f
|
||||
|
||||
!!!============================================================
|
||||
|
||||
END MODULE H5G
|
220
fortran/src/H5Git.c
Normal file
220
fortran/src/H5Git.c
Normal file
@ -0,0 +1,220 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
* Copyright (C) 1999 National Center for Supercomputing Applications.
|
||||
* All rights reserved.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <hdf5.h>
|
||||
#include "H5Git.h"
|
||||
#define FALSE 0
|
||||
|
||||
herr_t count_elems(hid_t loc_id, const char *name, void *opdata);
|
||||
/*herr_t obj_info(hid_t loc_id, const char *name, void *opdata);*/
|
||||
herr_t obj_info(hid_t loc_id, char *name, void *opdata);
|
||||
|
||||
typedef struct retval {
|
||||
char * name;
|
||||
int type;
|
||||
} retval_t;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Gn_members
|
||||
*
|
||||
* Purpose: Return the number of members of a group. The "members"
|
||||
* are the datasets, groups, and named datatypes in the
|
||||
* group.
|
||||
*
|
||||
* This function wraps the H5Ginterate() function in
|
||||
* a completely obvious way, uses the operator
|
||||
* function 'count_members()' below;
|
||||
*
|
||||
* See also: H5Giterate()
|
||||
*
|
||||
* IN: hid_t file: the file id
|
||||
* IN: char *group_name: the name of the group
|
||||
*
|
||||
* Errors:
|
||||
*
|
||||
* Return: Success: The object number of members of
|
||||
* the group.
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: REMcG
|
||||
* Monday, Aug 2, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
H5Gn_members( hid_t loc_id, char *group_name )
|
||||
{
|
||||
int res;
|
||||
int nelems = 0;
|
||||
|
||||
res = H5Giterate(loc_id, group_name, NULL, count_elems, (void *)&nelems);
|
||||
if (res < 0) {
|
||||
return res;
|
||||
} else {
|
||||
return( nelems );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Gget_obj_info_idx
|
||||
*
|
||||
* Purpose: Return the name and type of the member of the group
|
||||
* at index 'idx', as defined by the H5Giterator()
|
||||
* function.
|
||||
*
|
||||
* This function wraps the H5Ginterate() function in
|
||||
* a completely obvious way, uses the operator
|
||||
* function 'get_objinfo()' below;
|
||||
*
|
||||
* See also: H5Giterate()
|
||||
*
|
||||
* IN: hid_t file: the file id
|
||||
* IN: char *group_name: the name of the group
|
||||
* IN: int idx: the index of the member object (see
|
||||
* H5Giterate()
|
||||
* OUT: char **objname: the name of the member object
|
||||
* OUT: int *type: the type of the object (dataset,
|
||||
* group, or named datatype)
|
||||
*
|
||||
* Errors:
|
||||
*
|
||||
* Return: Success: The object number of members of
|
||||
* the group.
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: REMcG
|
||||
* Monday, Aug 2, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Gget_obj_info_idx( hid_t loc_id, char *group_name, int idx, char **objname, int *type )
|
||||
{
|
||||
int res;
|
||||
retval_t retVal;
|
||||
|
||||
res = H5Giterate(loc_id, group_name, &idx, obj_info, (void *)&retVal);
|
||||
if (res < 0) {
|
||||
return res;
|
||||
}
|
||||
*objname = retVal.name;
|
||||
*type = retVal.type;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: count_elems
|
||||
*
|
||||
* Purpose: this is the operator function called by H5Gn_members().
|
||||
*
|
||||
* This function is passed to H5Ginterate().
|
||||
*
|
||||
* See also: H5Giterate()
|
||||
*
|
||||
* OUT: 'opdata' is returned as an integer with the
|
||||
* number of members in the group.
|
||||
*
|
||||
* Errors:
|
||||
*
|
||||
* Return: Success: The object number of members of
|
||||
* the group.
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: REMcG
|
||||
* Monday, Aug 2, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static herr_t
|
||||
count_elems(hid_t loc_id, const char *name, void *opdata)
|
||||
{
|
||||
herr_t res;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
res = H5Gget_objinfo(loc_id, name, FALSE, &statbuf);
|
||||
if (res < 0) {
|
||||
return 1;
|
||||
}
|
||||
switch (statbuf.type) {
|
||||
case H5G_GROUP:
|
||||
(*(int *)opdata)++;
|
||||
break;
|
||||
case H5G_DATASET:
|
||||
(*(int *)opdata)++;
|
||||
break;
|
||||
case H5G_TYPE:
|
||||
(*(int *)opdata)++;
|
||||
break;
|
||||
default:
|
||||
(*(int *)opdata)++; /* ???? count links or no? */
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: obj_info
|
||||
*
|
||||
* Purpose: this is the operator function called by H5Gn_members().
|
||||
*
|
||||
* This function is passed to H5Ginterate().
|
||||
*
|
||||
* See also: H5Giterate()
|
||||
*
|
||||
* OUT: 'opdata' is returned as a 'recvar_t', containing
|
||||
* the object name and type.
|
||||
*
|
||||
* Errors:
|
||||
*
|
||||
* Return: Success: The object number of members of
|
||||
* the group.
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: REMcG
|
||||
* Monday, Aug 2, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
* group, or named datatype)
|
||||
*/
|
||||
static herr_t
|
||||
/*obj_info(hid_t loc_id, const char *name, void *opdata)*/
|
||||
obj_info(hid_t loc_id, char *name, void *opdata)
|
||||
{
|
||||
herr_t res;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
res = H5Gget_objinfo(loc_id, name, FALSE, &statbuf);
|
||||
if (res < 0) {
|
||||
((retval_t *)opdata)->type = 0;
|
||||
((retval_t *)opdata)->name = NULL;
|
||||
return 1;
|
||||
} else {
|
||||
((retval_t *)opdata)->type = statbuf.type;
|
||||
/* ((retval_t *)opdata)->name = strdup(name); */
|
||||
((retval_t *)opdata)->name = name;
|
||||
return 1;
|
||||
}
|
||||
}
|
16
fortran/src/H5Git.h
Normal file
16
fortran/src/H5Git.h
Normal file
@ -0,0 +1,16 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
* Copyright (C) 1997 National Center for Supercomputing Applications.
|
||||
* All rights reserved.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef _H5Git_H
|
||||
#define _H5Git_H
|
||||
|
||||
#include <hdf5.h>
|
||||
|
||||
int H5Gn_members( hid_t loc_id, char *group_name );
|
||||
|
||||
herr_t H5Gget_obj_info_idx( hid_t loc_id, char *group_name, int idx, char **objname, int *type );
|
||||
|
||||
#endif /*_H5Git_H*/
|
29
fortran/src/H5If.c
Normal file
29
fortran/src/H5If.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5iget_type_c
|
||||
* Purpose: Call H5Iget_type to get the type of an object
|
||||
* Inputs: obj_id - object identifier
|
||||
* Outputs: type - object type
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Thursday, March 24, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5iget_type_c (hid_t_f *obj_id, int_f *type)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_obj_id;
|
||||
H5I_type_t c_type;
|
||||
|
||||
/*
|
||||
* Call H5Iget_type function.
|
||||
*/
|
||||
c_obj_id = *obj_id;
|
||||
c_type = H5Iget_type(c_obj_id);
|
||||
if (c_type == H5I_BADID) return ret_value;
|
||||
*type = (int_f)c_type;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
33
fortran/src/H5Iff.f90
Normal file
33
fortran/src/H5Iff.f90
Normal file
@ -0,0 +1,33 @@
|
||||
!
|
||||
! This file contains FORTRAN90 interfaces for H5I functions
|
||||
!
|
||||
MODULE H5I
|
||||
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
CONTAINS
|
||||
|
||||
SUBROUTINE h5iget_type_f(obj_id, type, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier
|
||||
INTEGER, INTENT(OUT) :: type !type of an object.
|
||||
!possible values are:
|
||||
!H5I_FILE_F(1)
|
||||
!H5I_GROUP_F(2)
|
||||
!H5I_DATATYPE_F(3)
|
||||
!H5I_DATASPACE_F(4)
|
||||
!H5I_DATASET_F(5)
|
||||
!H5I_ATTR_F(6)
|
||||
!H5I_BADID_F(-1)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5iget_type_c
|
||||
hdferr = h5iget_type_c(obj_id, type)
|
||||
END SUBROUTINE h5iget_type_f
|
||||
|
||||
END MODULE H5I
|
||||
|
||||
|
||||
|
||||
|
||||
|
1748
fortran/src/H5Pf.c
Normal file
1748
fortran/src/H5Pf.c
Normal file
File diff suppressed because it is too large
Load Diff
161
fortran/src/H5Pf_parallel.c
Normal file
161
fortran/src/H5Pf_parallel.c
Normal file
@ -0,0 +1,161 @@
|
||||
#include "H5f90.h"
|
||||
#include <mpi.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5pset_mpi_c
|
||||
* Purpose: Call H5Pset_mpi to set mode for parallel I/O and the user
|
||||
* supplied communicator and info object
|
||||
* Inputs: prp_id - property list identifier
|
||||
* comm - MPI communicator
|
||||
* info - MPI info object
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, June 8, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5pset_mpi_c(hid_t_f *prp_id, int_f* comm, int_f* info)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_prp_id;
|
||||
herr_t ret;
|
||||
MPI_Comm c_comm;
|
||||
MPI_Info c_info;
|
||||
c_comm = (MPI_Comm) *comm;
|
||||
c_info = (MPI_Info) *info;
|
||||
|
||||
/*
|
||||
* Call H5Pset_mpi function.
|
||||
*/
|
||||
c_prp_id = *prp_id;
|
||||
ret = H5Pset_mpi(c_prp_id, c_comm, c_info);
|
||||
if (ret < 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5pget_mpi_c
|
||||
* Purpose: Call H5Pget_mpi to retrieve communicator and info object
|
||||
* Inputs: prp_id - property list identifier
|
||||
* comm - buffer to return MPI communicator
|
||||
* info - buffer to return MPI info object
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, June 8, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5pget_mpi_c(hid_t_f *prp_id, int_f* comm, int_f* info)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_prp_id;
|
||||
herr_t ret;
|
||||
MPI_Comm c_comm;
|
||||
MPI_Info c_info;
|
||||
|
||||
/*
|
||||
* Call H5Pget_mpi function.
|
||||
*/
|
||||
c_prp_id = *prp_id;
|
||||
ret = H5Pget_mpi(c_prp_id, &c_comm, &c_info);
|
||||
if (ret < 0) return ret_value;
|
||||
*comm = (int_f) c_comm;
|
||||
*info = (int_f) c_info;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5pset_xfer_c
|
||||
* Purpose: Call H5Pset_xfer to set transfer mode of the dataset
|
||||
* trasfer property list
|
||||
* Inputs: prp_id - property list identifier
|
||||
* data_xfer_mode - transfer mode
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, June 15, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5pset_xfer_c(hid_t_f *prp_id, int_f* data_xfer_mode)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_prp_id;
|
||||
herr_t ret;
|
||||
H5D_transfer_t c_data_xfer_mode;
|
||||
int CASE;
|
||||
CASE = *data_xfer_mode;
|
||||
switch (CASE) {
|
||||
|
||||
case H5D_XFER_INDEPENDENT_F:
|
||||
c_data_xfer_mode = H5D_XFER_INDEPENDENT;
|
||||
break;
|
||||
|
||||
case H5D_XFER_COLLECTIVE_F:
|
||||
c_data_xfer_mode = H5D_XFER_COLLECTIVE;
|
||||
break;
|
||||
|
||||
case H5D_XFER_DFLT_F:
|
||||
c_data_xfer_mode = H5D_XFER_DFLT;
|
||||
break;
|
||||
default:
|
||||
return ret_value;
|
||||
}
|
||||
/*
|
||||
* Call H5Pset_xfer function.
|
||||
*/
|
||||
c_prp_id = *prp_id;
|
||||
ret = H5Pset_xfer(c_prp_id, c_data_xfer_mode);
|
||||
if (ret < 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5pget_xfer_c
|
||||
* Purpose: Call H5Pget_xfer to get transfer mode of the dataset
|
||||
* trasfer property list
|
||||
* Inputs: prp_id - property list identifier
|
||||
* data_xfer_mode - buffer to retrieve transfer mode
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Thursday, June 15, 2000
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5pget_xfer_c(hid_t_f *prp_id, int_f* data_xfer_mode)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_prp_id;
|
||||
herr_t ret;
|
||||
H5D_transfer_t c_data_xfer_mode;
|
||||
int CASE;
|
||||
|
||||
/*
|
||||
* Call H5Pget_xfer function.
|
||||
*/
|
||||
c_prp_id = *prp_id;
|
||||
ret = H5Pget_xfer(c_prp_id, &c_data_xfer_mode);
|
||||
if (ret < 0) return ret_value;
|
||||
|
||||
CASE = (int)c_data_xfer_mode;
|
||||
switch (CASE) {
|
||||
|
||||
case H5D_XFER_INDEPENDENT:
|
||||
*data_xfer_mode = H5D_XFER_INDEPENDENT_F;
|
||||
break;
|
||||
|
||||
case H5D_XFER_COLLECTIVE:
|
||||
*data_xfer_mode = H5D_XFER_COLLECTIVE_F;
|
||||
break;
|
||||
|
||||
case H5D_XFER_DFLT:
|
||||
*data_xfer_mode = H5D_XFER_DFLT_F;
|
||||
break;
|
||||
|
||||
default:
|
||||
return ret_value;
|
||||
}
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
744
fortran/src/H5Pff.f90
Normal file
744
fortran/src/H5Pff.f90
Normal file
@ -0,0 +1,744 @@
|
||||
!
|
||||
! This file contains Fortran90 interfaces for H5P functions.
|
||||
!
|
||||
MODULE H5P
|
||||
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
INTERFACE h5pset_fill_value_f
|
||||
MODULE PROCEDURE h5pset_fill_value_integer
|
||||
MODULE PROCEDURE h5pset_fill_value_real
|
||||
! Comment if on T3E
|
||||
MODULE PROCEDURE h5pset_fill_value_double
|
||||
! End comment if on T3E
|
||||
MODULE PROCEDURE h5pset_fill_value_char
|
||||
END INTERFACE
|
||||
|
||||
INTERFACE h5pget_fill_value_f
|
||||
MODULE PROCEDURE h5pget_fill_value_integer
|
||||
MODULE PROCEDURE h5pget_fill_value_real
|
||||
! Comment if on T3E
|
||||
MODULE PROCEDURE h5pget_fill_value_double
|
||||
! End comment if on T3E
|
||||
MODULE PROCEDURE h5pget_fill_value_char
|
||||
END INTERFACE
|
||||
|
||||
CONTAINS
|
||||
|
||||
SUBROUTINE h5pcreate_f(classtype, prp_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(IN) :: classtype ! The type of the property list
|
||||
! to be created. Possible values
|
||||
! are:
|
||||
! H5P_FILE_CREATE_F (0)
|
||||
! H5P_FILE_ACCESS_F (1)
|
||||
! H5P_DATASET_CREATE_F (2)
|
||||
! H5P_DATASET_XFER_F (3)
|
||||
! H5P_MOUNT_F (4)
|
||||
INTEGER(HID_T), INTENT(OUT) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pcreate_c
|
||||
hdferr = h5pcreate_c(classtype, prp_id)
|
||||
END SUBROUTINE h5pcreate_f
|
||||
|
||||
|
||||
SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: flag ! TRUE/FALSE flag to set the dataset
|
||||
! transfer property for partila writing/reading
|
||||
! compound datatype
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_preserve_c
|
||||
hdferr = h5pset_preserve_c(prp_id, flag)
|
||||
END SUBROUTINE h5pset_preserve_f
|
||||
|
||||
SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: flag ! TRUE/FALSE flag. Shows status of the dataset's
|
||||
! transfer property for partial writing/reading
|
||||
! compound datatype
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_preserve_c
|
||||
hdferr = h5pget_preserve_c(prp_id, flag)
|
||||
END SUBROUTINE h5pget_preserve_f
|
||||
|
||||
SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: classtype ! The type of the property list
|
||||
! to be created. Possible values
|
||||
! are:
|
||||
! H5P_NO_CLASS (-1)
|
||||
! H5P_FILE_CREATE_F (0)
|
||||
! H5P_FILE_ACCESS_F (1)
|
||||
! H5PE_DATASET_CREATE_F (2)
|
||||
! H5P_DATASET_XFER_F (3)
|
||||
! H5P_MOUNT_F (4)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_class_c
|
||||
hdferr = h5pget_class_c(prp_id, classtype)
|
||||
END SUBROUTINE h5pget_class_f
|
||||
|
||||
|
||||
SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(OUT) :: new_prp_id
|
||||
! Identifier of property list
|
||||
! copy
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pcopy_c
|
||||
hdferr = h5pcopy_c(prp_id, new_prp_id)
|
||||
END SUBROUTINE h5pcopy_f
|
||||
|
||||
|
||||
SUBROUTINE h5pclose_f(prp_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pclose_c
|
||||
hdferr = h5pclose_c(prp_id)
|
||||
END SUBROUTINE h5pclose_f
|
||||
|
||||
|
||||
SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions
|
||||
INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims
|
||||
! Array containing sizes of
|
||||
! chunk dimensions
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_chunk_c
|
||||
hdferr = h5pset_chunk_c(prp_id, ndims, dims)
|
||||
END SUBROUTINE h5pset_chunk_f
|
||||
|
||||
|
||||
SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions to
|
||||
! to return
|
||||
INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims
|
||||
! Array containing sizes of
|
||||
! chunk dimensions
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code; number of
|
||||
! chunk dimensions on success,
|
||||
! -1 on failure
|
||||
INTEGER, EXTERNAL :: h5pget_chunk_c
|
||||
hdferr = h5pget_chunk_c(prp_id, ndims, dims)
|
||||
END SUBROUTINE h5pget_chunk_f
|
||||
|
||||
|
||||
SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: level ! Compression level
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_deflate_c
|
||||
hdferr = h5pset_deflate_c(prp_id, level)
|
||||
END SUBROUTINE h5pset_deflate_f
|
||||
|
||||
|
||||
SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
INTEGER, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_fill_value_c
|
||||
hdferr = h5pset_fill_value_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pset_fill_value_integer
|
||||
|
||||
|
||||
SUBROUTINE h5pget_fill_value_integer(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
INTEGER, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_fill_value_c
|
||||
hdferr = h5pget_fill_value_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pget_fill_value_integer
|
||||
|
||||
|
||||
SUBROUTINE h5pset_fill_value_real(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
REAL, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_fill_value_c
|
||||
hdferr = h5pset_fill_value_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pset_fill_value_real
|
||||
|
||||
|
||||
SUBROUTINE h5pget_fill_value_real(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
REAL, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_fill_value_c
|
||||
hdferr = h5pget_fill_value_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pget_fill_value_real
|
||||
|
||||
|
||||
SUBROUTINE h5pset_fill_value_double(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
DOUBLE PRECISION, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_fill_value_c
|
||||
hdferr = h5pset_fill_value_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pset_fill_value_double
|
||||
|
||||
|
||||
SUBROUTINE h5pget_fill_value_double(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
DOUBLE PRECISION, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_fill_value_c
|
||||
hdferr = h5pget_fill_value_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pget_fill_value_double
|
||||
|
||||
|
||||
SUBROUTINE h5pset_fill_value_char(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_fill_valuec_c
|
||||
hdferr = h5pset_fill_valuec_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pset_fill_value_char
|
||||
|
||||
|
||||
SUBROUTINE h5pget_fill_value_char(prp_id, type_id, fillvalue, &
|
||||
hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
|
||||
! of fillvalue datatype
|
||||
! (in memory)
|
||||
CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_fill_valuec_c
|
||||
hdferr = h5pget_fill_valuec_c(prp_id, type_id, fillvalue)
|
||||
END SUBROUTINE h5pget_fill_value_char
|
||||
|
||||
SUBROUTINE h5pget_version_f(prp_id, boot, freelist, &
|
||||
stab, shhdr, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, DIMENSION(:), INTENT(OUT) :: boot !array to put boot
|
||||
!block version number
|
||||
INTEGER, DIMENSION(:), INTENT(OUT) :: freelist !array to put global
|
||||
!freelist version number
|
||||
|
||||
INTEGER, DIMENSION(:), INTENT(OUT) :: stab !array to put symbol
|
||||
!table version number
|
||||
INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr !array to put shared
|
||||
!object header version number
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_version_c
|
||||
hdferr = h5pget_version_c(prp_id, boot, freelist, stab, shhdr)
|
||||
END SUBROUTINE h5pget_version_f
|
||||
|
||||
SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: size !Size of the user-block in bytes
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_userblock_c
|
||||
hdferr = h5pset_userblock_c(prp_id, size)
|
||||
END SUBROUTINE h5pset_userblock_f
|
||||
|
||||
|
||||
SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HSIZE_T), DIMENSION(:), INTENT(OUT) :: block_size !Size of the
|
||||
!user-block in bytes
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_userblock_c
|
||||
INTEGER :: len
|
||||
hdferr = h5pget_userblock_c(prp_id, block_size)
|
||||
END SUBROUTINE h5pget_userblock_f
|
||||
|
||||
SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr !Size of an object
|
||||
!offset in bytes
|
||||
INTEGER(SIZE_T), INTENT(IN) :: sizeof_size !Size of an object
|
||||
!length in bytes
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_sizes_c
|
||||
hdferr = h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size)
|
||||
END SUBROUTINE h5pset_sizes_f
|
||||
|
||||
|
||||
SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(SIZE_T), DIMENSION(:), INTENT(OUT) :: sizeof_addr !Size of an object
|
||||
!offset in bytes
|
||||
INTEGER(SIZE_T), DIMENSION(:), INTENT(OUT) :: sizeof_size !Size of an object
|
||||
!length in bytes
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_sizes_c
|
||||
hdferr = h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size)
|
||||
END SUBROUTINE h5pget_sizes_f
|
||||
|
||||
SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: ik ! Symbol table tree rank
|
||||
INTEGER, INTENT(IN) :: lk ! Symbol table node size
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_sym_k_c
|
||||
hdferr = h5pset_sym_k_c(prp_id, ik, lk)
|
||||
END SUBROUTINE h5pset_sym_k_f
|
||||
|
||||
|
||||
SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: ik !Symbol table tree rank
|
||||
INTEGER, INTENT(OUT) :: lk !Symbol table node size
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_sym_k_c
|
||||
hdferr = h5pget_sym_k_c(prp_id, ik, lk)
|
||||
END SUBROUTINE h5pget_sym_k_f
|
||||
|
||||
SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: ik ! 1/2 rank of chunked storage B-tree
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_istore_k_c
|
||||
hdferr = h5pset_istore_k_c(prp_id, ik)
|
||||
END SUBROUTINE h5pset_istore_k_f
|
||||
|
||||
|
||||
SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: ik !1/2 rank of chunked storage B-tree
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_istore_k_c
|
||||
hdferr = h5pget_istore_k_c(prp_id, ik)
|
||||
END SUBROUTINE h5pget_istore_k_f
|
||||
|
||||
SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: driver !low-level file driver identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_driver_c
|
||||
hdferr = h5pget_driver_c(prp_id, driver)
|
||||
END SUBROUTINE h5pget_driver_f
|
||||
|
||||
SUBROUTINE h5pset_stdio_f (prp_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_stdio_c
|
||||
hdferr = h5pset_stdio_c(prp_id)
|
||||
END SUBROUTINE h5pset_stdio_f
|
||||
|
||||
SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: io ! value indicates that the file
|
||||
!access property list is set to
|
||||
!the stdio driver
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_stdio_c
|
||||
hdferr = h5pget_stdio_c(prp_id, io)
|
||||
END SUBROUTINE h5pget_stdio_f
|
||||
|
||||
SUBROUTINE h5pset_sec2_f (prp_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_sec2_c
|
||||
hdferr = h5pset_sec2_c(prp_id)
|
||||
END SUBROUTINE h5pset_sec2_f
|
||||
|
||||
SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: sec2 ! value indicates whether the file
|
||||
!driver uses the functions declared
|
||||
!in the unistd.h file
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_sec2_c
|
||||
hdferr = h5pget_sec2_c(prp_id, sec2)
|
||||
END SUBROUTINE h5pget_sec2_f
|
||||
|
||||
SUBROUTINE h5pset_alignment_f(prp_id, threshold, alignment, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_alignment_c
|
||||
hdferr = h5pset_alignment_c(prp_id, threshold, alignment)
|
||||
END SUBROUTINE h5pset_alignment_f
|
||||
|
||||
SUBROUTINE h5pget_alignment_f(prp_id, threshold, alignment, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value
|
||||
INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_alignment_c
|
||||
hdferr = h5pget_alignment_c(prp_id, threshold, alignment)
|
||||
END SUBROUTINE h5pget_alignment_f
|
||||
|
||||
SUBROUTINE h5pset_core_f(prp_id, increment, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_core_c
|
||||
hdferr = h5pset_core_c(prp_id, increment)
|
||||
END SUBROUTINE h5pset_core_f
|
||||
|
||||
SUBROUTINE h5pget_core_f(prp_id, increment, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_core_c
|
||||
hdferr = h5pget_core_c(prp_id, increment)
|
||||
END SUBROUTINE h5pget_core_f
|
||||
|
||||
SUBROUTINE h5pset_family_f(prp_id, memb_size, memb_plist , hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes,
|
||||
!of each family member
|
||||
INTEGER(HID_T), INTENT(IN) :: memb_plist !Identifier of the file
|
||||
!access property list for
|
||||
!each member of the family
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_family_c
|
||||
hdferr = h5pset_family_c(prp_id, memb_size, memb_plist)
|
||||
END SUBROUTINE h5pset_family_f
|
||||
|
||||
|
||||
SUBROUTINE h5pget_family_f(prp_id, memb_size, memb_plist , hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes,
|
||||
!of each family member
|
||||
INTEGER(HID_T), INTENT(OUT) :: memb_plist !Identifier of the file
|
||||
!access property list for
|
||||
!each member of the family
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_family_c
|
||||
hdferr = h5pget_family_c(prp_id, memb_size, memb_plist)
|
||||
END SUBROUTINE h5pget_family_f
|
||||
|
||||
SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: mdc_nelmts !Number of elements (objects)
|
||||
! in the meta data cache
|
||||
INTEGER, INTENT(IN) :: rdcc_nelmts !Number of elements (objects)
|
||||
! in the meta data cache
|
||||
INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes !Total size of the raw data
|
||||
!chunk cache, in bytes
|
||||
REAL, INTENT(IN) :: rdcc_w0 !Preemption policy
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_cache_c
|
||||
hdferr = h5pset_cache_c(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 )
|
||||
END SUBROUTINE h5pset_cache_f
|
||||
|
||||
SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: mdc_nelmts !Number of elements (objects)
|
||||
! in the meta data cache
|
||||
INTEGER, INTENT(OUT) :: rdcc_nelmts !Number of elements (objects)
|
||||
! in the meta data cache
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes !Total size of the raw data
|
||||
!chunk cache, in bytes
|
||||
REAL, INTENT(OUT) :: rdcc_w0 !Preemption policy
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_cache_c
|
||||
hdferr = h5pget_cache_c(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0 )
|
||||
END SUBROUTINE h5pget_cache_f
|
||||
|
||||
SUBROUTINE h5pset_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: meta_ext !Name of the extension for
|
||||
!the metafile filename
|
||||
INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file
|
||||
! access property list
|
||||
CHARACTER(LEN=*), INTENT(IN) :: raw_ext !Name extension for the raw file filename
|
||||
INTEGER(HID_T), INTENT(IN) :: raw_plist !Identifier of the raw file
|
||||
!access property list
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: meta_len, raw_len;
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_split_c
|
||||
meta_len = LEN(meta_ext)
|
||||
raw_len = LEN(raw_ext)
|
||||
hdferr = h5pset_split_c(prp_id, meta_len, meta_ext, meta_plist, raw_len, raw_ext, raw_plist )
|
||||
END SUBROUTINE h5pset_split_f
|
||||
|
||||
SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,&
|
||||
raw_ext, raw_plist, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER(SIZE_T), INTENT(IN) :: meta_ext_size ! Number of characters of the meta
|
||||
! file extension to be copied to the
|
||||
! meta_ext buffer
|
||||
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: meta_ext !Name of the extension for
|
||||
!the metafile filename
|
||||
INTEGER(HID_T), INTENT(OUT) :: meta_plist ! Identifier of the meta file
|
||||
! access property list
|
||||
INTEGER(SIZE_T), INTENT(IN) :: raw_ext_size ! Number of characters of the raw
|
||||
! file extension to be copied to the
|
||||
! raw_ext buffer
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: raw_ext !Name extension for the raw file filename
|
||||
INTEGER(HID_T), INTENT(OUT) :: raw_plist !Identifier of the raw file
|
||||
!access property list
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_split_c
|
||||
hdferr = h5pget_split_c(prp_id, meta_ext_size, meta_ext, meta_plist, &
|
||||
raw_ext_size, raw_ext, raw_plist )
|
||||
END SUBROUTINE h5pget_split_f
|
||||
|
||||
|
||||
SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: gc_reference !the flag for garbage collecting
|
||||
! references for the file
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_gc_references_c
|
||||
hdferr = h5pset_gc_references_c(prp_id, gc_reference)
|
||||
END SUBROUTINE h5pset_gc_references_f
|
||||
|
||||
SUBROUTINE h5pget_gc_references_f (prp_id, gc_reference, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: gc_reference !the flag for garbage collecting
|
||||
! references for the file
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_gc_references_c
|
||||
hdferr = h5pget_gc_references_c(prp_id, gc_reference)
|
||||
END SUBROUTINE h5pget_gc_references_f
|
||||
|
||||
SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: layout !Type of storage layout for raw data
|
||||
!possible values are:
|
||||
!H5D_COMPACT_F(0)
|
||||
!H5D_CONTIGUOUS_F(1)
|
||||
!H5D_CHUNKED_F(2)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pset_layout_c
|
||||
hdferr = h5pset_layout_c(prp_id, layout)
|
||||
END SUBROUTINE h5pset_layout_f
|
||||
|
||||
SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: layout !Type of storage layout for raw data
|
||||
!possible values are:
|
||||
!H5D_COMPACT_F(0)
|
||||
!H5D_CONTIGUOUS_F(1)
|
||||
!H5D_CHUNKED_F(2)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_layout_c
|
||||
hdferr = h5pget_layout_c(prp_id, layout)
|
||||
END SUBROUTINE h5pget_layout_f
|
||||
|
||||
SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: filter !Filter to be added to the pipeline.
|
||||
INTEGER, INTENT(IN) :: flags !Bit vector specifying certain general
|
||||
!properties of the filter.
|
||||
INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts !Number of elements in cd_values.
|
||||
INTEGER, DIMENSION(*), INTENT(IN) :: cd_values !Auxiliary data for the filter.
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_filter_c
|
||||
hdferr = h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values )
|
||||
END SUBROUTINE h5pset_filter_f
|
||||
|
||||
SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: nfilters !the number of filters in the pipeline
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_nfilters_c
|
||||
hdferr = h5pget_nfilters_c(prp_id, nfilters)
|
||||
END SUBROUTINE h5pget_nfilters_f
|
||||
|
||||
SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: filter_number !Sequence number within the filter
|
||||
!pipeline of the filter for which
|
||||
!information is sought
|
||||
INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values !Auxiliary data for the filter.
|
||||
INTEGER, INTENT(OUT) :: flags !Bit vector specifying certain general
|
||||
!properties of the filter.
|
||||
INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts !Number of elements in cd_values.
|
||||
INTEGER(SIZE_T), INTENT(IN) :: namelen !Anticipated number of characters in name.
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name !Name of the filter
|
||||
INTEGER, INTENT(OUT) :: filter_id ! filter identification number
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_filter_c
|
||||
hdferr = h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, &
|
||||
cd_values, namelen, name, filter_id )
|
||||
END SUBROUTINE h5pget_filter_f
|
||||
|
||||
SUBROUTINE h5pset_external_f(prp_id, name, offset,bytes, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !Name of an external file
|
||||
INTEGER, INTENT(IN) :: offset !Offset, in bytes, from the beginning
|
||||
!of the file to the location in the file
|
||||
!where the data starts.
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the
|
||||
!file for the data
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_external_c
|
||||
INTEGER :: namelen
|
||||
namelen = LEN(name)
|
||||
|
||||
hdferr = h5pset_external_c(prp_id, name,namelen, offset, bytes)
|
||||
END SUBROUTINE h5pset_external_f
|
||||
|
||||
SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: count !number of external files for the
|
||||
!specified dataset
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5pget_external_count_c
|
||||
hdferr = h5pget_external_count_c(prp_id, count)
|
||||
END SUBROUTINE h5pget_external_count_f
|
||||
|
||||
|
||||
SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: idx !External file index.
|
||||
INTEGER(SIZE_T), INTENT(IN) :: name_size !Maximum length of name array
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name !Name of an external file
|
||||
INTEGER, INTENT(OUT) :: offset !Offset, in bytes, from the beginning
|
||||
!of the file to the location in the file
|
||||
!where the data starts.
|
||||
INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the
|
||||
!file for the data
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_external_c
|
||||
|
||||
hdferr = h5pget_external_c(prp_id, idx, name_size, name, offset, bytes)
|
||||
END SUBROUTINE h5pget_external_f
|
||||
|
||||
SUBROUTINE h5pset_hyper_cache_f(prp_id, cache, limit, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: cache !
|
||||
INTEGER, INTENT(IN) :: limit ! Maximum size of the hyperslab block to
|
||||
!cache. 0 (zero) indicates no limit.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_hyper_cache_c
|
||||
hdferr = h5pset_hyper_cache_c(prp_id, cache, limit)
|
||||
END SUBROUTINE h5pset_hyper_cache_f
|
||||
|
||||
SUBROUTINE h5pget_hyper_cache_f(prp_id, cache, limit, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: cache !
|
||||
INTEGER, INTENT(OUT) :: limit ! Maximum size of the hyperslab block to
|
||||
!cache. 0 (zero) indicates no limit.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_hyper_cache_c
|
||||
hdferr = h5pget_hyper_cache_c(prp_id, cache, limit)
|
||||
END SUBROUTINE h5pget_hyper_cache_f
|
||||
|
||||
SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
REAL, INTENT(IN) :: left !The B-tree split ratio for left-most nodes.
|
||||
REAL, INTENT(IN) :: middle !The B-tree split ratio for all other nodes
|
||||
REAL, INTENT(IN) :: right !The B-tree split ratio for right-most
|
||||
!nodes and lone nodes.
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_btree_ratios_c
|
||||
hdferr = h5pset_btree_ratios_c(prp_id, left, middle, right)
|
||||
END SUBROUTINE h5pset_btree_ratios_f
|
||||
|
||||
SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
REAL, INTENT(OUT) :: left !The B-tree split ratio for left-most nodes.
|
||||
REAL, INTENT(OUT) :: middle !The B-tree split ratio for all other nodes
|
||||
REAL, INTENT(OUT) :: right !The B-tree split ratio for right-most
|
||||
!nodes and lone nodes.
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_btree_ratios_c
|
||||
hdferr = h5pget_btree_ratios_c(prp_id, left, middle, right)
|
||||
END SUBROUTINE h5pget_btree_ratios_f
|
||||
|
||||
END MODULE H5P
|
59
fortran/src/H5Pff_parallel.f90
Normal file
59
fortran/src/H5Pff_parallel.f90
Normal file
@ -0,0 +1,59 @@
|
||||
!
|
||||
! This file contains Fortran90 interfaces for H5P functions needed by || MPI programs.
|
||||
!
|
||||
MODULE H5P_parallel
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
CONTAINS
|
||||
SUBROUTINE h5pset_mpi_f(prp_id, comm, info, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open
|
||||
! as defined in MPI_FILE_OPEN of MPI-2
|
||||
INTEGER, INTENT(IN) :: info ! MPI info object to be used for file open
|
||||
! as defined in MPI_FILE_OPEN of MPI-2
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_mpi_c
|
||||
hdferr = h5pset_mpi_c(prp_id, comm, info)
|
||||
END SUBROUTINE h5pset_mpi_f
|
||||
|
||||
SUBROUTINE h5pget_mpi_f(prp_id, comm, info, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: comm ! buffer to return communicator
|
||||
INTEGER, INTENT(IN) :: info ! buffer to return info object
|
||||
! as defined in MPI_FILE_OPEN of MPI-2
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_mpi_c
|
||||
hdferr = h5pget_mpi_c(prp_id, comm, info)
|
||||
END SUBROUTINE h5pget_mpi_f
|
||||
|
||||
SUBROUTINE h5pset_xfer_f(prp_id, data_xfer_mode, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(IN) :: data_xfer_mode ! Data transfer mode. Possible values are:
|
||||
! H5D_XFER_INDEPENDENT_F (0)
|
||||
! H5D_XFER_COLLECTIVE_F (1)
|
||||
! H5D_XFER_DFLT_F (2)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pset_xfer_c
|
||||
hdferr = h5pset_xfer_c(prp_id, data_xfer_mode)
|
||||
END SUBROUTINE h5pset_xfer_f
|
||||
|
||||
SUBROUTINE h5pget_xfer_f(prp_id, data_xfer_mode, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
|
||||
INTEGER, INTENT(OUT) :: data_xfer_mode ! Data transfer mode. Possible values are:
|
||||
! H5D_XFER_INDEPENDENT_F (0)
|
||||
! H5D_XFER_COLLECTIVE_F (1)
|
||||
! H5D_XFER_DFLT_F (2)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5pget_xfer_c
|
||||
hdferr = h5pget_xfer_c(prp_id, data_xfer_mode)
|
||||
END SUBROUTINE h5pget_xfer_f
|
||||
|
||||
END MODULE H5P_parallel
|
267
fortran/src/H5Rf.c
Normal file
267
fortran/src/H5Rf.c
Normal file
@ -0,0 +1,267 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5rcreate_object_c
|
||||
* Purpose: Call H5Rcreate to create a reference to an object
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the dataset
|
||||
* namelen - name length
|
||||
* Outputs: ref - reference to the object
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, December 1, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5rcreate_object_c (_fcd ref, hid_t_f *loc_id, _fcd name, int_f *namelen)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
int ret_value_c;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hobj_ref_t ref_c;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Rcreate function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
ret_value_c = H5Rcreate(&ref_c, c_loc_id, c_name, H5R_OBJECT, -1);
|
||||
HDfree(c_name);
|
||||
if (ret_value_c >= 0) {
|
||||
for(i=0; i < H5R_OBJ_REF_BUF_SIZE; i++)
|
||||
{
|
||||
#if defined(_UNICOS)
|
||||
ref.c_pointer[i]=ref_c.oid[i];
|
||||
#else
|
||||
ref[i]=ref_c.oid[i];
|
||||
#endif
|
||||
}
|
||||
ret_value = 0;
|
||||
}
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5rcreate_region_c
|
||||
* Purpose: Call H5Rcreate to create a reference to dataset region
|
||||
* region
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the dataset
|
||||
* namelen - name length
|
||||
* space_id - dataset space identifier
|
||||
* Outputs: ref - reference to the dataset region
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, December 1, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5rcreate_region_c (_fcd ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_loc_id;
|
||||
hid_t c_space_id;
|
||||
int ret_value_c;
|
||||
char *c_name;
|
||||
int c_namelen;
|
||||
hdset_reg_ref_t ref_c;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
|
||||
/*
|
||||
* Call H5Rcreate function.
|
||||
*/
|
||||
c_loc_id = *loc_id;
|
||||
c_space_id = *space_id;
|
||||
ret_value_c = H5Rcreate(&ref_c, c_loc_id, c_name, H5R_DATASET_REGION, c_space_id);
|
||||
HDfree(c_name);
|
||||
if (ret_value_c >= 0) {
|
||||
for(i=0; i < H5R_DSET_REG_REF_BUF_SIZE; i++)
|
||||
{
|
||||
#if defined(_UNICOS)
|
||||
ref.c_pointer[i]=ref_c.heapid[i];
|
||||
#else
|
||||
ref[i]=ref_c.heapid[i];
|
||||
#endif
|
||||
}
|
||||
ret_value = 0;
|
||||
}
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5rdereference_region_c
|
||||
* Purpose: Call H5Rdereference to dereference to dataset region
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* ref - reference to the dataset region
|
||||
* Outputs: obj_id - dereferenced dataset identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, December 1, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5rdereference_region_c (hid_t_f *dset_id, _fcd ref, hid_t_f *obj_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_dset_id;
|
||||
hdset_reg_ref_t ref_c;
|
||||
hid_t c_obj_id;
|
||||
int i;
|
||||
|
||||
for(i=0; i < H5R_DSET_REG_REF_BUF_SIZE; i++) {
|
||||
|
||||
#if defined(_UNICOS)
|
||||
ref_c.heapid[i]=ref.c_pointer[i];
|
||||
#else
|
||||
ref_c.heapid[i]=ref[i];
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Call H5Rdereference function.
|
||||
*/
|
||||
c_dset_id = *dset_id;
|
||||
c_obj_id = H5Rdereference(c_dset_id, H5R_DATASET_REGION, &ref_c);
|
||||
if(c_obj_id < 0) return ret_value;
|
||||
*obj_id = (hid_t_f)c_obj_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5rdereference_object_c
|
||||
* Purpose: Call H5Rdereference to dereference an object
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* ref - reference to an object
|
||||
* Outputs: obj_id - dereferenced object identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, December 1, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5rdereference_object_c (hid_t_f *dset_id, _fcd ref, hid_t_f *obj_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_obj_id;
|
||||
hobj_ref_t ref_c;
|
||||
int i;
|
||||
|
||||
for(i=0; i < H5R_OBJ_REF_BUF_SIZE; i++) {
|
||||
|
||||
#if defined(_UNICOS)
|
||||
ref_c.oid[i]=ref.c_pointer[i];
|
||||
#else
|
||||
ref_c.oid[i]=ref[i];
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Call H5Rdereference function.
|
||||
*/
|
||||
c_dset_id = *dset_id;
|
||||
c_obj_id = H5Rdereference(c_dset_id, H5R_OBJECT, &ref_c);
|
||||
if(c_obj_id < 0) return ret_value;
|
||||
*obj_id = (hid_t_f)c_obj_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5rget_region_region_object_c
|
||||
* Purpose: Call H5Rget_region to dereference dataspace region
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* ref - reference to the dataset region
|
||||
* Outputs: space_id - dereferenced dataset dataspace identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, December 1, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5rget_region_region_c (hid_t_f *dset_id, _fcd ref, hid_t_f *space_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_space_id;
|
||||
hdset_reg_ref_t ref_c;
|
||||
int i;
|
||||
|
||||
for(i=0; i < H5R_DSET_REG_REF_BUF_SIZE; i++) {
|
||||
|
||||
#if defined(_UNICOS)
|
||||
ref_c.heapid[i]=ref.c_pointer[i];
|
||||
#else
|
||||
ref_c.heapid[i]=ref[i];
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Call H5Rget_region function.
|
||||
*/
|
||||
c_dset_id = *dset_id;
|
||||
c_space_id = H5Rget_region(c_dset_id, H5R_DATASET_REGION, &ref_c);
|
||||
if(c_space_id < 0) return ret_value;
|
||||
*space_id = (hid_t_f)c_space_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5rget_object_type_obj_c
|
||||
* Purpose: Call H5Rget_object_type to retrieve the type of the object reference points
|
||||
* to
|
||||
* Inputs: dset_id - dataset identifier
|
||||
* ref - reference to the dataset region
|
||||
* Outputs: obj_type - type of dereferenced object
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, December 1, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5rget_object_type_obj_c (hid_t_f *dset_id, _fcd ref, int_f *obj_type)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_dset_id;
|
||||
int c_obj_type;
|
||||
hobj_ref_t ref_c;
|
||||
int i;
|
||||
|
||||
for(i=0; i < H5R_OBJ_REF_BUF_SIZE; i++) {
|
||||
|
||||
#if defined(_UNICOS)
|
||||
ref_c.oid[i]=ref.c_pointer[i];
|
||||
#else
|
||||
ref_c.oid[i]=ref[i];
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Call H5Rget_object_type function.
|
||||
*/
|
||||
c_dset_id = *dset_id;
|
||||
c_obj_type = H5Rget_object_type(c_dset_id, &ref_c);
|
||||
if(c_obj_type < 0) return ret_value;
|
||||
*obj_type = (int_f)c_obj_type;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
138
fortran/src/H5Rff.f90
Normal file
138
fortran/src/H5Rff.f90
Normal file
@ -0,0 +1,138 @@
|
||||
!
|
||||
! This file contains Fortran90 interfaces for H5R functions.
|
||||
!
|
||||
MODULE H5R
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
TYPE hobj_ref_t_f
|
||||
!INTEGER(KIND=4) ref(2) could cause trouble on Crays
|
||||
CHARACTER ref(8)
|
||||
END TYPE
|
||||
|
||||
TYPE hdset_reg_ref_t_f
|
||||
!INTEGER(KIND=4) reg_ref(3) could cause troubles on Crays
|
||||
CHARACTER ref(12)
|
||||
END TYPE
|
||||
|
||||
INTERFACE h5rcreate_f
|
||||
|
||||
MODULE PROCEDURE h5rcreate_object_f
|
||||
MODULE PROCEDURE h5rcreate_region_f
|
||||
|
||||
END INTERFACE
|
||||
|
||||
INTERFACE h5rdereference_f
|
||||
|
||||
MODULE PROCEDURE h5rdereference_object_f
|
||||
MODULE PROCEDURE h5rdereference_region_f
|
||||
|
||||
END INTERFACE
|
||||
|
||||
INTERFACE h5rget_region_f
|
||||
|
||||
MODULE PROCEDURE h5rget_region_region_f
|
||||
|
||||
END INTERFACE
|
||||
|
||||
INTERFACE h5rget_object_type_f
|
||||
|
||||
MODULE PROCEDURE h5rget_object_type_obj_f
|
||||
|
||||
END INTERFACE
|
||||
|
||||
|
||||
CONTAINS
|
||||
|
||||
|
||||
SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location specified
|
||||
! by loc_id identifier
|
||||
TYPE(hobj_ref_t_f), INTENT(OUT) :: ref ! Object reference
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Name length
|
||||
INTEGER, EXTERNAL :: h5rcreate_object_c
|
||||
namelen = LEN(name)
|
||||
hdferr = h5rcreate_object_c(ref, loc_id, name, namelen )
|
||||
|
||||
END SUBROUTINE h5rcreate_object_f
|
||||
|
||||
SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified
|
||||
! by loc_id identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier
|
||||
TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: namelen ! Name length
|
||||
INTEGER, EXTERNAL :: h5rcreate_region_c
|
||||
namelen = LEN(name)
|
||||
hdferr = h5rcreate_region_c(ref, loc_id, name, namelen, space_id )
|
||||
|
||||
END SUBROUTINE h5rcreate_region_f
|
||||
|
||||
SUBROUTINE h5rdereference_object_f(dset_id, ref, obj_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
|
||||
TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference
|
||||
INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: ref_type ! Reference type
|
||||
INTEGER, EXTERNAL :: h5rdereference_object_c
|
||||
ref_type = H5R_OBJECT_F
|
||||
hdferr = h5rdereference_object_c(dset_id, ref, obj_id )
|
||||
|
||||
END SUBROUTINE h5rdereference_object_f
|
||||
|
||||
SUBROUTINE h5rdereference_region_f(dset_id, ref, obj_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
|
||||
TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference
|
||||
INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER :: ref_type ! Reference type
|
||||
INTEGER, EXTERNAL :: h5rdereference_region_c
|
||||
ref_type = H5R_DATASET_REGION_F
|
||||
hdferr = h5rdereference_region_c(dset_id, ref, obj_id )
|
||||
|
||||
END SUBROUTINE h5rdereference_region_f
|
||||
|
||||
|
||||
SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
|
||||
TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference
|
||||
INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5rget_region_region_c
|
||||
hdferr = h5rget_region_region_c(dset_id, ref, space_id )
|
||||
|
||||
END SUBROUTINE h5rget_region_region_f
|
||||
|
||||
SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
|
||||
TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference
|
||||
INTEGER, INTENT(OUT) :: obj_type ! Object type
|
||||
! H5G_UNKNOWN_F (-1)
|
||||
! H5G_LINK_F 0
|
||||
! H5G_GROUP_F 1
|
||||
! H5G_DATASET_F 2
|
||||
! H5G_TYPE_F 3
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5rget_object_type_obj_c
|
||||
hdferr = h5rget_object_type_obj_c(dset_id, ref, obj_type )
|
||||
|
||||
END SUBROUTINE h5rget_object_type_obj_f
|
||||
|
||||
END MODULE H5R
|
874
fortran/src/H5Sf.c
Normal file
874
fortran/src/H5Sf.c
Normal file
@ -0,0 +1,874 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5screate_simple_c
|
||||
* Purpose: Call H5Screate_simple to create a dataspace
|
||||
* Inputs: rank - number of dimensions of dataspace
|
||||
* dims - array of the size of each dimension
|
||||
maxdims - an array of the maximum size of each dimension
|
||||
* Outputs: space_id - identifier of the created dataspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 4, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id )
|
||||
{
|
||||
int ret_value = -1;
|
||||
hsize_t *c_dims;
|
||||
hsize_t *c_maxdims;
|
||||
hid_t c_space_id;
|
||||
int i;
|
||||
|
||||
c_dims = malloc(sizeof(hsize_t) * (*rank ));
|
||||
if (!c_dims) return ret_value;
|
||||
c_maxdims = malloc(sizeof(hsize_t) * (*rank ));
|
||||
if (!c_maxdims) return ret_value;
|
||||
|
||||
/*
|
||||
* Transpose dimension arrays because of C-FORTRAN storage order
|
||||
*/
|
||||
for (i = 0; i < *rank ; i++) {
|
||||
c_dims[i] = dims[*rank - i - 1];
|
||||
c_maxdims[i] = maxdims[*rank - i - 1];
|
||||
}
|
||||
|
||||
c_space_id = H5Screate_simple(*rank, c_dims, c_maxdims);
|
||||
if (c_space_id < 0) return ret_value;
|
||||
|
||||
*space_id = (hid_t_f)c_space_id;
|
||||
ret_value = 0;
|
||||
HDfree (c_dims);
|
||||
HDfree (c_maxdims);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sclose_c
|
||||
* Purpose: Call H5Sclose to close the dataspace
|
||||
* Inputs: space_id - identifier of the dataspace to be closed
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 4, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sclose_c ( hid_t_f *space_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
|
||||
c_space_id = *space_id;
|
||||
if ( H5Sclose(c_space_id) < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5screate_c
|
||||
* Purpose: Call H5Screate to create a dataspace
|
||||
* Inputs: classtype - type of the dataspace class
|
||||
* Outputs: space_id - identifier of the created dataspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 10, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5screate_c ( int_f *classtype, hid_t_f *space_id )
|
||||
{
|
||||
H5S_class_t c_classtype;
|
||||
int CASE;
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
CASE = (int)*classtype;
|
||||
|
||||
switch (CASE) {
|
||||
|
||||
case (H5S_SCALAR_F):
|
||||
c_classtype = H5S_SCALAR;
|
||||
break;
|
||||
|
||||
case(H5S_SIMPLE_F):
|
||||
c_classtype = H5S_SIMPLE;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
c_space_id = H5Screate(c_classtype);
|
||||
|
||||
if ( c_space_id < 0 ) ret_value = -1;
|
||||
*space_id = (hid_t_f) c_space_id;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5scopy_c
|
||||
* Purpose: Call H5Scopy to copy dataspace
|
||||
* Inputs: space_id - identifier of the dataspace to be copied
|
||||
* Outputs: new_space_id - identifier of the new datspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 10, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id)
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_new_space_id;
|
||||
hid_t c_space_id;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_new_space_id = H5Scopy(c_space_id);
|
||||
if ( c_new_space_id < 0 ) ret_value = -1;
|
||||
|
||||
*new_space_id = (hid_t_f)c_new_space_id;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_select_hyper_nblocks_c
|
||||
* Purpose: Call H5SH5Sget_select_hyper_nblocks to
|
||||
* get the the number of hyperslab blocks in
|
||||
* the current dataspace selection if successful
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: num_blocks - number of hyperslab blocks in
|
||||
* the current dataspace selection
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Friday, November 12, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks)
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
hssize_t c_num_blocks;
|
||||
hsize_t* buf;
|
||||
int i, j;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_num_blocks = H5Sget_select_hyper_nblocks(c_space_id);
|
||||
if ( c_num_blocks < 0 ) ret_value = -1;
|
||||
|
||||
*num_blocks = (hssize_t_f)c_num_blocks;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_select_elem_npoints_c
|
||||
* Purpose: Call H5Sget_select_elem_npoints to
|
||||
* get the the number of element points in
|
||||
* the current dataspace selection if successful
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: num_points - number of element points in
|
||||
* the current dataspace selection
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Monday, November 15, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points)
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
hssize_t c_num_points;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_num_points = H5Sget_select_elem_npoints(c_space_id);
|
||||
if ( c_num_points < 0 ) ret_value = -1;
|
||||
|
||||
*num_points = (hssize_t_f)c_num_points;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_select_hyper_blocklist_c
|
||||
* Purpose: Call H5Sget_select_hyper_blocklist to
|
||||
* get a list of the hyperslab blocks currently selected
|
||||
* Starting with the startblock-th block in the
|
||||
* list of blocks, num_blocks blocks are put into the user's
|
||||
* buffer. If the user's buffer fills up before numblocks
|
||||
* blocks are inserted, the buffer
|
||||
* will contain only as many blocks as fit.
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* startblock - Hyperslab block to start with
|
||||
* num_blocks - number of hyperslab blocks in
|
||||
* the current dataspace selection
|
||||
* Outputs: buf - List of hyperslab blocks selected
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Monday, November 15, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
|
||||
hsize_t_f * num_blocks, hsize_t_f * buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
hsize_t c_num_blocks;
|
||||
|
||||
int i, rank;
|
||||
hsize_t* c_startblock,* c_buf;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_num_blocks = * num_blocks;
|
||||
|
||||
rank = H5Sget_simple_extent_ndims(c_space_id);
|
||||
if (rank < 0 ) return ret_value;
|
||||
|
||||
c_startblock = (hsize_t*)malloc(sizeof(hsize_t)*rank);
|
||||
if (!c_startblock) return ret_value;
|
||||
for (i = 0; i < rank; i++)
|
||||
{
|
||||
c_startblock[i] = (hsize_t)startblock[i];
|
||||
}
|
||||
|
||||
c_buf = (hsize_t*)malloc(sizeof(hsize_t)*c_num_blocks*2*rank);
|
||||
if (!c_buf) return ret_value;
|
||||
|
||||
ret_value = H5Sget_select_hyper_blocklist(c_space_id, *c_startblock,
|
||||
c_num_blocks, c_buf);
|
||||
for(i = 0; i < c_num_blocks*2*rank; i++)
|
||||
{
|
||||
buf[i] = (hsize_t_f)c_buf[i] +1;
|
||||
}
|
||||
HDfree(c_buf);
|
||||
HDfree(c_startblock);
|
||||
if (ret_value >= 0 ) ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_select_bounds_c
|
||||
* Purpose: Call H5Sget_select_bounds to retrieve the coordinates
|
||||
* of the bounding box containing the current selection
|
||||
* and places them into user-supplied buffers
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: start - Starting coordinates of the bounding box
|
||||
* end - Ending coordinates of the bounding box,
|
||||
* i.e., the coordinates of the diagonally opposite corne
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, November 17, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
hsize_t* c_start, *c_end;
|
||||
int i, rank;
|
||||
|
||||
c_space_id = *space_id;
|
||||
rank = H5Sget_simple_extent_ndims(c_space_id);
|
||||
if (rank < 0 ) return ret_value;
|
||||
|
||||
c_start =(hsize_t*) malloc(sizeof(hsize_t)*rank);
|
||||
if (!c_start) return ret_value;
|
||||
|
||||
c_end = (hsize_t*)malloc(sizeof(hsize_t)*rank);
|
||||
if(!c_end) return ret_value;
|
||||
|
||||
ret_value = H5Sget_select_bounds(c_space_id, c_start, c_end);
|
||||
for(i = 0; i < rank; i++)
|
||||
{
|
||||
start[i] = (hsize_t_f)(c_start[i]+1);
|
||||
end[i] = (hsize_t_f)(c_end[i]+1);
|
||||
}
|
||||
if (ret_value >= 0 ) ret_value = 0;
|
||||
|
||||
HDfree(c_start);
|
||||
HDfree(c_end);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_select_elem_pointlist_c
|
||||
* Purpose: Call H5Sget_select_elem_pointlist
|
||||
* get a list of element points in the
|
||||
* current dataspace selectin.
|
||||
* Starting with the startpoint-th point in the
|
||||
* list of points, numpoints points are put into the user's
|
||||
* buffer. If the user's buffer fills up before numpoints
|
||||
* points are inserted, the buffer
|
||||
* will contain only as many points as fit.
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* startpoint - Element point to start with
|
||||
* numpoints - Number of element points to get
|
||||
* Outputs: buf - List of element points selected
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Xiangyang Su
|
||||
* Wednesday, November 17, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
|
||||
hsize_t_f * numpoints, hsize_t_f * buf)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
hsize_t c_num_points;
|
||||
hsize_t* c_startpoint,* c_buf;
|
||||
int i,j, rank;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_num_points = (hsize_t)* numpoints;
|
||||
|
||||
rank = H5Sget_simple_extent_ndims(c_space_id);
|
||||
if (rank < 0 ) return ret_value;
|
||||
|
||||
c_startpoint = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (!c_startpoint) return ret_value;
|
||||
for (i =0; i < rank; i++)
|
||||
c_startpoint[i] = (hsize_t)startpoint[i];
|
||||
|
||||
c_buf = (hsize_t*)malloc(sizeof(hsize_t)*c_num_points*rank);
|
||||
if (!c_buf) return ret_value;
|
||||
ret_value = H5Sget_select_elem_pointlist(c_space_id, *startpoint,
|
||||
c_num_points, c_buf);
|
||||
for (i = c_num_points*rank-1; i >= 0; i--) {
|
||||
buf[i] = (hsize_t_f)(c_buf[i]+1);
|
||||
}
|
||||
|
||||
if (ret_value >= 0 ) ret_value = 0;
|
||||
|
||||
HDfree(c_startpoint);
|
||||
HDfree(c_buf);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sselect_all_c
|
||||
* Purpose: Call H5Sselect_all to select entire dataspace
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 10, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sselect_all_c ( hid_t_f *space_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
|
||||
c_space_id = *space_id;
|
||||
if ( H5Sselect_all(c_space_id) < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sselect_none_c
|
||||
* Purpose: Call H5Sselect_none to reset the selection region
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 10, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sselect_none_c ( hid_t_f *space_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
|
||||
c_space_id = *space_id;
|
||||
if ( H5Sselect_none(c_space_id) < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sselect_valid_c
|
||||
* Purpose: Call H5Sselect_valid to verify that selection
|
||||
* is within dataspace extent.
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: flag - 0 if not valid selection, 1 if is valid selection,
|
||||
* and negative on failure.
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 10, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
htri_t status;
|
||||
|
||||
c_space_id = *space_id;
|
||||
status = H5Sselect_valid(c_space_id);
|
||||
*flag = (int_f)status;
|
||||
if ( status < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_simple_extent_npoints_c
|
||||
* Purpose: Call H5Sget_simple_extent_npoints to determine the number
|
||||
* of elements in a dataspace
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: npoints - number of points in a dataspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
hsize_t c_npoints;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_npoints = H5Sget_simple_extent_npoints(c_space_id);
|
||||
if ( c_npoints == 0 ) ret_value = -1;
|
||||
*npoints = (hsize_t_f)c_npoints;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_select_npoints_c
|
||||
* Purpose: Call H5Sget_select_npoints to determine the number
|
||||
* of elements in a dataspace selection
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: npoints - number of points in a dataspace selection
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hssize_t c_npoints;
|
||||
hid_t c_space_id;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_npoints = H5Sget_select_npoints(c_space_id);
|
||||
if ( c_npoints == 0 ) ret_value = -1;
|
||||
*npoints = (hssize_t_f)c_npoints;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_simple_extent_ndims_c
|
||||
* Purpose: Call H5Sget_simple_extent_ndims to determine the number
|
||||
* dimensions
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: rank - number of dataspace dimensions
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
int c_ndims;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_ndims = H5Sget_simple_extent_ndims(c_space_id);
|
||||
if ( c_ndims < 0 ) ret_value = -1;
|
||||
*ndims = (int_f)c_ndims;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_simple_extent_type_c
|
||||
* Purpose: Call H5Sget_simple_extent_type to determine the class type
|
||||
* of a dataspace
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: classtype - class type; possible values are:
|
||||
* H5S_SCALAR_F (0), H5S_SIMPLE_F (1)
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype)
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
H5S_class_t c_classtype;
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_classtype = H5Sget_simple_extent_type(c_space_id);
|
||||
if ( c_classtype < 0 ) ret_value = -1;
|
||||
if (c_classtype == H5S_SCALAR) *classtype = H5S_SCALAR_F;
|
||||
if (c_classtype == H5S_SIMPLE) *classtype = H5S_SIMPLE_F;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5soffset_simple_c
|
||||
* Purpose: Call H5Soffset_simple to set the offset of a simple
|
||||
* dataspace
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* offset - offset array
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
int rank;
|
||||
hssize_t *c_offset;
|
||||
herr_t status;
|
||||
int i;
|
||||
|
||||
c_space_id = *space_id;
|
||||
rank = H5Sget_simple_extent_ndims(c_space_id);
|
||||
if (rank < 0) return ret_value;
|
||||
|
||||
c_offset = malloc(sizeof(hssize_t)*rank);
|
||||
if (!c_offset) return ret_value;
|
||||
|
||||
/*
|
||||
* Reverse dimensions due to C-FORTRAN storage order.
|
||||
*/
|
||||
for (i=0; i < rank; i++) c_offset[i] = offset[rank - i - 1];
|
||||
|
||||
status = H5Soffset_simple(c_space_id, c_offset);
|
||||
if ( status >= 0 ) ret_value = 0;
|
||||
HDfree(c_offset);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sset_extent_simple_c
|
||||
* Purpose: Call H5Sset_extent_simple to set or reset size of
|
||||
* existing dataspace
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* rank - dataspace rank
|
||||
* current_size - array with the new dimension sizes
|
||||
* maximum_size - aray with maximum sizes of dimensions
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
int c_rank;
|
||||
hsize_t *c_current_size;
|
||||
hsize_t *c_maximum_size;
|
||||
herr_t status;
|
||||
int i;
|
||||
|
||||
c_current_size = malloc(sizeof(hsize_t)*(*rank));
|
||||
if (!c_current_size) return ret_value;
|
||||
|
||||
c_maximum_size = malloc(sizeof(hsize_t)*(*rank));
|
||||
if (!c_maximum_size) return ret_value;
|
||||
|
||||
/*
|
||||
* Reverse dimensions due to C-FORTRAN storage order.
|
||||
*/
|
||||
for (i=0; i < *rank; i++) {
|
||||
c_current_size[i] = (hsize_t)current_size[*rank - i - 1];
|
||||
c_maximum_size[i] = (hsize_t)maximum_size[*rank - i - 1];
|
||||
}
|
||||
|
||||
c_space_id = *space_id;
|
||||
c_rank = *rank;
|
||||
status = H5Sset_extent_simple(c_space_id, c_rank, c_current_size, c_maximum_size);
|
||||
if ( status >= 0 ) ret_value = 0;
|
||||
HDfree(c_current_size);
|
||||
HDfree(c_maximum_size);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sget_simple_extent_dims_c
|
||||
* Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an
|
||||
* existing dataspace
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: dims - array with the dimension sizes
|
||||
* maxdims - aray with maximum sizes of dimensions
|
||||
* Returns: number of dataspace dimensions (rank) on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
hsize_t *c_dims;
|
||||
hsize_t *c_maxdims;
|
||||
int status;
|
||||
int rank;
|
||||
int i;
|
||||
|
||||
c_space_id = *space_id;
|
||||
rank = H5Sget_simple_extent_ndims(c_space_id);
|
||||
if (rank < 0) return ret_value;
|
||||
|
||||
c_dims = malloc(sizeof(hsize_t)*rank);
|
||||
if (!c_dims) return ret_value;
|
||||
|
||||
c_maxdims = malloc(sizeof(hsize_t)*rank);
|
||||
if (!c_maxdims) return ret_value;
|
||||
|
||||
status = H5Sget_simple_extent_dims(c_space_id, c_dims, c_maxdims);
|
||||
/*
|
||||
* Reverse dimensions due to C-FORTRAN storage order.
|
||||
*/
|
||||
for (i=0; i < rank; i++) {
|
||||
dims[rank - i - 1] = (hsize_t_f)c_dims[i];
|
||||
maxdims[rank - i - 1] = (hsize_t_f)c_maxdims[i];
|
||||
}
|
||||
|
||||
if ( status >= 0 ) ret_value = rank;
|
||||
HDfree(c_dims);
|
||||
HDfree(c_maxdims);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sis_simple_c
|
||||
* Purpose: Call H5Sis_simple to detrmine if the dataspace
|
||||
* is simple.
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* Outputs: flag - 0 if not simple, 1 if is simple,
|
||||
* and negative on failure.
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sis_simple_c ( hid_t_f *space_id , int_f *flag )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
htri_t status;
|
||||
|
||||
c_space_id = *space_id;
|
||||
status = H5Sis_simple(c_space_id);
|
||||
*flag = (int_f)status;
|
||||
if ( status < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sextent_copy_c
|
||||
* Purpose: Call H5Sextent_copy to copy an extent of dataspace
|
||||
* Inputs: dest_space_id - identifier of the destination dataspace
|
||||
* source_space_id - identifier of the source dataspace
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id)
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_dest_space_id, c_source_space_id;
|
||||
herr_t status;
|
||||
|
||||
c_dest_space_id = *dest_space_id;
|
||||
c_source_space_id = *source_space_id;
|
||||
status = H5Sextent_copy(c_dest_space_id, c_source_space_id);
|
||||
if ( status < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sset_extent_none_c
|
||||
* Purpose: Call H5Sset_extent_none to remove extent from a dataspace
|
||||
* Inputs: space_id - dataspace identifier
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sset_extent_none_c ( hid_t_f *space_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_space_id;
|
||||
herr_t status;
|
||||
|
||||
c_space_id = *space_id;
|
||||
status = H5Sset_extent_none(c_space_id);
|
||||
if ( status < 0 ) ret_value = -1;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sselect_hyperslab_c
|
||||
* Purpose: Call H5Sselect_hyperslab to select a hyperslab
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* operator - defines how the new selection is combined
|
||||
* with the previous one; current values are
|
||||
* H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1)
|
||||
* start - offset of start of hyperslab
|
||||
* count - number of blocks included in the hyperslab
|
||||
* stride - hyperslab stride (interval between blocks)
|
||||
* block - size of block in the hyperslab
|
||||
* maximum_size - aray with maximum sizes of dimensions
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
hssize_t *c_start;
|
||||
hsize_t *c_count;
|
||||
hsize_t *c_stride;
|
||||
hsize_t *c_block;
|
||||
|
||||
H5S_seloper_t c_op;
|
||||
herr_t status;
|
||||
int rank;
|
||||
int i;
|
||||
|
||||
rank = H5Sget_simple_extent_ndims(*space_id);
|
||||
if (rank < 0 ) return ret_value;
|
||||
c_start = (hssize_t *)HDmalloc(sizeof(hssize_t)*rank);
|
||||
if (!c_start) return ret_value;
|
||||
|
||||
c_count = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (!c_count) return ret_value;
|
||||
|
||||
c_stride = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (!c_stride) return ret_value;
|
||||
|
||||
c_block = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (!c_block) return ret_value;
|
||||
|
||||
|
||||
/*
|
||||
* Reverse dimensions due to C-FORTRAN storage order.
|
||||
*/
|
||||
|
||||
for (i=0; i < rank; i++) {
|
||||
int t= (rank - i) - 1;
|
||||
c_start[i] = (hssize_t)start[t];
|
||||
c_count[i] = (hsize_t)count[t];
|
||||
c_stride[i] = (hsize_t)stride[t];
|
||||
c_block[i] = (hsize_t)block[t];
|
||||
}
|
||||
|
||||
if (*op == H5S_SELECT_SET_F) c_op = H5S_SELECT_SET;
|
||||
if (*op == H5S_SELECT_OR_F) c_op = H5S_SELECT_OR;
|
||||
|
||||
|
||||
c_space_id = *space_id;
|
||||
status = H5Sselect_hyperslab(c_space_id, c_op, c_start, c_stride, c_count, c_block);
|
||||
if ( status >= 0 ) ret_value = 0;
|
||||
HDfree(c_start);
|
||||
HDfree(c_count);
|
||||
HDfree(c_stride);
|
||||
HDfree(c_block);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5sselect_elements_c
|
||||
* Purpose: Call H5Sselect_elements to select elements of a dataspace
|
||||
* Inputs: space_id - identifier of the dataspace
|
||||
* operator - defines how the new selection is combined
|
||||
* with the previous one; current values are
|
||||
* H5S_SELECT_SET_F (0)
|
||||
* nelements - number of elements in the selection
|
||||
* coord - arrays with the elements coordinates
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Wednesday, August 11, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
int_f
|
||||
nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hssize_t_f *coord)
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
H5S_seloper_t c_op;
|
||||
herr_t status;
|
||||
int rank;
|
||||
int i, j;
|
||||
hssize_t *c_coord;
|
||||
size_t c_nelements;
|
||||
|
||||
if (*op != H5S_SELECT_SET_F) return ret_value;
|
||||
c_op = H5S_SELECT_SET;
|
||||
|
||||
c_space_id = *space_id;
|
||||
rank = H5Sget_simple_extent_ndims(c_space_id);
|
||||
|
||||
c_coord = malloc(sizeof(hssize_t)*rank*(*nelements));
|
||||
if(!c_coord) return ret_value;
|
||||
for (i=0; i< *nelements; i++) {
|
||||
for (j = 0; j < rank; j++) {
|
||||
c_coord[j+i*rank] = (hssize_t)coord[j + i*rank];
|
||||
}
|
||||
}
|
||||
|
||||
c_nelements = *nelements;
|
||||
status = H5Sselect_elements(c_space_id, c_op, c_nelements, (const hssize_t **)c_coord);
|
||||
if ( status >= 0 ) ret_value = 0;
|
||||
HDfree(c_coord);
|
||||
return ret_value;
|
||||
}
|
||||
|
460
fortran/src/H5Sff.f90
Normal file
460
fortran/src/H5Sff.f90
Normal file
@ -0,0 +1,460 @@
|
||||
!
|
||||
! This file contains Fortran90 interfaces for H5S functions.
|
||||
!
|
||||
MODULE H5S
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
CONTAINS
|
||||
|
||||
|
||||
SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: dims(rank)
|
||||
! Array with the dimension
|
||||
! sizes
|
||||
INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank)
|
||||
! Array with the maximum
|
||||
! dimension sizes
|
||||
INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: f_maxdims
|
||||
INTEGER, EXTERNAL :: h5screate_simple_c
|
||||
|
||||
allocate (f_maxdims(rank), stat=hdferr)
|
||||
if (hdferr .NE. 0) then
|
||||
hdferr = -1
|
||||
return
|
||||
endif
|
||||
if (present(maxdims)) then
|
||||
f_maxdims = maxdims
|
||||
else
|
||||
f_maxdims = dims
|
||||
endif
|
||||
hdferr = h5screate_simple_c(rank, dims, f_maxdims, space_id)
|
||||
deallocate(f_maxdims)
|
||||
|
||||
END SUBROUTINE h5screate_simple_f
|
||||
|
||||
SUBROUTINE h5sclose_f(space_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sclose_c
|
||||
|
||||
hdferr = h5sclose_c(space_id)
|
||||
|
||||
END SUBROUTINE h5sclose_f
|
||||
|
||||
SUBROUTINE h5screate_f(classtype, space_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(IN) :: classtype ! The type of the dataspace
|
||||
! to be created.
|
||||
! Possible values are:
|
||||
! H5S_SCALAR_F (0)
|
||||
! H5S_SIMPLE_F(1)
|
||||
INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5screate_c
|
||||
hdferr = h5screate_c(classtype, space_id)
|
||||
|
||||
END SUBROUTINE h5screate_f
|
||||
|
||||
|
||||
SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HID_T), INTENT(OUT) :: new_space_id
|
||||
! Identifier of dataspace's copy
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5scopy_c
|
||||
hdferr = h5scopy_c(space_id, new_space_id)
|
||||
|
||||
END SUBROUTINE h5scopy_f
|
||||
|
||||
SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks
|
||||
!number of hyperslab blocks
|
||||
!in the current dataspace
|
||||
!selection
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_select_hyper_nblocks_c
|
||||
hdferr = h5sget_select_hyper_nblocks_c (space_id, num_blocks)
|
||||
|
||||
END SUBROUTINE h5sget_select_hyper_nblocks_f
|
||||
|
||||
SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, &
|
||||
num_blocks, buf, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: startblock
|
||||
!Hyperslab block to start with.
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: num_blocks
|
||||
!number of hyperslab blocks
|
||||
!to get in the current dataspace
|
||||
!selection
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf
|
||||
!List of hyperslab blocks selected
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5sget_select_hyper_blocklist_c
|
||||
|
||||
hdferr = h5sget_select_hyper_blocklist_c(space_id, startblock, &
|
||||
num_blocks, buf )
|
||||
|
||||
END SUBROUTINE h5sget_select_hyper_blocklist_f
|
||||
|
||||
SUBROUTINE h5sget_select_bounds_f(space_id, start, end, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start
|
||||
!Starting coordinates of the bounding box.
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: end
|
||||
!Ending coordinates of the bounding box,
|
||||
!i.e., the coordinates of the diagonally
|
||||
!opposite corner
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_select_bounds_c
|
||||
hdferr = h5sget_select_bounds_c(space_id, start, end)
|
||||
|
||||
END SUBROUTINE h5sget_select_bounds_f
|
||||
|
||||
SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSSIZE_T), INTENT(OUT) :: num_points
|
||||
!number of element points
|
||||
!in the current dataspace
|
||||
!selection
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_select_elem_npoints_c
|
||||
hdferr = h5sget_select_elem_npoints_c (space_id, num_points)
|
||||
|
||||
END SUBROUTINE h5sget_select_elem_npoints_f
|
||||
|
||||
SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, &
|
||||
num_points, buf, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSIZE_T),DIMENSION(*), INTENT(IN) :: startpoint
|
||||
!Element point to start with.
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: num_points
|
||||
!Number of element points to get
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf
|
||||
!List of element points selected
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_select_elem_pointlist_c
|
||||
hdferr = h5sget_select_elem_pointlist_c(space_id, startpoint, &
|
||||
num_points, buf )
|
||||
END SUBROUTINE h5sget_select_elem_pointlist_f
|
||||
|
||||
SUBROUTINE h5sselect_elements_f(space_id, operator, rank, &
|
||||
num_elements, coord, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(IN) :: operator ! Flag, valid values are:
|
||||
! H5S_SELECT_SET_F (0)
|
||||
! H5S_SELECT_OR_F (1)
|
||||
INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions
|
||||
INTEGER(SIZE_T), INTENT(IN) :: num_elements ! Number of elements to be
|
||||
! selected
|
||||
INTEGER(HSSIZE_T), &
|
||||
DIMENSION(rank,num_elements), INTENT(IN) :: coord
|
||||
! Array with the coordinates
|
||||
! of the selected elements
|
||||
! coord(rank, num_elements)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sselect_elements_c
|
||||
INTEGER(HSSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord
|
||||
INTEGER :: error, i,j
|
||||
allocate(c_coord(rank, num_elements), stat = error)
|
||||
if (error.NE. 0) then
|
||||
hdferr = -1
|
||||
return
|
||||
endif
|
||||
do i = 1, rank
|
||||
c_coord(i,:) = coord(rank-i+1, :) - 1
|
||||
enddo
|
||||
hdferr = h5sselect_elements_c(space_id, operator, num_elements, &
|
||||
c_coord)
|
||||
deallocate(c_coord)
|
||||
|
||||
END SUBROUTINE h5sselect_elements_f
|
||||
|
||||
|
||||
SUBROUTINE h5sselect_all_f(space_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sselect_all_c
|
||||
hdferr = h5sselect_all_c(space_id)
|
||||
|
||||
END SUBROUTINE h5sselect_all_f
|
||||
|
||||
|
||||
SUBROUTINE h5sselect_none_f(space_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sselect_none_c
|
||||
hdferr = h5sselect_none_c(space_id)
|
||||
|
||||
END SUBROUTINE h5sselect_none_f
|
||||
|
||||
|
||||
|
||||
SUBROUTINE h5sselect_valid_f(space_id, status, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
LOGICAL, INTENT(OUT) :: status ! TRUE if the selection is
|
||||
! contained within the extent,
|
||||
! FALSE otherwise.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: flag ! "TRUE/FALSE/ERROR" flag from C routine
|
||||
INTEGER, EXTERNAL :: h5sselect_valid_c
|
||||
hdferr = h5sselect_valid_c(space_id, flag)
|
||||
status = .TRUE.
|
||||
if (flag .EQ. 0) status = .FALSE.
|
||||
|
||||
END SUBROUTINE h5sselect_valid_f
|
||||
|
||||
|
||||
SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSIZE_T), INTENT(OUT) :: npoints ! Number of elements in
|
||||
! dataspace
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_simple_extent_npoints_c
|
||||
hdferr = h5sget_simple_extent_npoints_c( space_id, npoints)
|
||||
|
||||
END SUBROUTINE h5sget_simple_extent_npoints_f
|
||||
|
||||
|
||||
SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSSIZE_T), INTENT(OUT) :: npoints ! Number of elements in the
|
||||
! selection
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_select_npoints_c
|
||||
hdferr = h5sget_select_npoints_c(space_id, npoints)
|
||||
|
||||
END SUBROUTINE h5sget_select_npoints_f
|
||||
|
||||
|
||||
SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: rank ! Number of dimensions
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_simple_extent_ndims_c
|
||||
hdferr = h5sget_simple_extent_ndims_c(space_id, rank)
|
||||
|
||||
END SUBROUTINE h5sget_simple_extent_ndims_f
|
||||
|
||||
|
||||
SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims
|
||||
! Array to store dimension sizes
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims
|
||||
! Array to store max dimension
|
||||
! sizes
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code: -1 on failure,
|
||||
! number of dimensions on
|
||||
! on success
|
||||
INTEGER, EXTERNAL :: h5sget_simple_extent_dims_c
|
||||
hdferr = h5sget_simple_extent_dims_c(space_id, dims, maxdims)
|
||||
|
||||
END SUBROUTINE h5sget_simple_extent_dims_f
|
||||
|
||||
|
||||
SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: classtype ! Class type , possible values
|
||||
! are:
|
||||
! H5S_NO_CLASS_F (-1)
|
||||
! H5S_SCALAR_F (0)
|
||||
! H5S_SIMPLE_F (1)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sget_simple_extent_type_c
|
||||
hdferr = h5sget_simple_extent_type_c(space_id, classtype)
|
||||
|
||||
END SUBROUTINE h5sget_simple_extent_type_f
|
||||
|
||||
|
||||
SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, &
|
||||
maximum_size, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(IN) :: rank ! Dataspace rank
|
||||
INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size
|
||||
! Array with the new sizes
|
||||
! of dimensions
|
||||
INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size
|
||||
! Array with the new maximum
|
||||
! sizes of dimensions
|
||||
! sizes
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sset_extent_simple_c
|
||||
hdferr = h5sset_extent_simple_c(space_id, rank, current_size, &
|
||||
maximum_size)
|
||||
|
||||
END SUBROUTINE h5sset_extent_simple_f
|
||||
|
||||
|
||||
SUBROUTINE h5sis_simple_f(space_id, status, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
LOGICAL, INTENT(OUT) :: status ! Flag, idicates if dataspace
|
||||
! is simple or not ( TRUE or
|
||||
! FALSE)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: flag ! "TRUE/FALSE/ERROR from C"
|
||||
INTEGER, EXTERNAL :: h5sis_simple_c
|
||||
hdferr = h5sis_simple_c(space_id, flag)
|
||||
status = .TRUE.
|
||||
if (flag .EQ. 0) status = .FALSE.
|
||||
|
||||
END SUBROUTINE h5sis_simple_f
|
||||
|
||||
SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset
|
||||
! The offset at which to position
|
||||
! the selection
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5soffset_simple_c
|
||||
hdferr = h5soffset_simple_c(space_id, offset)
|
||||
|
||||
END SUBROUTINE h5soffset_simple_f
|
||||
|
||||
|
||||
SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: dest_space_id ! Identifier of destination
|
||||
! dataspace
|
||||
INTEGER(HID_T), INTENT(IN) :: source_space_id ! Identifier of source
|
||||
! dataspace
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sextent_copy_c
|
||||
hdferr = h5sextent_copy_c(dest_space_id, source_space_id)
|
||||
|
||||
END SUBROUTINE h5sextent_copy_f
|
||||
|
||||
|
||||
SUBROUTINE h5sset_extent_none_f(space_id, hdferr)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5sset_extent_none_c
|
||||
hdferr = h5sset_extent_none_c(space_id)
|
||||
|
||||
END SUBROUTINE h5sset_extent_none_f
|
||||
|
||||
|
||||
SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count, &
|
||||
hdferr, stride, block)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
INTEGER, INTENT(IN) :: operator ! Flag, valid values are:
|
||||
! H5S_SELECT_SET_F (0)
|
||||
! H5S_SELECT_OR_F (1)
|
||||
!
|
||||
INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: start
|
||||
! Starting coordinates of the hyperslab
|
||||
INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
|
||||
! Number of blocks to select
|
||||
! from dataspace
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride
|
||||
! Array of how many elements to move
|
||||
! in each direction
|
||||
INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block
|
||||
! Sizes of element block
|
||||
INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block
|
||||
INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride
|
||||
INTEGER, EXTERNAL :: h5sselect_hyperslab_c
|
||||
INTEGER :: rank
|
||||
INTEGER :: error1, error2
|
||||
if (present(stride).and. present(block)) then
|
||||
hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, &
|
||||
stride, block)
|
||||
return
|
||||
endif
|
||||
! Case of optional parameters.
|
||||
!
|
||||
! Find the rank of the dataspace to allocate memery for
|
||||
! default stride and block arrays.
|
||||
!
|
||||
CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr)
|
||||
if( hdferr .EQ. -1) return
|
||||
!
|
||||
if (present(stride).and. .not.present(block)) then
|
||||
allocate(def_block(rank), stat=error1)
|
||||
if (error1.NE.0) then
|
||||
hdferr = -1
|
||||
return
|
||||
endif
|
||||
def_block = 1
|
||||
hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, &
|
||||
stride, def_block)
|
||||
deallocate(def_block)
|
||||
return
|
||||
endif
|
||||
|
||||
if (.not.present(stride).and. present(block)) then
|
||||
allocate(def_stride(rank), stat=error2)
|
||||
if (error2.NE.0) then
|
||||
hdferr = -1
|
||||
return
|
||||
endif
|
||||
def_stride = 1
|
||||
hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, &
|
||||
def_stride, block)
|
||||
deallocate(def_stride)
|
||||
return
|
||||
endif
|
||||
allocate(def_block(rank), stat=error1)
|
||||
allocate(def_stride(rank), stat=error2)
|
||||
if ((error1.NE.0) .OR. (error2.NE.0)) then
|
||||
hdferr = -1
|
||||
return
|
||||
endif
|
||||
def_block = 1
|
||||
def_stride = 1
|
||||
hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, &
|
||||
def_stride, def_block)
|
||||
deallocate(def_block)
|
||||
deallocate(def_stride)
|
||||
|
||||
END SUBROUTINE h5sselect_hyperslab_f
|
||||
|
||||
END MODULE H5S
|
1543
fortran/src/H5Tf.c
Normal file
1543
fortran/src/H5Tf.c
Normal file
File diff suppressed because it is too large
Load Diff
599
fortran/src/H5Tff.f90
Normal file
599
fortran/src/H5Tff.f90
Normal file
@ -0,0 +1,599 @@
|
||||
!
|
||||
! This file contains FORTRAN90 interfaces for H5T functions
|
||||
!
|
||||
MODULE H5T
|
||||
|
||||
USE H5FORTRAN_TYPES
|
||||
USE H5FORTRAN_FLAGS
|
||||
|
||||
CONTAINS
|
||||
|
||||
SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
! Datatype name within file or group
|
||||
INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen ! Name length
|
||||
INTEGER, EXTERNAL :: h5topen_c
|
||||
namelen = LEN(name)
|
||||
hdferr = h5topen_c(loc_id, name, namelen, type_id)
|
||||
END SUBROUTINE h5topen_f
|
||||
|
||||
SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
! Datatype name within file or group
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen ! Name length
|
||||
INTEGER, EXTERNAL :: h5tcommit_c
|
||||
namelen = LEN(name)
|
||||
hdferr = h5tcommit_c(loc_id, name, namelen, type_id)
|
||||
END SUBROUTINE h5tcommit_f
|
||||
|
||||
|
||||
SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(HID_T), INTENT(OUT) :: new_type_id
|
||||
! Identifier of datatype's copy
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tcopy_c
|
||||
hdferr = h5tcopy_c(type_id, new_type_id)
|
||||
END SUBROUTINE h5tcopy_f
|
||||
|
||||
SUBROUTINE h5tequal_f(type1_id, type2_id, flag, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type1_id ! Datatype identifier
|
||||
INTEGER(HID_T), INTENT(IN) :: type2_id ! Datatype identifier
|
||||
LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag to indicate if two
|
||||
! datatypes are equal
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: c_flag
|
||||
INTEGER, EXTERNAL :: h5tequal_c
|
||||
flag = .FALSE.
|
||||
hdferr = h5tequal_c(type1_id, type2_id, c_flag)
|
||||
if(c_flag .gt. 0) flag = .TRUE.
|
||||
END SUBROUTINE h5tequal_f
|
||||
|
||||
|
||||
SUBROUTINE h5tclose_f(type_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tclose_c
|
||||
hdferr = h5tclose_c(type_id)
|
||||
END SUBROUTINE h5tclose_f
|
||||
|
||||
|
||||
SUBROUTINE h5tget_class_f(type_id, class, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: class
|
||||
! Datatype class, possible values are:
|
||||
! H5T_NO_CLASS_F (-1)
|
||||
! H5T_INTEGER_F (0)
|
||||
! H5T_FLOAT_F (1)
|
||||
! H5T_TIME_F (2)
|
||||
! H5T_STRING_F (3)
|
||||
! H5T_BITFIELD_F (4)
|
||||
! H5T_OPAQUE_F (5)
|
||||
! H5T_COMPOUND_F (6)
|
||||
! H5T_REFERENCE_F (7)
|
||||
! H5T_ENUM_F (8)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_class_c
|
||||
hdferr = h5tget_class_c(type_id, class)
|
||||
END SUBROUTINE h5tget_class_f
|
||||
|
||||
|
||||
SUBROUTINE h5tget_size_f(type_id, size, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: size ! Datatype size
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_size_c
|
||||
hdferr = h5tget_size_c(type_id, size)
|
||||
END SUBROUTINE h5tget_size_f
|
||||
|
||||
|
||||
SUBROUTINE h5tset_size_f(type_id, size, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(IN) :: size ! Datatype size
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_size_c
|
||||
hdferr = h5tset_size_c(type_id, size)
|
||||
END SUBROUTINE h5tset_size_f
|
||||
|
||||
|
||||
SUBROUTINE h5tget_order_f(type_id, order, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: order
|
||||
! Datatype byte order, bossible values are:
|
||||
! H5T_ORDER_LE (0)
|
||||
! H5T_ORDER_BE (1)
|
||||
! H5T_ORDER_VAX (2)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_order_c
|
||||
hdferr = h5tget_order_c(type_id, order)
|
||||
END SUBROUTINE h5tget_order_f
|
||||
|
||||
|
||||
SUBROUTINE h5tset_order_f(type_id, order, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: order ! Datatype byte order, bossible values
|
||||
! are:
|
||||
! H5T_ORDER_LE (0)
|
||||
! H5T_ORDER_BE (1)
|
||||
! H5T_ORDER_VAX (2)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_order_c
|
||||
hdferr = h5tset_order_c(type_id, order)
|
||||
END SUBROUTINE h5tset_order_f
|
||||
|
||||
|
||||
SUBROUTINE h5tget_precision_f(type_id, precision, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: precision ! Datatype precision
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_precision_c
|
||||
hdferr = h5tget_precision_c(type_id, precision)
|
||||
END SUBROUTINE h5tget_precision_f
|
||||
|
||||
SUBROUTINE h5tset_precision_f(type_id, precision, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(IN) :: precision ! Datatype precision
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_precision_c
|
||||
hdferr = h5tset_precision_c(type_id, precision)
|
||||
END SUBROUTINE h5tset_precision_f
|
||||
|
||||
SUBROUTINE h5tget_offset_f(type_id, offset, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: offset ! Datatype bit offset of the
|
||||
! first significant bit
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_offset_c
|
||||
hdferr = h5tget_offset_c(type_id, offset)
|
||||
END SUBROUTINE h5tget_offset_f
|
||||
|
||||
SUBROUTINE h5tset_offset_f(type_id, offset, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(IN) :: offset ! Datatype bit offset of the
|
||||
! first significant bit
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_offset_c
|
||||
hdferr = h5tset_offset_c(type_id, offset)
|
||||
END SUBROUTINE h5tset_offset_f
|
||||
|
||||
SUBROUTINE h5tget_pad_f(type_id, lsbpad, msbpad, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: lsbpad ! padding type of the
|
||||
! least significant bit
|
||||
INTEGER, INTENT(OUT) :: msbpad ! padding type of the
|
||||
! most significant bit
|
||||
! Possible values of padding type are:
|
||||
! H5T__PAD_ZERO_F = 0
|
||||
! H5T__PAD_ONE_F = 1
|
||||
! H5T__PAD_BACKGROUND_F = 2
|
||||
! H5T_PAD_ERROR_F = -1
|
||||
! H5T_PAD_NPAD_F = 3
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_pad_c
|
||||
hdferr = h5tget_pad_c(type_id, lsbpad, msbpad)
|
||||
END SUBROUTINE h5tget_pad_f
|
||||
|
||||
SUBROUTINE h5tset_pad_f(type_id, lsbpad, msbpad, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: lsbpad ! padding type of the
|
||||
! least significant bit
|
||||
INTEGER, INTENT(IN) :: msbpad ! padding type of the
|
||||
! most significant bit
|
||||
! Possible values of padding type are:
|
||||
! H5T_PAD_ZERO_F = 0
|
||||
! H5T_PAD_ONE_F = 1
|
||||
! H5T_PAD_BACKGROUND_F = 2
|
||||
! H5T_PAD_ERROR_F = -1
|
||||
! H5T_PAD_NPAD_F = 3
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_pad_c
|
||||
hdferr = h5tset_pad_c(type_id, lsbpad, msbpad)
|
||||
END SUBROUTINE h5tset_pad_f
|
||||
|
||||
SUBROUTINE h5tget_sign_f(type_id, sign, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: sign ! sign type for an integer type
|
||||
!possible values are:
|
||||
!Unsigned integer type H5T_SGN_NONE_F = 0
|
||||
!Two's complement signed integer type
|
||||
!H5T_SGN_2_F = 1
|
||||
!or error value: H5T_SGN_ERROR_F=-1
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_sign_c
|
||||
hdferr = h5tget_sign_c(type_id, sign)
|
||||
END SUBROUTINE h5tget_sign_f
|
||||
|
||||
SUBROUTINE h5tset_sign_f(type_id, sign, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: sign !sign type for an integer type
|
||||
!possible values are:
|
||||
!Unsigned integer type H5T_SGN_NONE_F = 0
|
||||
!Two's complement signed integer type
|
||||
!H5T_SGN_2_F = 1
|
||||
!or error value: H5T_SGN_ERROR_F=-1
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_sign_c
|
||||
hdferr = h5tset_sign_c(type_id, sign)
|
||||
END SUBROUTINE h5tset_sign_f
|
||||
|
||||
SUBROUTINE h5tget_fields_f(type_id, epos, esize, mpos, msize, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: epos ! exponent bit-position
|
||||
INTEGER, INTENT(OUT) :: esize ! size of exponent in bits
|
||||
INTEGER, INTENT(OUT) :: mpos ! mantissa bit-position
|
||||
INTEGER, INTENT(OUT) :: msize ! size of mantissa in bits
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5tget_fields_c
|
||||
hdferr = h5tget_fields_c(type_id, epos, esize, mpos, msize, hdferr)
|
||||
END SUBROUTINE h5tget_fields_f
|
||||
|
||||
SUBROUTINE h5tset_fields_f(type_id, epos, esize, mpos, msize, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: epos ! exponent bit-position
|
||||
INTEGER, INTENT(IN) :: esize ! size of exponent in bits
|
||||
INTEGER, INTENT(IN) :: mpos ! mantissa bit-position
|
||||
INTEGER, INTENT(IN) :: msize ! size of mantissa in bits
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, EXTERNAL :: h5tset_fields_c
|
||||
hdferr = h5tset_fields_c(type_id, epos, esize, mpos, msize)
|
||||
END SUBROUTINE h5tset_fields_f
|
||||
|
||||
SUBROUTINE h5tget_ebias_f(type_id, ebias, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: ebias ! Datatype exponent bias of a floating-point type
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_ebias_c
|
||||
hdferr = h5tget_ebias_c(type_id, ebias)
|
||||
END SUBROUTINE h5tget_ebias_f
|
||||
|
||||
|
||||
SUBROUTINE h5tset_ebias_f(type_id, ebias, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER(SIZE_T), INTENT(IN) :: ebias !Datatype exponent bias of a floating-point type
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_ebias_c
|
||||
hdferr = h5tset_ebias_c(type_id, ebias)
|
||||
END SUBROUTINE h5tset_ebias_f
|
||||
|
||||
SUBROUTINE h5tget_norm_f(type_id, norm, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: norm !mantissa normalization of a floating-point datatype
|
||||
!Valid normalization types are:
|
||||
!H5T_NORM_IMPLIED_F(0),MSB of mantissa is not
|
||||
!stored, always 1, H5T_NORM_MSBSET_F(1), MSB of
|
||||
!mantissa is always 1, H5T_NORM_NONE_F(2)
|
||||
!Mantissa is not normalize
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_norm_c
|
||||
hdferr = h5tget_norm_c(type_id, norm)
|
||||
END SUBROUTINE h5tget_norm_f
|
||||
|
||||
|
||||
SUBROUTINE h5tset_norm_f(type_id, norm, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: norm !mantissa normalization of a floating-point datatype
|
||||
!Valid normalization types are:
|
||||
!H5T_NORM_IMPLIED_F(0),MSB of mantissa is not
|
||||
!stored, always 1, H5T_NORM_MSBSET_F(1), MSB of
|
||||
!mantissa is always 1, H5T_NORM_NONE_F(2)
|
||||
!Mantissa is not normalize
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_norm_c
|
||||
hdferr = h5tset_norm_c(type_id, norm)
|
||||
END SUBROUTINE h5tset_norm_f
|
||||
|
||||
SUBROUTINE h5tget_inpad_f(type_id, padtype, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: padtype ! padding type for unused bits
|
||||
! in floating-point datatypes.
|
||||
! Possible values of padding type are:
|
||||
! H5T__PAD_ZERO_F = 0
|
||||
! H5T__PAD_ONE_F = 1
|
||||
! H5T__PAD_BACKGROUND_F = 2
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_inpad_c
|
||||
hdferr = h5tget_inpad_c(type_id, padtype)
|
||||
END SUBROUTINE h5tget_inpad_f
|
||||
|
||||
SUBROUTINE h5tset_inpad_f(type_id, padtype, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: padtype ! padding type for unused bits
|
||||
! in floating-point datatypes.
|
||||
! Possible values of padding type are:
|
||||
! H5T__PAD_ZERO_F = 0
|
||||
! H5T__PAD_ONE_F = 1
|
||||
! H5T__PAD_BACKGROUND_F = 2
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_inpad_c
|
||||
hdferr = h5tset_inpad_c(type_id, padtype)
|
||||
END SUBROUTINE h5tset_inpad_f
|
||||
|
||||
SUBROUTINE h5tget_cset_f(type_id, cset, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: cset ! character set type of a string datatype
|
||||
! Possible values of padding type are:
|
||||
!H5T_CSET_ASCII_F = 0
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_cset_c
|
||||
hdferr = h5tget_cset_c(type_id, cset)
|
||||
END SUBROUTINE h5tget_cset_f
|
||||
|
||||
SUBROUTINE h5tset_cset_f(type_id, cset, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: cset !character set type of a string datatype
|
||||
!Possible values of padding type are:
|
||||
!H5T_CSET_ASCII_F = 0
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_cset_c
|
||||
hdferr = h5tset_cset_c(type_id, cset)
|
||||
END SUBROUTINE h5tset_cset_f
|
||||
|
||||
SUBROUTINE h5tget_strpad_f(type_id, strpad, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: strpad ! string padding method for a string datatype
|
||||
! Possible values of padding type are:
|
||||
!Pad with zeros (as C does): H5T_STR_NULL_F(0),
|
||||
!Pad with spaces (as FORTRAN does):
|
||||
!H5T_STR_SPACE_F(1)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_strpad_c
|
||||
hdferr = h5tget_strpad_c(type_id, strpad)
|
||||
END SUBROUTINE h5tget_strpad_f
|
||||
|
||||
SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: strpad ! string padding method for a string datatype
|
||||
! Possible values of padding type are:
|
||||
!Pad with zeros (as C does): H5T_STR_NULL_F(0),
|
||||
!Pad with spaces (as FORTRAN does):
|
||||
!H5T_STR_SPACE_F(1)
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tset_strpad_c
|
||||
hdferr = h5tset_strpad_c(type_id, strpad)
|
||||
END SUBROUTINE h5tset_strpad_f
|
||||
|
||||
|
||||
SUBROUTINE h5tget_nmembers_f(type_id, num_members, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: num_members !number of fields in a compound datatype
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_nmembers_c
|
||||
hdferr = h5tget_nmembers_c(type_id, num_members)
|
||||
END SUBROUTINE h5tget_nmembers_f
|
||||
|
||||
SUBROUTINE h5tget_member_name_f(type_id,index, member_name, namelen, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: index !Field index (0-based) of the field name to retrieve
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: member_name !name of a field of
|
||||
!a compound datatype
|
||||
INTEGER, INTENT(OUT) :: namelen ! Length the name
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_member_name_c
|
||||
hdferr = h5tget_member_name_c(type_id, index, member_name, namelen)
|
||||
END SUBROUTINE h5tget_member_name_f
|
||||
|
||||
SUBROUTINE h5tget_member_offset_f(type_id, member_no, offset, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: member_no !Number of the field
|
||||
!whose offset is requested
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: offset !byte offset of the the beginning of the field
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_member_offset_c
|
||||
hdferr = h5tget_member_offset_c(type_id, member_no, offset )
|
||||
END SUBROUTINE h5tget_member_offset_f
|
||||
|
||||
SUBROUTINE h5tget_member_dims_f(type_id, field_idx,dims, field_dims, perm, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of
|
||||
!field_dims, perm)
|
||||
INTEGER, INTENT(OUT) :: dims !number of dimensions of the field
|
||||
|
||||
INTEGER(SIZE_T),DIMENSION(*), INTENT(OUT) :: field_dims !buffer to store the
|
||||
!dimensions of the field
|
||||
INTEGER, DIMENSION(*), INTENT(OUT) :: perm !buffer to store the
|
||||
!permutation vector of the field
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_member_dims_c
|
||||
hdferr = h5tget_member_dims_c(type_id, field_idx, dims, field_dims, perm)
|
||||
|
||||
END SUBROUTINE h5tget_member_dims_f
|
||||
|
||||
SUBROUTINE h5tget_member_type_f(type_id, field_idx, datatype, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of the field type to retrieve
|
||||
INTEGER(HID_T), INTENT(OUT) :: datatype !identifier of a copy of
|
||||
!the datatype of the field
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_member_type_c
|
||||
hdferr = h5tget_member_type_c(type_id, field_idx , datatype)
|
||||
END SUBROUTINE h5tget_member_type_f
|
||||
|
||||
|
||||
SUBROUTINE h5tcreate_f(class, size, type_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(IN) :: class ! Datatype class cna be one of
|
||||
! H5T_COMPOUND_F (6)
|
||||
! H5T_ENUM_F (8)
|
||||
! H5T_OPAQUE_F (9)
|
||||
INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the datatype
|
||||
INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tcreate_c
|
||||
|
||||
hdferr = h5tcreate_c(class, size, type_id)
|
||||
END SUBROUTINE h5tcreate_f
|
||||
|
||||
SUBROUTINE h5tinsert_f(type_id, name, offset, field_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !Name of the field to insert
|
||||
INTEGER(SIZE_T), INTENT(IN) :: offset !Offset in memory structure of the field to insert
|
||||
INTEGER(HID_T), INTENT(IN) :: field_id !datatype identifier of the new member
|
||||
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen
|
||||
INTEGER, EXTERNAL :: h5tinsert_c
|
||||
namelen = LEN(name)
|
||||
hdferr = h5tinsert_c(type_id, name, namelen, offset, field_id )
|
||||
END SUBROUTINE h5tinsert_f
|
||||
|
||||
SUBROUTINE h5tpack_f(type_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tpack_c
|
||||
hdferr = h5tpack_c(type_id)
|
||||
END SUBROUTINE h5tpack_f
|
||||
|
||||
SUBROUTINE h5tinsert_array_f(parent_id,name,offset, ndims, dims, member_id, hdferr, perm)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: parent_id ! identifier of the parent compound datatype
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member
|
||||
INTEGER(SIZE_T), INTENT(IN) :: offset !Offset to start of new member
|
||||
!within compound datatype
|
||||
INTEGER, INTENT(IN) :: ndims !Dimensionality of new member.
|
||||
!Valid values are 0 (zero) through 4 (four)
|
||||
INTEGER(SIZE_T), DIMENSION(*), INTENT(IN) :: dims !Size of new member array
|
||||
INTEGER(HID_T), INTENT(IN) :: member_id ! identifier of the datatype of the new member
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
INTEGER, DIMENSION(*), OPTIONAL, INTENT(IN) :: perm
|
||||
!Pointer to buffer to store
|
||||
!the permutation vector of the field
|
||||
INTEGER :: namelen, sizeofperm
|
||||
INTEGER, EXTERNAL :: h5tinsert_array_c, h5tinsert_array_c2
|
||||
namelen = LEN(name)
|
||||
if (present(perm)) then
|
||||
hdferr = h5tinsert_array_c(parent_id, name, namelen, offset, ndims,dims, member_id, perm)
|
||||
else
|
||||
hdferr = h5tinsert_array_c2(parent_id, name, namelen, offset, ndims,dims, member_id)
|
||||
end if
|
||||
|
||||
END SUBROUTINE h5tinsert_array_f
|
||||
|
||||
SUBROUTINE h5tenum_create_f(parent_id, new_type_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: parent_id ! Datatype identifier for
|
||||
! the base datatype
|
||||
INTEGER(HID_T), INTENT(OUT) :: new_type_id
|
||||
!datatype identifier for the
|
||||
! new enumeration datatype
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tenum_create_c
|
||||
hdferr = h5tenum_create_c(parent_id, new_type_id)
|
||||
END SUBROUTINE h5tenum_create_f
|
||||
|
||||
SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member
|
||||
INTEGER, INTENT(IN) :: value !value of the new member
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen
|
||||
INTEGER, EXTERNAL :: h5tenum_insert_c
|
||||
namelen = LEN(name)
|
||||
hdferr = h5tenum_insert_c(type_id, name, namelen, value)
|
||||
END SUBROUTINE h5tenum_insert_f
|
||||
|
||||
SUBROUTINE h5tenum_nameof_f(type_id, name, namelen, value, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: name !Name of the enumeration datatype.
|
||||
INTEGER(SIZE_T), INTENT(IN) :: namelen !length of the name
|
||||
INTEGER, INTENT(IN) :: value !value of the enumeration datatype.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tenum_nameof_c
|
||||
hdferr = h5tenum_nameof_c(type_id, value, name, namelen)
|
||||
END SUBROUTINE h5tenum_nameof_f
|
||||
|
||||
SUBROUTINE h5tenum_valueof_f(type_id, name, value, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name !Name of the enumeration datatype.
|
||||
INTEGER, INTENT(OUT) :: value !value of the enumeration datatype.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen
|
||||
INTEGER, EXTERNAL :: h5tenum_valueof_c
|
||||
namelen = LEN(name)
|
||||
hdferr = h5tenum_valueof_c(type_id, name, namelen, value)
|
||||
END SUBROUTINE h5tenum_valueof_f
|
||||
|
||||
SUBROUTINE h5tget_member_value_f(type_id, member_no, value, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
INTEGER, INTENT(IN) :: member_no !Number of the enumeration datatype member
|
||||
INTEGER, INTENT(OUT) :: value !value of the enumeration datatype.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_member_value_c
|
||||
hdferr = h5tget_member_value_c(type_id, member_no, value)
|
||||
END SUBROUTINE h5tget_member_value_f
|
||||
|
||||
SUBROUTINE h5tset_tag_f(type_id, tag, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
CHARACTER(LEN=*), INTENT(IN) :: tag !Unique ASCII string with which
|
||||
!the opaque datatype is to be tagged
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER :: namelen
|
||||
INTEGER, EXTERNAL :: h5tset_tag_c
|
||||
namelen = LEN(tag)
|
||||
hdferr = h5tset_tag_c(type_id, tag, namelen)
|
||||
END SUBROUTINE h5tset_tag_f
|
||||
|
||||
SUBROUTINE h5tget_tag_f(type_id, tag,taglen, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
|
||||
CHARACTER(LEN=*), INTENT(OUT) :: tag !Unique ASCII string with which
|
||||
!the opaque datatype is to be tagged
|
||||
INTEGER, INTENT(OUT) :: taglen !length of tag
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
INTEGER, EXTERNAL :: h5tget_tag_c
|
||||
hdferr = h5tget_tag_c(type_id, tag, taglen)
|
||||
END SUBROUTINE h5tget_tag_f
|
||||
|
||||
END MODULE H5T
|
77
fortran/src/H5f90.h
Normal file
77
fortran/src/H5f90.h
Normal file
@ -0,0 +1,77 @@
|
||||
#ifndef _H5f90_H
|
||||
#define _H5f90_H
|
||||
|
||||
#include <hdf5.h>
|
||||
#include "H5f90i.h"
|
||||
#include "H5f90proto.h"
|
||||
|
||||
|
||||
/* Constants from the H5Ff.c and H5Fff.f90 files */
|
||||
|
||||
|
||||
#define H5F_ACC_RDWR_F 1
|
||||
#define H5F_ACC_RDONLY_F 2
|
||||
#define H5F_ACC_TRUNC_F 3
|
||||
#define H5F_ACC_EXCL_F 4
|
||||
#define H5F_ACC_DEBUG_F 5
|
||||
#define H5P_DEFAULT_F 6 /* Can Fortran program use combination
|
||||
of those flags? */
|
||||
#define H5F_SCOPE_LOCAL_F 0
|
||||
#define H5F_SCOPE_GLOBAL_F 1
|
||||
|
||||
/* Constants used in the H5Gf.c and H5Gff.f90 files */
|
||||
|
||||
#define OBJECT_NAMELEN_DEFAULT_F -1
|
||||
#define H5G_LINK_F 0
|
||||
#define H5G_GROUP_F 1
|
||||
#define H5G_DATASET_F 2
|
||||
#define H5G_TYPE_F 3
|
||||
|
||||
|
||||
/* Constants used in H5Df.c and H5Dff.f90 files */
|
||||
|
||||
#define H5S_ALL_F -2
|
||||
|
||||
/* Constants used in H5Sf.c and H5Sff.f90 files */
|
||||
|
||||
#define H5S_NO_CLASS_F -1
|
||||
#define H5S_SCALAR_F 0
|
||||
#define H5S_SIMPLE_F 1
|
||||
#define H5S_SELECT_SET_F 0
|
||||
#define H5S_SELECT_OR_F 1
|
||||
|
||||
/* Constants ised in H5Tf.c and H5Tff.f90 files */
|
||||
|
||||
|
||||
#define H5T_NO_CLASS_F -1
|
||||
#define H5T_INTEGER_F 0
|
||||
#define H5T_FLOAT_F 1
|
||||
#define H5T_TIME_F 2
|
||||
#define H5T_STRING_F 3
|
||||
#define H5T_BITFIELD_F 4
|
||||
#define H5T_OPAQUE_F 5
|
||||
#define H5T_COMPOUND_F 6
|
||||
#define H5T_REFERENCE_F 7
|
||||
#define H5T_ENUM_F 8
|
||||
|
||||
#define H5T_ORDER_LE_F 0
|
||||
#define H5T_ORDER_BE_F 1
|
||||
#define H5T_ORDER_VAX_F 2
|
||||
|
||||
|
||||
/* Constants used in H5Pf.c and H5Pff.f90 files */
|
||||
|
||||
|
||||
#define H5P_NO_CLASS_F -1
|
||||
#define H5P_FILE_CREATE_F 0
|
||||
#define H5P_FILE_ACCESS_F 1
|
||||
#define H5P_DATASET_CREATE_F 2
|
||||
#define H5P_DATASET_XFER_F 3
|
||||
#define H5P_MOUNT_F 4
|
||||
|
||||
/* Constants used in H5Pf_parallel.c and H5Pff_parallel.f90 files */
|
||||
#define H5D_XFER_INDEPENDENT_F 0
|
||||
#define H5D_XFER_COLLECTIVE_F 1
|
||||
#define H5D_XFER_DFLT_F 2
|
||||
|
||||
#endif /* _H5f90_H */
|
105
fortran/src/H5f90global.f90
Normal file
105
fortran/src/H5f90global.f90
Normal file
@ -0,0 +1,105 @@
|
||||
MODULE H5GLOBAL
|
||||
USE H5FORTRAN_TYPES
|
||||
INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 6 ! Do not forget to change this
|
||||
! value when new predefined
|
||||
! datatypes are added
|
||||
! Do not forget to change the following line when new predefined
|
||||
! floating data types are added
|
||||
INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4
|
||||
|
||||
! Do not forget to change the following line when new predefined
|
||||
! integer data types are added
|
||||
INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 16
|
||||
|
||||
INTEGER(HID_T) H5T_NATIVE_INTEGER, &
|
||||
H5T_NATIVE_REAL, &
|
||||
H5T_NATIVE_DOUBLE, &
|
||||
H5T_NATIVE_CHARACTER , &
|
||||
H5T_STD_REF_OBJ, &
|
||||
H5T_STD_REF_DSETREG, &
|
||||
H5T_IEEE_F32BE, &
|
||||
H5T_IEEE_F32LE, &
|
||||
H5T_IEEE_F64BE, &
|
||||
H5T_IEEE_F64LE, &
|
||||
H5T_STD_I8BE, &
|
||||
H5T_STD_I8LE, &
|
||||
H5T_STD_I16BE, &
|
||||
H5T_STD_I16LE, &
|
||||
H5T_STD_I32BE, &
|
||||
H5T_STD_I32LE, &
|
||||
H5T_STD_I64BE, &
|
||||
H5T_STD_I64LE, &
|
||||
H5T_STD_U8BE, &
|
||||
H5T_STD_U8LE, &
|
||||
H5T_STD_U16BE, &
|
||||
H5T_STD_U16LE, &
|
||||
H5T_STD_U32BE, &
|
||||
H5T_STD_U32LE, &
|
||||
H5T_STD_U64BE, &
|
||||
H5T_STD_U64LE
|
||||
|
||||
|
||||
INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types
|
||||
EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER)
|
||||
EQUIVALENCE (predef_types(2), H5T_NATIVE_REAL)
|
||||
EQUIVALENCE (predef_types(3), H5T_NATIVE_DOUBLE)
|
||||
EQUIVALENCE (predef_types(4), H5T_NATIVE_CHARACTER)
|
||||
EQUIVALENCE (predef_types(5), H5T_STD_REF_OBJ)
|
||||
EQUIVALENCE (predef_types(6), H5T_STD_REF_DSETREG)
|
||||
|
||||
INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types
|
||||
EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE )
|
||||
EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE)
|
||||
EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE)
|
||||
EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE)
|
||||
|
||||
INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types
|
||||
EQUIVALENCE (integer_types(1), H5T_STD_I8BE )
|
||||
EQUIVALENCE (integer_types(2), H5T_STD_I8LE)
|
||||
EQUIVALENCE (integer_types(3), H5T_STD_I16BE)
|
||||
EQUIVALENCE (integer_types(4), H5T_STD_I16LE)
|
||||
EQUIVALENCE (integer_types(5), H5T_STD_I32BE)
|
||||
EQUIVALENCE (integer_types(6), H5T_STD_I32LE)
|
||||
EQUIVALENCE (integer_types(7), H5T_STD_I64BE)
|
||||
EQUIVALENCE (integer_types(8), H5T_STD_I64LE)
|
||||
EQUIVALENCE (integer_types(9), H5T_STD_U8BE)
|
||||
EQUIVALENCE (integer_types(10), H5T_STD_U8LE)
|
||||
EQUIVALENCE (integer_types(11), H5T_STD_U16BE)
|
||||
EQUIVALENCE (integer_types(12), H5T_STD_U16LE)
|
||||
EQUIVALENCE (integer_types(13), H5T_STD_U32BE)
|
||||
EQUIVALENCE (integer_types(14), H5T_STD_U32LE)
|
||||
EQUIVALENCE (integer_types(15), H5T_STD_U64BE)
|
||||
EQUIVALENCE (integer_types(16), H5T_STD_U64LE)
|
||||
|
||||
|
||||
COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, &
|
||||
H5T_NATIVE_REAL, &
|
||||
H5T_NATIVE_DOUBLE, &
|
||||
H5T_NATIVE_CHARACTER, &
|
||||
H5T_STD_REF_OBJ, &
|
||||
H5T_STD_REF_DSETREG
|
||||
|
||||
COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, &
|
||||
H5T_IEEE_F32LE, &
|
||||
H5T_IEEE_F64BE, &
|
||||
H5T_IEEE_F64LE
|
||||
|
||||
COMMON /INTEGER_TYPES/ H5T_STD_I8BE, &
|
||||
H5T_STD_I8LE, &
|
||||
H5T_STD_I16BE, &
|
||||
H5T_STD_I16LE, &
|
||||
H5T_STD_I32BE, &
|
||||
H5T_STD_I32LE, &
|
||||
H5T_STD_I64BE, &
|
||||
H5T_STD_I64LE, &
|
||||
H5T_STD_U8BE, &
|
||||
H5T_STD_U8LE, &
|
||||
H5T_STD_U16BE, &
|
||||
H5T_STD_U16LE, &
|
||||
H5T_STD_U32BE, &
|
||||
H5T_STD_U32LE, &
|
||||
H5T_STD_U64BE, &
|
||||
H5T_STD_U64LE
|
||||
|
||||
END MODULE H5GLOBAL
|
||||
|
286
fortran/src/H5f90i.h
Normal file
286
fortran/src/H5f90i.h
Normal file
@ -0,0 +1,286 @@
|
||||
#ifndef _H5f90i_H
|
||||
#define _H5f90i_H
|
||||
|
||||
#ifdef GOT_MACHINE
|
||||
#undef GOT_MACHINE
|
||||
#endif
|
||||
|
||||
#define DFMT_IRIX 0x1111
|
||||
|
||||
/*
|
||||
* Standard header files needed all the time
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#if (defined (UNICOS) || (defined (_UNICOS)))
|
||||
|
||||
#ifndef UNICOS
|
||||
#define UNICOS
|
||||
#endif
|
||||
|
||||
#include <memory.h>
|
||||
#include <fortran.h>
|
||||
#ifndef O_RDONLY
|
||||
#include <fcntl.h> /* for unbuffered i/o stuff */
|
||||
#define L_INCR 1
|
||||
#include <sys/stat.h>
|
||||
#endif /*O_RDONLY*/
|
||||
|
||||
#ifdef _CRAYIEEE
|
||||
#define DF_MT DFMT_UNICOSIEEE
|
||||
#else
|
||||
#define DF_MT DFMT_UNICOS
|
||||
#endif
|
||||
/*typedef char* _fcd;*/
|
||||
typedef long hsize_t_f;
|
||||
typedef long hssize_t_f;
|
||||
typedef long size_t_f;
|
||||
typedef long int_f;
|
||||
typedef long hid_t_f;
|
||||
typedef double real_f;
|
||||
#define DF_CAPFNAMES
|
||||
/*#define _fcdtocp(desc) (desc)*/
|
||||
|
||||
#endif /* UNICOS */
|
||||
|
||||
|
||||
/* LINUX definitions */
|
||||
#if defined(i386) && defined(linux)
|
||||
#define DF_MT DFMT_LINIX
|
||||
typedef char *_fcd;
|
||||
typedef long long hsize_t_f;
|
||||
typedef long long hssize_t_f;
|
||||
typedef int size_t_f;
|
||||
typedef int int_f;
|
||||
typedef int hid_t_f;
|
||||
typedef float real_f;
|
||||
#define FNAME_POST_UNDERSCORE
|
||||
#define _fcdtocp(desc) (desc)
|
||||
|
||||
#endif /*LINUX*/
|
||||
|
||||
#if defined(IRIX) || defined(IRIS4) || defined(sgi) || defined(__sgi__) || defined(__sgi)
|
||||
|
||||
#ifndef IRIX
|
||||
#define IRIX
|
||||
#endif
|
||||
|
||||
#if (_MIPS_SZLONG == 64)
|
||||
/* IRIX 64 bits objects. It is nearly the same as the conventional
|
||||
* 32 bits objects. Let them share IRIX definitions for now.
|
||||
*/
|
||||
#define IRIX64
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef GOT_MACHINE
|
||||
If you get an error on this line more than one machine type has been defined.
|
||||
Please check your Makefile.
|
||||
#endif
|
||||
#define GOT_MACHINE 1
|
||||
|
||||
# define BSD
|
||||
#ifndef __GNUC__
|
||||
#include <memory.h>
|
||||
#endif /* __GNUC__ */
|
||||
#include <sys/file.h> /* for unbuffered i/o stuff */
|
||||
#include <sys/stat.h>
|
||||
#define DF_MT DFMT_IRIX
|
||||
typedef char *_fcd;
|
||||
|
||||
typedef long hsize_t_f;
|
||||
typedef long hssize_t_f;
|
||||
typedef long size_t_f;
|
||||
typedef int int_f;
|
||||
typedef int hid_t_f;
|
||||
typedef float real_f;
|
||||
#define FNAME_POST_UNDERSCORE
|
||||
#define _fcdtocp(desc) (desc)
|
||||
#ifdef IRIX64
|
||||
#define BIG_LONGS
|
||||
#endif
|
||||
|
||||
|
||||
#define HAVE_STDC
|
||||
#define INCLUDES_ARE_ANSI
|
||||
|
||||
#endif /* IRIX */
|
||||
|
||||
#if (defined(SUN) || defined(sun) || defined(__sun__) || defined(__SUNPRO_C)) & !defined(__i386)
|
||||
#ifdef __STDC__
|
||||
#define ANSISUN
|
||||
#else /* __STDC__ */
|
||||
#define KNRSUN
|
||||
#endif /* __STDC__ */
|
||||
#endif /* SUN || sun */
|
||||
|
||||
#if defined(ANSISUN)
|
||||
|
||||
#if !defined(SUN)
|
||||
#define SUN
|
||||
#endif
|
||||
|
||||
#ifdef GOT_MACHINE
|
||||
If you get an error on this line more than one machine type has been defined.
|
||||
Please check your Makefile.
|
||||
#endif
|
||||
#define GOT_MACHINE
|
||||
|
||||
#include <unistd.h> /* for some file I/O stuff */
|
||||
#include <sys/time.h>
|
||||
#include <sys/file.h> /* for unbuffered i/o stuff */
|
||||
#include <sys/stat.h>
|
||||
#define DF_MT DFMT_SUN
|
||||
typedef char *_fcd;
|
||||
typedef int hsize_t_f;
|
||||
typedef int hssize_t_f;
|
||||
typedef int size_t_f;
|
||||
typedef int int_f;
|
||||
typedef int hid_t_f;
|
||||
typedef float real_f;
|
||||
#define FNAME_POST_UNDERSCORE
|
||||
#define _fcdtocp(desc) (desc)
|
||||
|
||||
#endif /*SUN*/
|
||||
|
||||
|
||||
#if defined DEC_ALPHA || (defined __alpha && defined __unix__)
|
||||
|
||||
#ifndef DEC_ALPHA
|
||||
#define DEC_ALPHA
|
||||
#endif
|
||||
|
||||
#ifdef GOT_MACHINE
|
||||
If you get an error on this line more than one machine type has been defined.
|
||||
Please check your Makefile.
|
||||
#endif
|
||||
#define GOT_MACHINE
|
||||
|
||||
#include <sys/file.h> /* for unbuffered i/o stuff */
|
||||
#include <sys/stat.h>
|
||||
#define DF_MT DFMT_ALPHA
|
||||
typedef char *_fcd;
|
||||
typedef long hsize_t_f;
|
||||
typedef long hssize_t_f;
|
||||
typedef long size_t_f;
|
||||
typedef int int_f;
|
||||
typedef int hid_t_f;
|
||||
typedef float real_f;
|
||||
#define FNAME_POST_UNDERSCORE
|
||||
#define _fcdtocp(desc) (desc)
|
||||
|
||||
#endif /* DEC_ALPHA */
|
||||
|
||||
|
||||
#if defined(HP9000) || (!defined(__convexc__) && (defined(hpux) || defined(__hpux)))
|
||||
|
||||
#ifndef HP9000
|
||||
#define HP9000
|
||||
#endif
|
||||
|
||||
#ifdef GOT_MACHINE
|
||||
If you get an error on this line more than one machine type has been defined.
|
||||
Please check your Makefile.
|
||||
#endif
|
||||
#define GOT_MACHINE
|
||||
|
||||
#ifndef HAVE_UNISTD_H
|
||||
#define HAVE_UNISTD_H /* unistd.h - close, fork,..etc */
|
||||
#endif
|
||||
|
||||
# define BSD
|
||||
#ifndef __GNUC__
|
||||
#include <memory.h>
|
||||
#endif /* __GNUC__ */
|
||||
#include <sys/file.h> /* for unbuffered i/o stuff */
|
||||
#include <sys/stat.h>
|
||||
#define DF_MT DFMT_HP9000
|
||||
typedef char *_fcd;
|
||||
typedef long hsize_t_f;
|
||||
typedef long hssize_t_f;
|
||||
typedef long size_t_f;
|
||||
typedef int int_f;
|
||||
typedef int hid_t_f;
|
||||
typedef float real_f;
|
||||
#define _fcdtocp(desc) (desc)
|
||||
#ifdef HAVE_FMPOOL
|
||||
#define FILELIB PAGEBUFIO /* enable page buffering */
|
||||
#else
|
||||
#define FILELIB UNIXBUFIO
|
||||
#endif
|
||||
|
||||
#endif /* HP9000 */
|
||||
|
||||
|
||||
#if defined _WINDOWS || defined WIN32
|
||||
#define GOT_MACHINE 1
|
||||
|
||||
#pragma comment( lib, "oldnames" )
|
||||
#include <fcntl.h>
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
#include <io.h>
|
||||
#include <conio.h>
|
||||
#include <malloc.h>
|
||||
#include <ctype.h> /* for character macros */
|
||||
#ifdef __WATCOMC__
|
||||
#include <stddef.h> /* for the 'fortran' pragma */
|
||||
#endif
|
||||
|
||||
#define DF_MT DFMT_PC
|
||||
|
||||
typedef char *_fcd;
|
||||
typedef int hsize_t_f;
|
||||
typedef int hssize_t_f;
|
||||
typedef int size_t_f;
|
||||
typedef int int_f;
|
||||
typedef int hid_t_f;
|
||||
typedef float real_f;
|
||||
|
||||
#if defined _M_ALPHA
|
||||
#define FNAME_PRE_UNDERSCORE
|
||||
#endif
|
||||
|
||||
#define DF_CAPFNAMES
|
||||
#define _fcdtocp(desc) (desc)
|
||||
|
||||
#ifdef HAVE_FMPOOL
|
||||
#define FILELIB PAGEBUFIO /* enable page buffering */
|
||||
#else
|
||||
#define FILELIB UNIXBUFIO
|
||||
#endif
|
||||
|
||||
#endif /*WINDOWS */
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
** MACRO FNAME for any fortran callable routine name.
|
||||
**
|
||||
** This macro prepends, appends, or does not modify a name
|
||||
** passed as a macro parameter to it based on the FNAME_PRE_UNDERSCORE,
|
||||
** FNAME_POST_UNDERSCORE macros set for a specific system.
|
||||
**
|
||||
**---------------------------------------------------------------*/
|
||||
#if defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST_UNDERSCORE)
|
||||
# define FNAME(x) _##x##_
|
||||
#endif
|
||||
#if defined(FNAME_PRE_UNDERSCORE) && !defined(FNAME_POST_UNDERSCORE)
|
||||
# define FNAME(x) _##x
|
||||
#endif
|
||||
#if !defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST_UNDERSCORE)
|
||||
# define FNAME(x) x##_
|
||||
#endif
|
||||
#if !defined(FNAME_PRE_UNDERSCORE) && !defined(FNAME_POST_UNDERSCORE)
|
||||
# define FNAME(x) x
|
||||
#endif
|
||||
|
||||
# define HDfree(p) (free((void*)p))
|
||||
# define HDmalloc(s) (malloc((size_t)s))
|
||||
# define HDstrlen(s) (strlen((const char *)(s)))
|
||||
# define HDmemcpy(dst,src,n) (memcpy((void *)(dst),(const void *)(src),(size_t)(n)))
|
||||
|
||||
|
||||
#endif /* _H5f90i_H */
|
105
fortran/src/H5f90kit.c
Normal file
105
fortran/src/H5f90kit.c
Normal file
@ -0,0 +1,105 @@
|
||||
#include <ctype.h>
|
||||
#include <stddef.h>
|
||||
#include "H5f90.h"
|
||||
|
||||
|
||||
/*
|
||||
* Routines from HDF4 to deal with C-FORTRAN issues.
|
||||
*
|
||||
* HD5c2fstr -- convert a C string into a Fortran string IN PLACE
|
||||
* HD5f2cstring -- convert a Fortran string to a C string
|
||||
*/
|
||||
|
||||
/* ------------------------------- HDc2fstr -------------------------------
|
||||
NAME
|
||||
HD5c2fstr -- convert a C string into a Fortran string IN PLACE
|
||||
USAGE
|
||||
int HD5c2fstr(str, len)
|
||||
char * str; IN: string to convert
|
||||
int len; IN: length of Fortran string
|
||||
RETURNS
|
||||
SUCCEED
|
||||
DESCRIPTION
|
||||
Change a C string (NULL terminated) into a Fortran string.
|
||||
Basically, all that is done is that the NULL is ripped out
|
||||
and the string is padded with spaces
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
int
|
||||
HD5c2fstr(char *str, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
i=(int)HDstrlen(str);
|
||||
for (; i < len; i++)
|
||||
str[i] = ' ';
|
||||
return 0;
|
||||
} /* HD5c2fstr */
|
||||
|
||||
/* ----------------------------- HDf2cstring ------------------------------ */
|
||||
/*
|
||||
NAME
|
||||
HD5f2cstring -- convert a Fortran string to a C string
|
||||
USAGE
|
||||
char * HDf2cstring(fdesc, len)
|
||||
_fcd fdesc; IN: Fortran string descriptor
|
||||
int len; IN: length of Fortran string
|
||||
RETURNS
|
||||
Pointer to the C string if success, else NULL
|
||||
DESCRIPTION
|
||||
Chop off trailing blanks off of a Fortran string and
|
||||
move it into a newly allocated C string. It is up
|
||||
to the user to free this string.
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
char *
|
||||
HD5f2cstring(_fcd fdesc, int len)
|
||||
{
|
||||
char *cstr, *str;
|
||||
int i;
|
||||
|
||||
str = _fcdtocp(fdesc);
|
||||
/* This should be equivalent to the above test -QAK */
|
||||
for(i=len-1; i>=0 && !isgraph((int)str[i]); i--)
|
||||
/*EMPTY*/;
|
||||
cstr = (char *) HDmalloc( (i + 2));
|
||||
if (!cstr) return NULL;
|
||||
cstr[i + 1] = '\0';
|
||||
HDmemcpy(cstr,str,i+1);
|
||||
return cstr;
|
||||
} /* HD5f2cstring */
|
||||
|
||||
/* ---------------------------- HDpackFstring ----------------------------- */
|
||||
/*
|
||||
NAME
|
||||
HDpackFstring -- convert a C string into a Fortran string
|
||||
USAGE
|
||||
intn HDpackFstring(src, dest, len)
|
||||
char * src; IN: source string
|
||||
char * dest; OUT: destination
|
||||
intn len; IN: length of string
|
||||
RETURNS
|
||||
SUCCEED / FAIL
|
||||
DESCRIPTION
|
||||
given a NULL terminated C string 'src' convert it to
|
||||
a space padded Fortran string 'dest' of length 'len'
|
||||
|
||||
This is very similar to HDc2fstr except that function does
|
||||
it in place and this one copies. We should probably only
|
||||
support one of these.
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
int
|
||||
HDpackFstring(char *src, char *dest, int len)
|
||||
{
|
||||
int sofar;
|
||||
|
||||
for (sofar = 0; (sofar < len) && (*src != '\0'); sofar++)
|
||||
*dest++ = *src++;
|
||||
|
||||
while (sofar++ < len)
|
||||
*dest++ = ' ';
|
||||
|
||||
return 0;
|
||||
} /* HDpackFstring */
|
||||
|
139
fortran/src/H5f90misc.c
Normal file
139
fortran/src/H5f90misc.c
Normal file
@ -0,0 +1,139 @@
|
||||
#include "H5f90.h"
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
* Name: h5init_types_c
|
||||
* Purpose: Initialize predefined datatypes in Fortran
|
||||
* Inputs: types - array with the predefined Native Fortran
|
||||
* type, its element and length must be the
|
||||
* same as the types array defined in the
|
||||
* H5f90global.f90
|
||||
* floatingtypes - array with the predefined Floating Fortran
|
||||
* type, its element and length must be the
|
||||
* same as the floatingtypes array defined in the
|
||||
* H5f90global.f90
|
||||
* integertypes - array with the predefined Integer Fortran
|
||||
* type, its element and length must be the
|
||||
* same as the integertypes array defined in the
|
||||
* H5f90global.f90
|
||||
* Outputs: None
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 3, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes )
|
||||
{
|
||||
|
||||
int ret_value = -1;
|
||||
hid_t c_type_id;
|
||||
if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value;
|
||||
#if defined(_UNICOS)
|
||||
if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
|
||||
#else
|
||||
if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
|
||||
#endif
|
||||
if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
|
||||
/*
|
||||
if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value;
|
||||
*/
|
||||
if ((c_type_id = H5Tcopy(H5T_FORTRAN_S1)) < 0) return ret_value;
|
||||
if(H5Tset_size(c_type_id, 1) < 0) return ret_value;
|
||||
if(H5Tset_strpad(c_type_id, H5T_STR_SPACEPAD) < 0) return ret_value;
|
||||
types[3] = (hid_t_f)c_type_id;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if ((types[3] = H5Tcopy(H5T_C_S1)) < 0) return ret_value;
|
||||
if(H5Tset_strpad(types[3],H5T_STR_NULLTERM) < 0) return ret_value;
|
||||
if(H5Tset_size(types[3],1) < 0) return ret_value;
|
||||
*/
|
||||
|
||||
|
||||
/* if ((types[3] = H5Tcopy(H5T_STD_I8BE)) < 0) return ret_value;
|
||||
*/
|
||||
if ((types[4] = (hid_t_f)H5Tcopy(H5T_STD_REF_OBJ)) < 0) return ret_value;
|
||||
if ((types[5] = (hid_t_f)H5Tcopy(H5T_STD_REF_DSETREG)) < 0) return ret_value;
|
||||
|
||||
if ((floatingtypes[0] = (hid_t_f)H5Tcopy(H5T_IEEE_F32BE)) < 0) return ret_value;
|
||||
if ((floatingtypes[1] = (hid_t_f)H5Tcopy(H5T_IEEE_F32LE)) < 0) return ret_value;
|
||||
if ((floatingtypes[2] = (hid_t_f)H5Tcopy(H5T_IEEE_F64BE)) < 0) return ret_value;
|
||||
if ((floatingtypes[3] = (hid_t_f)H5Tcopy(H5T_IEEE_F64LE)) < 0) return ret_value;
|
||||
|
||||
if ((integertypes[0] = (hid_t_f)H5Tcopy(H5T_STD_I8BE)) < 0) return ret_value;
|
||||
if ((integertypes[1] = (hid_t_f)H5Tcopy(H5T_STD_I8LE)) < 0) return ret_value;
|
||||
if ((integertypes[2] = (hid_t_f)H5Tcopy(H5T_STD_I16BE)) < 0) return ret_value;
|
||||
if ((integertypes[3] = (hid_t_f)H5Tcopy(H5T_STD_I16LE)) < 0) return ret_value;
|
||||
if ((integertypes[4] = (hid_t_f)H5Tcopy(H5T_STD_I32BE)) < 0) return ret_value;
|
||||
if ((integertypes[5] = (hid_t_f)H5Tcopy(H5T_STD_I32LE)) < 0) return ret_value;
|
||||
if ((integertypes[6] = (hid_t_f)H5Tcopy(H5T_STD_I64BE)) < 0) return ret_value;
|
||||
if ((integertypes[7] = (hid_t_f)H5Tcopy(H5T_STD_I64LE)) < 0) return ret_value;
|
||||
if ((integertypes[8] = (hid_t_f)H5Tcopy(H5T_STD_U8BE)) < 0) return ret_value;
|
||||
if ((integertypes[9] = (hid_t_f)H5Tcopy(H5T_STD_U8LE)) < 0) return ret_value;
|
||||
if ((integertypes[10] = (hid_t_f)H5Tcopy(H5T_STD_U16BE)) < 0) return ret_value;
|
||||
if ((integertypes[11] = (hid_t_f)H5Tcopy(H5T_STD_U16LE)) < 0) return ret_value;
|
||||
if ((integertypes[12] = (hid_t_f)H5Tcopy(H5T_STD_U32BE)) < 0) return ret_value;
|
||||
if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value;
|
||||
if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value;
|
||||
if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value;
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
* Name: h5close_types_c
|
||||
* Purpose: Closes predefined datatype in Fortran
|
||||
* Inputs: types - array with the predefined Native Fortran
|
||||
* type, its element and length must be the
|
||||
* same as the types array defined in the
|
||||
* H5f90global.f90
|
||||
* lentypes - length of the types array, which must be the
|
||||
* same as the length of types array defined
|
||||
* in the H5f90global.f90
|
||||
* floatingtypes - array with the predefined Floating Fortran
|
||||
* type, its element and length must be the
|
||||
* same as the floatingtypes array defined in the
|
||||
* H5f90global.f90
|
||||
* floatinglen - length of the floatingtypes array, which must be the
|
||||
* same as the length of floatingtypes array defined
|
||||
* in the H5f90global.f90
|
||||
* integertypes - array with the predefined Integer Fortran
|
||||
* type, its element and length must be the
|
||||
* same as the integertypes array defined in the
|
||||
* H5f90global.f90
|
||||
* integerlen - length of the floatingtypes array, which must be the
|
||||
* same as the length of floatingtypes array defined
|
||||
* in the H5f90global.f90
|
||||
* Outputs: None
|
||||
* Returns: 0 on success, -1 on failure
|
||||
* Programmer: Elena Pourmal
|
||||
* Tuesday, August 3, 1999
|
||||
* Modifications:
|
||||
*---------------------------------------------------------------------------*/
|
||||
int_f
|
||||
nh5close_types_c( hid_t_f * types, int_f *lentypes,
|
||||
hid_t_f * floatingtypes, int_f* floatinglen,
|
||||
hid_t_f * integertypes, int_f * integerlen )
|
||||
{
|
||||
|
||||
int ret_value = -1;
|
||||
hid_t c_type_id;
|
||||
herr_t err;
|
||||
int i;
|
||||
for (i = 0; i < *lentypes; i++) {
|
||||
c_type_id = types[i];
|
||||
if ( (err = H5Tclose(c_type_id)) < 0) return ret_value;
|
||||
}
|
||||
for (i = 0; i < *floatinglen; i++) {
|
||||
c_type_id = floatingtypes[i];
|
||||
if ( (err = H5Tclose(c_type_id)) < 0) return ret_value;
|
||||
}
|
||||
for (i = 0; i < *integerlen; i++) {
|
||||
c_type_id = integertypes[i];
|
||||
if ( (err = H5Tclose(c_type_id)) < 0) return ret_value;
|
||||
}
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
22
fortran/src/H5f90miscf.f90
Normal file
22
fortran/src/H5f90miscf.f90
Normal file
@ -0,0 +1,22 @@
|
||||
SUBROUTINE h5init_types_f(error)
|
||||
USE H5GLOBAL
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(OUT) :: error
|
||||
INTEGER, EXTERNAL :: h5init_types_c
|
||||
error = h5init_types_c(predef_types, floating_types, integer_types)
|
||||
|
||||
END SUBROUTINE h5init_types_f
|
||||
|
||||
SUBROUTINE h5close_types_f(error)
|
||||
USE H5GLOBAL
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(OUT) :: error
|
||||
INTEGER, EXTERNAL :: h5close_types_c
|
||||
error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, &
|
||||
floating_types, FLOATING_TYPES_LEN, &
|
||||
integer_types, INTEGER_TYPES_LEN )
|
||||
|
||||
END SUBROUTINE h5close_types_f
|
||||
|
872
fortran/src/H5f90proto.h
Normal file
872
fortran/src/H5f90proto.h
Normal file
@ -0,0 +1,872 @@
|
||||
#ifndef _H5f90proto_H
|
||||
#define _H5f90proto_H
|
||||
|
||||
#include "H5Git.h"
|
||||
extern int HD5c2fstr(char *str, int len);
|
||||
extern char * HD5fcstring (_fcd fdesc, int len);
|
||||
extern int HDpackFstring(char *src, char *dest, int len);
|
||||
|
||||
/*
|
||||
* Functions from H5Ff.c
|
||||
*/
|
||||
#ifndef H5Ff90_FNAMES
|
||||
# define H5Ff90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5fcreate_c FNAME(H5FCREATE_C)
|
||||
# define nh5fflush_c FNAME(H5FFLUSH_C)
|
||||
# define nh5fclose_c FNAME(H5FCLOSE_C)
|
||||
# define nh5fopen_c FNAME(H5FOPEN_C)
|
||||
# define nh5fis_hdf5_c FNAME(H5FIS_HDF5_C)
|
||||
# define nh5fmount_c FNAME(H5FMOUNT_C)
|
||||
# define nh5funmount_c FNAME(H5FUNMOUNT_C)
|
||||
# define nh5freopen_c FNAME(H5FREOPEN_C)
|
||||
# define nh5fget_create_plist_c FNAME(H5FGET_CREATE_PLIST_C)
|
||||
# define nh5fget_access_plist_c FNAME(H5FGET_ACCESS_PLIST_C)
|
||||
#else /* !DF_CAPFNAMES */
|
||||
# define nh5fcreate_c FNAME(h5fcreate_c)
|
||||
# define nh5fflush_c FNAME(h5fflush_c)
|
||||
# define nh5fclose_c FNAME(h5fclose_c)
|
||||
# define nh5fopen_c FNAME(h5fopen_c)
|
||||
# define nh5fis_hdf5_c FNAME(h5fis_hdf5_c)
|
||||
# define nh5fmount_c FNAME(h5fmount_c)
|
||||
# define nh5funmount_c FNAME(h5funmount_c)
|
||||
# define nh5freopen_c FNAME(h5freopen_c)
|
||||
# define nh5fget_create_plist_c FNAME(h5fget_create_plist_c)
|
||||
# define nh5fget_access_plist_c FNAME(h5fget_access_plist_c)
|
||||
#endif /* DF_CAPFNAMES */
|
||||
#endif /* H5Ff90_FNAMES */
|
||||
|
||||
extern int_f nh5fcreate_c
|
||||
(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *crt_prp, hid_t_f *acc_prp, hid_t_f *file_id);
|
||||
|
||||
extern int_f nh5fopen_c
|
||||
(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id);
|
||||
|
||||
extern int_f nh5fis_hdf5_c
|
||||
(_fcd name, int_f *namelen, int_f *flag);
|
||||
|
||||
extern int_f nh5fclose_c (hid_t_f *file_id);
|
||||
extern int_f nh5fmount_c
|
||||
(hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp);
|
||||
extern int_f nh5funmount_c
|
||||
(hid_t_f *loc_id, _fcd dsetname, int_f *namelen);
|
||||
extern int_f nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2);
|
||||
extern int_f nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id);
|
||||
extern int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id);
|
||||
/*
|
||||
* Functions from H5Sf.c
|
||||
*/
|
||||
#ifndef H5Sf90_FNAMES
|
||||
# define H5Sf90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5screate_simple_c FNAME(H5SCREATE_SIMPLE_C)
|
||||
# define nh5sclose_c FNAME(H5SCLOSE_C)
|
||||
# define nh5screate_c FNAME(H5SCREATE_C)
|
||||
# define nh5scopy_c FNAME(H5SCOPY_C)
|
||||
# define nh5sget_select_hyper_nblocks_c FNAME(H5SGET_SELECT_HYPER_NBLOCKS_C)
|
||||
# define nh5sget_select_hyper_blocklist_c FNAME(H5SGET_SELECT_HYPER_BLOCKLIST_C)
|
||||
# define nh5sget_select_elem_npoints_c FNAME(H5SGET_SELECT_ELEM_NPOINTS_C)
|
||||
# define nh5sget_select_elem_pointlist_c FNAME(H5SGET_SELECT_ELEM_POINTLIST_C)
|
||||
# define nh5sget_select_bounds_c FNAME(H5SGET_SELECT_BOUNDS_C)
|
||||
# define nh5sselect_all_c FNAME(H5SSELECT_ALL_C)
|
||||
# define nh5sselect_none_c FNAME(H5SSELECT_NONE_C)
|
||||
# define nh5sselect_valid_c FNAME(H5SSELECT_VALID_C)
|
||||
# define nh5sget_simple_extent_npoints_c FNAME(H5SGET_SIMPLE_EXTENT_NPOINTS_C)
|
||||
# define nh5sget_select_npoints_c FNAME(H5SGET_SELECT_NPOINTS_C)
|
||||
# define nh5sget_simple_extent_ndims_c FNAME(H5SGET_SIMPLE_EXTENT_NDIMS_C)
|
||||
# define nh5sget_simple_extent_type_c FNAME(H5SGET_SIMPLE_EXTENT_TYPE_C)
|
||||
# define nh5soffset_simple_c FNAME(H5SOFFSET_SIMPLE_C)
|
||||
# define nh5sset_extent_simple_c FNAME(H5SSET_EXTENT_SIMPLE_C)
|
||||
# define nh5sis_simple_c FNAME(H5SIS_SIMPLE_C)
|
||||
# define nh5sextent_class_c FNAME(H5SEXTENT_CLASS_C)
|
||||
# define nh5sget_simple_extent_dims_c FNAME(H5SGET_SIMPLE_EXTENT_DIMS_C)
|
||||
# define nh5sextent_copy_c FNAME(H5SEXTENT_COPY_C)
|
||||
# define nh5sset_extent_none_c FNAME(H5SSET_EXTENT_NONE_C)
|
||||
# define nh5sselect_hyperslab_c FNAME(H5SSELECT_HYPERSLAB_C)
|
||||
# define nh5sselect_elements_c FNAME(H5SSELECT_ELEMENTS_C)
|
||||
#else /* !DF_CAPFNAMES */
|
||||
# define nh5screate_simple_c FNAME(h5screate_simple_c)
|
||||
# define nh5sclose_c FNAME(h5sclose_c)
|
||||
# define nh5screate_c FNAME(h5screate_c)
|
||||
# define nh5scopy_c FNAME(h5scopy_c)
|
||||
# define nh5sget_select_hyper_nblocks_c FNAME(h5sget_select_hyper_nblocks_c)
|
||||
# define nh5sget_select_hyper_blocklist_c FNAME(h5sget_select_hyper_blocklist_c)
|
||||
# define nh5sget_select_elem_npoints_c FNAME(h5sget_select_elem_npoints_c)
|
||||
# define nh5sget_select_bounds_c FNAME(h5sget_select_bounds_c)
|
||||
# define nh5sget_select_elem_pointlist_c FNAME(h5sget_select_elem_pointlist_c)
|
||||
# define nh5sselect_all_c FNAME(h5sselect_all_c)
|
||||
# define nh5sselect_none_c FNAME(h5sselect_none_c)
|
||||
# define nh5sselect_valid_c FNAME(h5sselect_valid_c)
|
||||
# define nh5sget_simple_extent_npoints_c FNAME(h5sget_simple_extent_npoints_c)
|
||||
# define nh5sget_select_npoints_c FNAME(h5sget_select_npoints_c)
|
||||
# define nh5sget_simple_extent_ndims_c FNAME(h5sget_simple_extent_ndims_c)
|
||||
# define nh5sget_simple_extent_type_c FNAME(h5sget_simple_extent_type_c)
|
||||
# define nh5soffset_simple_c FNAME(h5soffset_simple_c)
|
||||
# define nh5sset_extent_simple_c FNAME(h5sset_extent_simple_c)
|
||||
# define nh5sis_simple_c FNAME(h5sis_simple_c)
|
||||
# define nh5sextent_class_c FNAME(h5sextent_class_c)
|
||||
# define nh5sget_simple_extent_dims_c FNAME(h5sget_simple_extent_dims_c)
|
||||
# define nh5sextent_copy_c FNAME(h5sextent_copy_c)
|
||||
# define nh5sset_extent_none_c FNAME(h5sset_extent_none_c)
|
||||
# define nh5sselect_hyperslab_c FNAME(h5sselect_hyperslab_c)
|
||||
# define nh5sselect_elements_c FNAME(h5sselect_elements_c)
|
||||
#endif /* DF_CAPFNAMES */
|
||||
#endif
|
||||
|
||||
extern int_f nh5screate_simple_c
|
||||
( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id );
|
||||
|
||||
extern int_f nh5sclose_c ( hid_t_f *space_id );
|
||||
|
||||
extern int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id );
|
||||
|
||||
extern int_f nh5scopy_c ( hid_t_f *space_id , hid_t_f *new_space_id);
|
||||
extern int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks);
|
||||
extern int_f nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf);
|
||||
|
||||
extern int_f nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end);
|
||||
|
||||
extern int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points);
|
||||
|
||||
extern int_f nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf);
|
||||
extern int_f nh5sselect_all_c ( hid_t_f *space_id );
|
||||
|
||||
extern int_f nh5sselect_none_c ( hid_t_f *space_id );
|
||||
|
||||
extern int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag );
|
||||
|
||||
extern int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints );
|
||||
|
||||
extern int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints );
|
||||
|
||||
extern int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims );
|
||||
|
||||
extern int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype);
|
||||
|
||||
extern int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset);
|
||||
|
||||
extern int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f * current_size, hsize_t_f *maximum_size);
|
||||
|
||||
extern int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag );
|
||||
|
||||
extern int_f nh5sextent_class_c ( hid_t_f *space_id , int_f *classtype);
|
||||
|
||||
extern int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims);
|
||||
|
||||
extern int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id);
|
||||
|
||||
extern int_f nh5sset_extent_none_c ( hid_t_f *space_id );
|
||||
|
||||
extern int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block);
|
||||
|
||||
extern int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hssize_t_f *coord);
|
||||
|
||||
|
||||
/*
|
||||
* Functions from H5Df.c
|
||||
*/
|
||||
|
||||
#ifndef H5Df90_FNAMES
|
||||
# define H5Df90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5dcreate_c FNAME(H5DCREATE_C)
|
||||
# define nh5dclose_c FNAME(H5DCLOSE_C)
|
||||
# define nh5dopen_c FNAME(H5DOPEN_C)
|
||||
# define nh5dwrite_c FNAME(H5DWRITE_C)
|
||||
# define nh5dwritec_c FNAME(H5DWRITEC_C)
|
||||
# define nh5dread_c FNAME(H5DREAD_C)
|
||||
# define nh5dreadc_c FNAME(H5DREADC_C)
|
||||
# define nh5dget_space_c FNAME(H5DGET_SPACE_C)
|
||||
# define nh5dget_type_c FNAME(H5DGET_TYPE_C)
|
||||
# define nh5dget_create_plist_c FNAME(H5DGET_CREATE_PLIST_C)
|
||||
# define nh5dextend_c FNAME(H5DEXTEND_C)
|
||||
#else /* !DF_CAPFNAMES */
|
||||
# define nh5dcreate_c FNAME(h5dcreate_c)
|
||||
# define nh5dclose_c FNAME(h5dclose_c)
|
||||
# define nh5dopen_c FNAME(h5dopen_c)
|
||||
# define nh5dwrite_c FNAME(h5dwrite_c)
|
||||
# define nh5dwritec_c FNAME(h5dwritec_c)
|
||||
# define nh5dread_c FNAME(h5dread_c)
|
||||
# define nh5dreadc_c FNAME(h5dreadc_c)
|
||||
# define nh5dget_space_c FNAME(h5dget_space_c)
|
||||
# define nh5dget_type_c FNAME(h5dget_type_c)
|
||||
# define nh5dget_create_plist_c FNAME(h5dget_create_plist_c)
|
||||
# define nh5dextend_c FNAME(h5dextend_c)
|
||||
#endif /* DF_CAPFNAMES */
|
||||
#endif
|
||||
|
||||
extern int_f nh5dcreate_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id);
|
||||
|
||||
extern int_f nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id);
|
||||
|
||||
extern int_f nh5dclose_c ( hid_t_f *dset_id );
|
||||
|
||||
extern int_f nh5dwrite_c
|
||||
(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf);
|
||||
|
||||
|
||||
extern int_f nh5dwritec_c
|
||||
(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf);
|
||||
|
||||
extern int_f nh5dread_c
|
||||
(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf);
|
||||
|
||||
|
||||
extern int_f nh5dreadc_c
|
||||
(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf);
|
||||
|
||||
extern int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id);
|
||||
|
||||
extern int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id);
|
||||
|
||||
extern int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id);
|
||||
|
||||
extern int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims);
|
||||
/*
|
||||
* Functions from H5Gf.c
|
||||
*/
|
||||
|
||||
#ifndef H5Gf90_FNAMES
|
||||
# define H5Gf90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5gcreate_c FNAME(H5GCREATE_C)
|
||||
# define nh5gclose_c FNAME(H5GCLOSE_C)
|
||||
# define nh5gopen_c FNAME(H5GOPEN_C)
|
||||
# define nh5gget_obj_info_idx_c FNAME(H5GGET_OBJ_INFO_IDX_C)
|
||||
# define nh5gn_members_c FNAME(H5GN_MEMBERS_C)
|
||||
# define nh5glink_c FNAME(H5GLINK_C)
|
||||
# define nh5gunlink_c FNAME(H5GUNLINK_C)
|
||||
# define nh5gmove_c FNAME(H5GMOVE_C)
|
||||
# define nh5gget_linkval_c FNAME(H5GGET_LINKVAL_C)
|
||||
# define nh5gset_comment_c FNAME(H5GSET_COMMENT_C)
|
||||
# define nh5gget_comment_c FNAME(H5GGET_COMMENT_C)
|
||||
#else /* !DF_CAPFNAMES */
|
||||
# define nh5gcreate_c FNAME(h5gcreate_c)
|
||||
# define nh5gclose_c FNAME(h5gclose_c)
|
||||
# define nh5gopen_c FNAME(h5gopen_c)
|
||||
# define nh5gget_obj_info_idx_c FNAME(h5gget_obj_info_idx_c)
|
||||
# define nh5gn_members_c FNAME(h5gn_members_c)
|
||||
# define nh5glink_c FNAME(h5glink_c)
|
||||
# define nh5gunlink_c FNAME(h5gunlink_c)
|
||||
# define nh5gmove_c FNAME(h5gmove_c)
|
||||
# define nh5gget_linkval_c FNAME(h5gget_linkval_c)
|
||||
# define nh5gset_comment_c FNAME(h5gset_comment_c)
|
||||
# define nh5gget_comment_c FNAME(h5gget_comment_c)
|
||||
#endif /* DF_CAPFNAMES */
|
||||
#endif
|
||||
|
||||
extern int_f nh5gcreate_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id);
|
||||
|
||||
extern int_f nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id);
|
||||
|
||||
extern int_f nh5gclose_c ( hid_t_f *grp_id );
|
||||
|
||||
extern int_f nh5gget_obj_info_idx_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type);
|
||||
|
||||
extern int_f nh5gn_members_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers);
|
||||
|
||||
extern int_f nh5glink_c
|
||||
(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen);
|
||||
|
||||
extern int_f nh5gunlink_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen);
|
||||
|
||||
extern int_f nh5gmove_c
|
||||
(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f *dst_namelen);
|
||||
|
||||
extern int_f nh5gget_linkval_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value );
|
||||
|
||||
extern int_f nh5gset_comment_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen);
|
||||
|
||||
extern int_f nh5gget_comment_c
|
||||
(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment);
|
||||
|
||||
|
||||
/*
|
||||
* Functions from H5Af.c
|
||||
*/
|
||||
|
||||
#ifndef H5Af90_FNAMES
|
||||
# define H5Af90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5acreate_c FNAME(H5ACREATE_C)
|
||||
# define nh5aclose_c FNAME(H5ACLOSE_C)
|
||||
# define nh5aopen_name_c FNAME(H5AOPEN_NAME_C)
|
||||
# define nh5awrite_c FNAME(H5AWRITE_C)
|
||||
# define nh5awritec_c FNAME(H5AWRITEC_C)
|
||||
# define nh5aread_c FNAME(H5AREAD_C)
|
||||
# define nh5areadc_c FNAME(H5AREADC_C)
|
||||
# define nh5aget_name_c FNAME(H5AGET_NAME_C)
|
||||
# define nh5aopen_idx_c FNAME(H5AOPEN_IDX_C)
|
||||
# define nh5aget_space_c FNAME(H5AGET_SPACE_C)
|
||||
# define nh5aget_type_c FNAME(H5AGET_TYPE_C)
|
||||
# define nh5aget_num_attrs_c FNAME(H5AGET_NUM_ATTRS_C)
|
||||
# define nh5adelete_c FNAME(H5ADELETE_C)
|
||||
#else /* !DF_CAPFNAMES */
|
||||
# define nh5acreate_c FNAME(h5acreate_c)
|
||||
# define nh5aclose_c FNAME(h5aclose_c)
|
||||
# define nh5aopen_name_c FNAME(h5aopen_name_c)
|
||||
# define nh5awrite_c FNAME(h5awrite_c)
|
||||
# define nh5awritec_c FNAME(h5awritec_c)
|
||||
# define nh5aread_c FNAME(h5aread_c)
|
||||
# define nh5areadc_c FNAME(h5areadc_c)
|
||||
# define nh5aget_name_c FNAME(h5aget_name_c)
|
||||
# define nh5aopen_idx_c FNAME(h5aopen_idx_c)
|
||||
# define nh5aget_space_c FNAME(h5aget_space_c)
|
||||
# define nh5aget_type_c FNAME(h5aget_type_c)
|
||||
# define nh5aget_num_attrs_c FNAME(h5aget_num_attrs_c)
|
||||
# define nh5adelete_c FNAME(h5adelete_c)
|
||||
#endif /* DF_CAPFNAMES */
|
||||
#endif
|
||||
|
||||
|
||||
extern int_f nh5acreate_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id);
|
||||
|
||||
extern int_f
|
||||
nh5aopen_name_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *attr_id);
|
||||
|
||||
extern int_f nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf);
|
||||
|
||||
extern int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf);
|
||||
|
||||
extern int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf);
|
||||
|
||||
extern int_f nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf);
|
||||
|
||||
extern int_f nh5aclose_c ( hid_t_f *attr_id );
|
||||
|
||||
extern int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, int_f *namelen);
|
||||
|
||||
extern int_f nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id);
|
||||
|
||||
extern int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id);
|
||||
|
||||
extern int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id);
|
||||
|
||||
extern int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num);
|
||||
|
||||
extern int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf);
|
||||
|
||||
/*
|
||||
* Functions form H5Tf.c file
|
||||
*/
|
||||
#ifndef H5Tf90_FNAMES
|
||||
# define H5Tf90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5topen_c FNAME(H5TOPEN_C)
|
||||
# define nh5tcommit_c FNAME(H5TCOMMIT_C)
|
||||
# define nh5tcommitted_c FNAME(H5TCOMMITTED_C)
|
||||
# define nh5tclose_c FNAME(H5TCLOSE_C)
|
||||
# define nh5tcopy_c FNAME(H5TCOPY_C)
|
||||
# define nh5tequal_c FNAME(H5TEQUAL_C)
|
||||
# define nh5tget_class_c FNAME(H5TGET_CLASS_C)
|
||||
# define nh5tget_order_c FNAME(H5TGET_ORDER_C)
|
||||
# define nh5tset_order_c FNAME(H5TSET_ORDER_C)
|
||||
# define nh5tget_size_c FNAME(H5TGET_SIZE_C)
|
||||
# define nh5tset_size_c FNAME(H5TSET_SIZE_C)
|
||||
# define nh5tget_precision_c FNAME(H5TGET_PRECISION_C)
|
||||
# define nh5tset_precision_c FNAME(H5TSET_PRECISION_C)
|
||||
# define nh5tget_offset_c FNAME(H5TGET_OFFSET_C)
|
||||
# define nh5tset_offset_c FNAME(H5TSET_OFFSET_C)
|
||||
# define nh5tget_pad_c FNAME(H5TGET_PAD_C)
|
||||
# define nh5tset_pad_c FNAME(H5TSET_PAD_C)
|
||||
# define nh5tget_sign_c FNAME(H5TGET_SIGN_C)
|
||||
# define nh5tset_sign_c FNAME(H5TSET_SIGN_C)
|
||||
# define nh5tget_fields_c FNAME(H5TGET_FIELDS_C)
|
||||
# define nh5tset_fields_c FNAME(H5TSET_FIELDS_C)
|
||||
# define nh5tget_ebias_c FNAME(H5TGET_EBIAS_C)
|
||||
# define nh5tset_ebias_c FNAME(H5TSET_EBIAS_C)
|
||||
# define nh5tget_norm_c FNAME(H5TGET_NORM_C)
|
||||
# define nh5tset_norm_c FNAME(H5TSET_NORM_C)
|
||||
# define nh5tget_inpad_c FNAME(H5TGET_INPAD_C)
|
||||
# define nh5tset_inpad_c FNAME(H5TSET_INPAD_C)
|
||||
# define nh5tget_cset_c FNAME(H5TGET_CSET_C)
|
||||
# define nh5tset_cset_c FNAME(H5TSET_CSET_C)
|
||||
# define nh5tget_strpad_c FNAME(H5TGET_STRPAD_C)
|
||||
# define nh5tset_strpad_c FNAME(H5TSET_STRPAD_C)
|
||||
# define nh5tget_nmembers_c FNAME(H5TGET_NMEMBERS_C)
|
||||
# define nh5tget_member_name_c FNAME(H5TGET_MEMBER_NAME_C)
|
||||
# define nh5tget_member_offset_c FNAME(H5TGET_MEMBER_OFFSET_C)
|
||||
# define nh5tget_member_dims_c FNAME(H5TGET_MEMBER_DIMS_C)
|
||||
# define nh5tget_member_type_c FNAME(H5TGET_MEMBER_TYPE_C)
|
||||
# define nh5tinsert_c FNAME(H5TINSERT_C)
|
||||
# define nh5tcreate_c FNAME(H5TCREATE_C)
|
||||
# define nh5tpack_c FNAME(H5TPACK_C)
|
||||
# define nh5tinsert_array_c FNAME(H5TINSERT_ARRAY_C)
|
||||
# define nh5tinsert_array_c2 FNAME(H5TINSERT_ARRAY_C2)
|
||||
# define nh5tenum_create_c FNAME(H5TENUM_CREATE_C)
|
||||
# define nh5tenum_insert_c FNAME(H5TENUM_INSERT_C)
|
||||
# define nh5tenum_nameof_c FNAME(H5TENUM_NAMEOF_C)
|
||||
# define nh5tenum_valueof_c FNAME(H5TENUM_VALUEOF_C)
|
||||
# define nh5tget_member_value_c FNAME(H5TGET_MEMBER_VALUE_C)
|
||||
# define nh5set_tag_c FNAME(H5TSET_TAG_C)
|
||||
# define nh5get_tag_c FNAME(H5TGET_TAG_C)
|
||||
#else
|
||||
# define nh5topen_c FNAME(h5topen_c)
|
||||
# define nh5tcommit_c FNAME(h5tcommit_c)
|
||||
# define nh5tcommitted_c FNAME(h5tcommitted_c)
|
||||
# define nh5tclose_c FNAME(h5tclose_c)
|
||||
# define nh5tcopy_c FNAME(h5tcopy_c)
|
||||
# define nh5tequal_c FNAME(h5tequal_c)
|
||||
# define nh5tget_class_c FNAME(h5tget_class_c)
|
||||
# define nh5tget_order_c FNAME(h5tget_order_c)
|
||||
# define nh5tset_order_c FNAME(h5tset_order_c)
|
||||
# define nh5tget_size_c FNAME(h5tget_size_c)
|
||||
# define nh5tset_size_c FNAME(h5tset_size_c)
|
||||
# define nh5tget_precision_c FNAME(h5tget_precision_c)
|
||||
# define nh5tset_precision_c FNAME(h5tset_precision_c)
|
||||
# define nh5tget_offset_c FNAME(h5tget_offset_c)
|
||||
# define nh5tset_offset_c FNAME(h5tset_offset_c)
|
||||
# define nh5tget_pad_c FNAME(h5tget_pad_c)
|
||||
# define nh5tset_pad_c FNAME(h5tset_pad_c)
|
||||
# define nh5tget_sign_c FNAME(h5tget_sign_c)
|
||||
# define nh5tset_sign_c FNAME(h5tset_sign_c)
|
||||
# define nh5tget_fields_c FNAME(h5tget_fields_c)
|
||||
# define nh5tset_fields_c FNAME(h5tset_fields_c)
|
||||
# define nh5tget_ebias_c FNAME(h5tget_ebias_c)
|
||||
# define nh5tset_ebias_c FNAME(h5tset_ebias_c)
|
||||
# define nh5tget_norm_c FNAME(h5tget_norm_c)
|
||||
# define nh5tset_norm_c FNAME(h5tset_norm_c)
|
||||
# define nh5tget_inpad_c FNAME(h5tget_inpad_c)
|
||||
# define nh5tset_inpad_c FNAME(h5tset_inpad_c)
|
||||
# define nh5tget_cset_c FNAME(h5tget_cset_c)
|
||||
# define nh5tset_cset_c FNAME(h5tset_cset_c)
|
||||
# define nh5tget_strpad_c FNAME(h5tget_strpad_c)
|
||||
# define nh5tset_strpad_c FNAME(h5tset_strpad_c)
|
||||
# define nh5tget_nmembers_c FNAME(h5tget_nmembers_c)
|
||||
# define nh5tget_member_name_c FNAME(h5tget_member_name_c)
|
||||
# define nh5tget_member_offset_c FNAME(h5tget_member_offset_c)
|
||||
# define nh5tget_member_dims_c FNAME(h5tget_member_dims_c)
|
||||
# define nh5tget_member_type_c FNAME(h5tget_member_type_c)
|
||||
# define nh5tinsert_c FNAME(h5tinsert_c)
|
||||
# define nh5tcreate_c FNAME(h5tcreate_c)
|
||||
# define nh5tpack_c FNAME(h5tpack_c)
|
||||
# define nh5tinsert_array_c FNAME(h5tinsert_array_c)
|
||||
# define nh5tinsert_array_c2 FNAME(h5tinsert_array_c2)
|
||||
# define nh5tenum_create_c FNAME(h5tenum_create_c)
|
||||
# define nh5tenum_insert_c FNAME(h5tenum_insert_c)
|
||||
# define nh5tenum_nameof_c FNAME(h5tenum_nameof_c)
|
||||
# define nh5tenum_valueof_c FNAME(h5tenum_valueof_c)
|
||||
# define nh5tget_member_value_c FNAME(h5tget_member_value_c)
|
||||
# define nh5tset_tag_c FNAME(h5tset_tag_c)
|
||||
# define nh5tget_tag_c FNAME(h5tget_tag_c)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id);
|
||||
|
||||
extern int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id);
|
||||
|
||||
extern int_f
|
||||
nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id);
|
||||
|
||||
extern int_f nh5tclose_c ( hid_t_f *type_id );
|
||||
|
||||
extern int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag);
|
||||
|
||||
extern int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id);
|
||||
|
||||
extern int_f nh5tget_class_c ( hid_t_f *type_id , int_f *classtype);
|
||||
|
||||
extern int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order);
|
||||
|
||||
extern int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order);
|
||||
|
||||
extern int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size);
|
||||
|
||||
extern int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size);
|
||||
extern int_f nh5tcommitted_c (hid_t_f *type_id);
|
||||
extern int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision);
|
||||
extern int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision);
|
||||
extern int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset);
|
||||
extern int_f nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset);
|
||||
extern int_f nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad);
|
||||
extern int_f nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f * msbpad );
|
||||
extern int_f nh5tget_sign_c ( hid_t_f *type_id , int_f* sign);
|
||||
extern int_f nh5tset_sign_c ( hid_t_f *type_id , int_f *sign);
|
||||
extern int_f nh5tget_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize);
|
||||
extern int_f nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize);
|
||||
extern int_f nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias);
|
||||
|
||||
extern int_f nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias);
|
||||
extern int_f nh5tget_norm_c ( hid_t_f *type_id , int_f *norm);
|
||||
|
||||
extern int_f nh5tset_norm_c ( hid_t_f *type_id , int_f *norm);
|
||||
extern int_f nh5tget_inpad_c ( hid_t_f *type_id, int_f * padtype);
|
||||
extern int_f nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype);
|
||||
extern int_f nh5tget_cset_c ( hid_t_f *type_id, int_f * cset);
|
||||
extern int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset);
|
||||
extern int_f nh5tget_strpad_c ( hid_t_f *type_id, int_f * strpad);
|
||||
extern int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad);
|
||||
extern int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members);
|
||||
extern int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* index, _fcd member_name, int_f *namelen);
|
||||
extern int_f nh5tget_member_dims_c ( hid_t_f *type_id ,int_f* field_idx, int_f * dims, size_t_f * field_dims, int_f * perm );
|
||||
extern int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f* offset);
|
||||
extern int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype);
|
||||
extern int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id);
|
||||
extern int_f nh5tpack_c(hid_t_f * type_id);
|
||||
|
||||
extern int_f nh5tinsert_array_c(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id, int_f* perm );
|
||||
|
||||
extern int_f nh5tinsert_array_c2(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id);
|
||||
|
||||
extern int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id);
|
||||
|
||||
extern int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
|
||||
extern int_f
|
||||
nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen);
|
||||
extern int_f
|
||||
nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
|
||||
extern int_f
|
||||
nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value);
|
||||
extern int_f
|
||||
nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen);
|
||||
extern int_f
|
||||
nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen);
|
||||
|
||||
|
||||
/*
|
||||
* Functions from H5Pf.c
|
||||
*/
|
||||
|
||||
#ifndef H5Pf90_FNAMES
|
||||
# define H5Pf90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5pcreate_c FNAME(H5PCREATE_C)
|
||||
# define nh5pclose_c FNAME(H5PCLOSE_C)
|
||||
# define nh5pcopy_c FNAME(H5PCOPY_C)
|
||||
# define nh5pget_class_c FNAME(H5PGET_CLASS_C)
|
||||
# define nh5pset_deflate_c FNAME(H5PSET_DEFLATE_C)
|
||||
# define nh5pset_preserve_c FNAME(H5PSET_PRESERVE_C)
|
||||
# define nh5pget_preserve_c FNAME(H5PGET_PRESERVE_C)
|
||||
# define nh5pset_chunk_c FNAME(H5PSET_CHUNK_C)
|
||||
# define nh5pget_chunk_c FNAME(H5PGET_CHUNK_C)
|
||||
# define nh5pset_fill_valuec_c FNAME(H5PSET_FILL_VALUEC_C)
|
||||
# define nh5pset_fill_value_c FNAME(H5PSET_FILL_VALUE_C)
|
||||
# define nh5pget_fill_valuec_c FNAME(H5PGET_FILL_VALUEC_C)
|
||||
# define nh5pget_fill_value_c FNAME(H5PGET_FILL_VALUE_C)
|
||||
# define nh5pget_version_c FNAME(H5PGET_VERSION_C)
|
||||
# define nh5pget_userblock_c FNAME(H5PGET_USERBLOCK_C)
|
||||
# define nh5pset_userblock_c FNAME(H5PSET_USERBLOCK_C)
|
||||
# define nh5pset_sizes_c FNAME(H5PSET_SIZES_C)
|
||||
# define nh5pget_sizes_c FNAME(H5PGET_SIZES_C)
|
||||
# define nh5pget_sym_k_c FNAME(H5PGET_SYM_K_C)
|
||||
# define nh5pset_sym_k_c FNAME(H5PSET_SYM_K_C)
|
||||
# define nh5pget_istore_k_c FNAME(H5PGET_ISTORE_K_C)
|
||||
# define nh5pset_istore_k_c FNAME(H5PSET_ISTORE_K_C)
|
||||
# define nh5pget_driver_c FNAME(H5PGET_DRIVER_C)
|
||||
# define nh5pset_stdio_c FNAME(H5PSET_STDIO_C)
|
||||
# define nh5pget_stdio_c FNAME(H5PGET_STDIO_C)
|
||||
# define nh5pset_sec2_c FNAME(H5PSET_SEC2_C)
|
||||
# define nh5pget_sec2_c FNAME(H5PGET_SEC2_C)
|
||||
# define nh5pset_alignment_c FNAME(H5PSET_ALIGNMENT_C)
|
||||
# define nh5pget_alignment_c FNAME(H5PGET_ALIGNMENT_C)
|
||||
# define nh5pset_core_c FNAME(H5PSET_CORE_C)
|
||||
# define nh5pget_core_c FNAME(H5PGET_CORE_C)
|
||||
# define nh5pset_family_c FNAME(H5PSET_FAMILY_C)
|
||||
# define nh5pget_family_c FNAME(H5PGET_FAMILY_C)
|
||||
# define nh5pset_cache_c FNAME(H5PSET_CACHE_C)
|
||||
# define nh5pget_cache_c FNAME(H5PGET_CACHE_C)
|
||||
# define nh5pset_split_c FNAME(H5PSET_SPLIT_C)
|
||||
# define nh5pget_split_c FNAME(H5PGET_SPLIT_C)
|
||||
# define nh5pset_gc_refernces_c FNAME(H5PSET_GC_REFERENCES_C)
|
||||
# define nh5pget_gc_refernces_c FNAME(H5PGET_GC_REFERENCES_C)
|
||||
# define nh5pset_layout_c FNAME(H5PSET_LAYOUT_C)
|
||||
# define nh5pget_layout_c FNAME(H5PGET_LAYOUT_C)
|
||||
# define nh5pset_filter_c FNAME(H5PSET_FILTER_C)
|
||||
# define nh5pget_nfilters_c FNAME(H5PGET_NFILTERS_C)
|
||||
# define nh5pget_filter_c FNAME(H5PGET_FILTER_C)
|
||||
# define nh5pset_external_c FNAME(H5PSET_EXTERNAL_C)
|
||||
# define nh5pget_external_count_c FNAME(H5PGET_EXTERNAL_COUNT_C)
|
||||
# define nh5pget_external_c FNAME(H5PGET_EXTERNAL_C)
|
||||
# define nh5pset_hyper_cache_c FNAME(H5PSET_HYPER_CACHE_C)
|
||||
# define nh5pget_hyper_cache_c FNAME(H5PGET_HYPER_CACHE_C)
|
||||
# define nh5pget_btree_ratios_c FNAME(H5PGET_BTREE_RATIOS_C)
|
||||
# define nh5pset_btree_ratios_c FNAME(H5PSET_BTREE_RATIOS_C)
|
||||
# define nh5pset_mpi_c FNAME(H5PSET_MPI_C)
|
||||
# define nh5pget_mpi_c FNAME(H5PGET_MPI_C)
|
||||
# define nh5pset_xfer_c FNAME(H5PSET_XFER_C)
|
||||
# define nh5pget_xfer_c FNAME(H5PGET_XFER_C)
|
||||
|
||||
#else
|
||||
# define nh5pcreate_c FNAME(h5pcreate_c)
|
||||
# define nh5pclose_c FNAME(h5pclose_c)
|
||||
# define nh5pcopy_c FNAME(h5pcopy_c)
|
||||
# define nh5pget_class_c FNAME(h5pget_class_c)
|
||||
# define nh5pset_deflate_c FNAME(h5pset_deflate_c)
|
||||
# define nh5pset_preserve_c FNAME(h5pset_preserve_c)
|
||||
# define nh5pget_preserve_c FNAME(h5pget_preserve_c)
|
||||
# define nh5pset_chunk_c FNAME(h5pset_chunk_c)
|
||||
# define nh5pget_chunk_c FNAME(h5pget_chunk_c)
|
||||
# define nh5pset_fill_valuec_c FNAME(h5pset_fill_valuec_c)
|
||||
# define nh5pset_fill_value_c FNAME(h5pset_fill_value_c)
|
||||
# define nh5pget_fill_valuec_c FNAME(h5pget_fill_valuec_c)
|
||||
# define nh5pget_fill_value_c FNAME(h5pget_fill_value_c)
|
||||
# define nh5pget_version_c FNAME(h5pget_version_c)
|
||||
# define nh5pget_userblock_c FNAME(h5pget_userblock_c)
|
||||
# define nh5pset_userblock_c FNAME(h5pset_userblock_c)
|
||||
# define nh5pset_sizes_c FNAME(h5pset_sizes_c)
|
||||
# define nh5pget_sizes_c FNAME(h5pget_sizes_c)
|
||||
# define nh5pget_sym_k_c FNAME(h5pget_sym_k_c)
|
||||
# define nh5pset_sym_k_c FNAME(h5pset_sym_k_c)
|
||||
# define nh5pget_istore_k_c FNAME(h5pget_istore_k_c)
|
||||
# define nh5pset_istore_k_c FNAME(h5pset_istore_k_c)
|
||||
# define nh5pget_driver_c FNAME(h5pget_driver_c)
|
||||
# define nh5pset_stdio_c FNAME(h5pset_stdio_c)
|
||||
# define nh5pget_stdio_c FNAME(h5pget_stdio_c)
|
||||
# define nh5pset_sec2_c FNAME(h5pset_sec2_c)
|
||||
# define nh5pget_sec2_c FNAME(h5pget_sec2_c)
|
||||
# define nh5pset_alignment_c FNAME(h5pset_alignment_c)
|
||||
# define nh5pget_alignment_c FNAME(h5pget_alignment_c)
|
||||
# define nh5pset_core_c FNAME(h5pset_core_c)
|
||||
# define nh5pget_core_c FNAME(h5pget_core_c)
|
||||
# define nh5pset_family_c FNAME(h5pset_family_c)
|
||||
# define nh5pget_family_c FNAME(h5pget_family_c)
|
||||
# define nh5pset_cache_c FNAME(h5pset_cache_c)
|
||||
# define nh5pget_cache_c FNAME(h5pget_cache_c)
|
||||
# define nh5pset_split_c FNAME(h5pset_split_c)
|
||||
# define nh5pget_split_c FNAME(h5pget_split_c)
|
||||
# define nh5pset_gc_references_c FNAME(h5pset_gc_references_c)
|
||||
# define nh5pget_gc_references_c FNAME(h5pget_gc_references_c)
|
||||
# define nh5pset_layout_c FNAME(h5pset_layout_c)
|
||||
# define nh5pget_layout_c FNAME(h5pget_layout_c)
|
||||
# define nh5pset_filter_c FNAME(h5pset_filter_c)
|
||||
# define nh5pget_nfilters_c FNAME(h5pget_nfilters_c)
|
||||
# define nh5pget_filter_c FNAME(h5pget_filter_c)
|
||||
# define nh5pset_external_c FNAME(h5pset_external_c)
|
||||
# define nh5pget_external_count_c FNAME(h5pget_external_count_c)
|
||||
# define nh5pget_external_c FNAME(h5pget_external_c)
|
||||
# define nh5pset_hyper_cache_c FNAME(h5pset_hyper_cache_c)
|
||||
# define nh5pget_hyper_cache_c FNAME(h5pget_hyper_cache_c)
|
||||
# define nh5pget_btree_ratios_c FNAME(h5pget_btree_ratios_c)
|
||||
# define nh5pset_btree_ratios_c FNAME(h5pset_btree_ratios_c)
|
||||
# define nh5pset_mpi_c FNAME(h5pset_mpi_c)
|
||||
# define nh5pget_mpi_c FNAME(h5pget_mpi_c)
|
||||
# define nh5pset_xfer_c FNAME(h5pset_xfer_c)
|
||||
# define nh5pget_xfer_c FNAME(h5pget_xfer_c)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int_f nh5pcreate_c ( int_f *classtype, hid_t_f *prp_id );
|
||||
|
||||
extern int_f nh5pclose_c ( hid_t_f *prp_id );
|
||||
|
||||
extern int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id);
|
||||
|
||||
extern int_f nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype);
|
||||
|
||||
extern int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level);
|
||||
|
||||
extern int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims );
|
||||
|
||||
extern int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims );
|
||||
|
||||
extern int_f
|
||||
nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue);
|
||||
|
||||
extern int_f
|
||||
nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue);
|
||||
|
||||
extern int_f
|
||||
nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue);
|
||||
|
||||
extern int_f
|
||||
nh5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue);
|
||||
|
||||
extern int_f
|
||||
nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag);
|
||||
|
||||
extern int_f
|
||||
nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag);
|
||||
extern int_f
|
||||
nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr);
|
||||
extern int_f
|
||||
nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size);
|
||||
extern int_f
|
||||
nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size);
|
||||
extern int_f
|
||||
nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size);
|
||||
extern int_f
|
||||
nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size);
|
||||
extern int_f
|
||||
nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk);
|
||||
extern int_f
|
||||
nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk);
|
||||
extern int_f
|
||||
nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik);
|
||||
extern int_f
|
||||
nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik);
|
||||
extern int_f
|
||||
nh5pget_driver_c (hid_t_f *prp_id, int_f*driver);
|
||||
extern int_f
|
||||
nh5pset_stdio_c (hid_t_f *prp_id);
|
||||
extern int_f
|
||||
nh5pget_stdio_c (hid_t_f *prp_id, int_f* io);
|
||||
extern int_f
|
||||
nh5pset_sec2_c (hid_t_f *prp_id);
|
||||
extern int_f
|
||||
nh5pget_sec2_c (hid_t_f *prp_id, int_f* sec2);
|
||||
extern int_f
|
||||
nh5pset_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment);
|
||||
extern int_f
|
||||
nh5pget_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment);
|
||||
extern int_f
|
||||
nh5pget_core_c (hid_t_f *prp_id, size_t_f* increment);
|
||||
extern int_f
|
||||
nh5pset_core_c (hid_t_f *prp_id, size_t_f* increment);
|
||||
extern int_f
|
||||
nh5pset_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist );
|
||||
extern int_f
|
||||
nh5pget_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist );
|
||||
extern int_f
|
||||
nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, int_f* rdcc_nelmts, size_t_f* rdcc_nbytes, real_f* rdcc_w0);
|
||||
extern int_f
|
||||
nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, int_f* rdcc_nelmts, size_t_f* rdcc_nbytes, real_f* rdcc_w0);
|
||||
extern int_f
|
||||
nh5pget_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist);
|
||||
extern int_f
|
||||
nh5pset_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist);
|
||||
extern int_f
|
||||
nh5pset_gc_references_c(hid_t_f *prp_id, int_f* gc_references);
|
||||
extern int_f
|
||||
nh5pget_gc_references_c(hid_t_f *prp_id, int_f* gc_references);
|
||||
extern int_f
|
||||
nh5pset_layout_c (hid_t_f *prp_id, int_f* layout);
|
||||
extern int_f
|
||||
nh5pget_layout_c (hid_t_f *prp_id, int_f* layout);
|
||||
extern int_f
|
||||
nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values );
|
||||
extern int_f
|
||||
nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters);
|
||||
extern int_f
|
||||
nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id);
|
||||
extern int_f
|
||||
nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes);
|
||||
extern int_f
|
||||
nh5pget_external_count_c (hid_t_f *prp_id, int_f* count);
|
||||
extern int_f
|
||||
nh5pget_external_c(hid_t_f *prp_id,int*idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes);
|
||||
extern int_f
|
||||
nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit);
|
||||
extern int_f
|
||||
nh5pget_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit);
|
||||
extern int_f
|
||||
nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right);
|
||||
extern int_f
|
||||
nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right);
|
||||
extern int_f
|
||||
nh5pget_mpi_c(hid_t_f *prp_id, int_f* comm, int_f* info);
|
||||
extern int_f
|
||||
nh5pset_mpi_c(hid_t_f *prp_id, int_f* comm, int_f* info);
|
||||
extern int_f
|
||||
nh5pget_xfer_c(hid_t_f *prp_id, int_f* data_xfer_mode);
|
||||
extern int_f
|
||||
nh5pset_xfer_c(hid_t_f *prp_id, int_f* data_xfer_mode);
|
||||
|
||||
/*
|
||||
* Functions frome H5Rf.c
|
||||
*/
|
||||
#ifndef H5Rf90_FNAMES
|
||||
# define H5Rf90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5rcreate_object_c FNAME(H5RCREATE_OBJECT_C)
|
||||
# define nh5rcreate_region_c FNAME(H5RCREATE_REGION_C)
|
||||
# define nh5rdereference_region_c FNAME(H5RDEREFERENCE_REGION_C)
|
||||
# define nh5rdereference_object_c FNAME(H5RDEREFERENCE_OBJECT_C)
|
||||
# define nh5rget_region_region_c FNAME(H5RGET_REGION_REGION_C)
|
||||
# define nh5rget_object_type_obj_c FNAME(H5RGET_OBJECT_TYPE_OBJ_C)
|
||||
#else /* !DF_CAPFNAMES */
|
||||
# define nh5rcreate_object_c FNAME(h5rcreate_object_c)
|
||||
# define nh5rcreate_region_c FNAME(h5rcreate_region_c)
|
||||
# define nh5rdereference_region_c FNAME(h5rdereference_region_c)
|
||||
# define nh5rdereference_object_c FNAME(h5rdereference_object_c)
|
||||
# define nh5rget_region_region_c FNAME(h5rget_region_region_c)
|
||||
# define nh5rget_object_type_obj_c FNAME(h5rget_object_type_obj_c)
|
||||
#endif /* DF_CAPFNAMES */
|
||||
#endif /* H5Rf90_FNAMES */
|
||||
|
||||
extern int_f
|
||||
nh5rcreate_object_c (_fcd ref, hid_t_f *loc_id, _fcd name, int_f *namelen);
|
||||
|
||||
|
||||
extern int_f
|
||||
nh5rcreate_region_c (_fcd ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id);
|
||||
|
||||
extern int_f
|
||||
nh5rdereference_region_c (hid_t_f *dset_id, _fcd ref, hid_t_f *obj_id);
|
||||
|
||||
extern int_f
|
||||
nh5rdereference_object_c (hid_t_f *dset_id, _fcd ref, hid_t_f *obj_id);
|
||||
|
||||
extern int_f
|
||||
nh5rget_region_region_c (hid_t_f *dset_id, _fcd ref, hid_t_f *space_id);
|
||||
|
||||
extern int_f
|
||||
nh5rget_object_type_obj_c (hid_t_f *dset_id, _fcd ref, int_f *obj_type);
|
||||
|
||||
/*
|
||||
* Functions from H5If.c
|
||||
*/
|
||||
#ifndef H5If90_FNAMES
|
||||
# define H5If90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5iget_type_c FNAME(H5IGET_TYPE_C)
|
||||
#else
|
||||
# define nh5iget_type_c FNAME(h5iget_type_c)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int_f nh5iget_type_c(hid_t_f *obj_id, int_f *type);
|
||||
|
||||
|
||||
#ifndef H5Ef90_FNAMES
|
||||
# define H5Ef90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5eclear_c FNAME(H5ECLEAR_C)
|
||||
# define nh5eprint_c1 FNAME(H5EPRINT_C1)
|
||||
# define nh5eprint_c2 FNAME(H5EPRINT_C2)
|
||||
# define nh5eget_major_c FNAME(H5EGET_MAJOR_C)
|
||||
# define nh5eget_minor_c FNAME(H5EGET_MINOR_C)
|
||||
# define nh5eset_auto_c FNAME(H5ESET_AUTO_C)
|
||||
#else
|
||||
# define nh5eclear_c FNAME(h5eclear_c)
|
||||
# define nh5eprint_c1 FNAME(h5eprint_c1)
|
||||
# define nh5eprint_c2 FNAME(h5eprint_c2)
|
||||
# define nh5eget_major_c FNAME(h5eget_major_c)
|
||||
# define nh5eget_minor_c FNAME(h5eget_minor_c)
|
||||
# define nh5eset_auto_c FNAME(h5eset_auto_c)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int_f nh5eclear_c();
|
||||
extern int_f nh5eprint_c1(_fcd name, int_f* namelen);
|
||||
extern int_f nh5eprint_c2();
|
||||
extern int_f nh5eget_major_c(int_f* error_no, _fcd name);
|
||||
extern int_f nh5eget_minor_c(int_f* error_no, _fcd name);
|
||||
extern int_f nh5eset_auto_c(int_f* printflag);
|
||||
|
||||
/*
|
||||
* Functions from H5f90misc.c
|
||||
*/
|
||||
#ifndef H5MISCf90_FNAMES
|
||||
# define H5MISCf90_FNAMES
|
||||
#ifdef DF_CAPFNAMES
|
||||
# define nh5init_types_c FNAME(H5INIT_TYPES_C)
|
||||
# define nh5close_types_c FNAME(H5CLOSE_TYPES_C)
|
||||
#else
|
||||
# define nh5init_types_c FNAME(h5init_types_c)
|
||||
# define nh5close_types_c FNAME(h5close_types_c)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int_f nh5init_types_c(hid_t_f *types, hid_t_f * floatingtypes, hid_t_f * integertypes);
|
||||
extern int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f * floatingtypes, int_f * floatinglen, hid_t_f * integertypes, int_f * integerlen);
|
||||
|
||||
#endif /* _H5f90proto_H */
|
141
fortran/src/H5fortran_flags.f90
Normal file
141
fortran/src/H5fortran_flags.f90
Normal file
@ -0,0 +1,141 @@
|
||||
MODULE H5FORTRAN_FLAGS
|
||||
|
||||
!H5F file interface related flags
|
||||
INTEGER, PARAMETER :: H5F_ACC_RDWR_F = 1 , &
|
||||
H5F_ACC_RDONLY_F = 2, &
|
||||
H5F_ACC_TRUNC_F = 3, &
|
||||
H5F_ACC_EXCL_F = 4, &
|
||||
H5F_ACC_DEBUG_F = 5, &
|
||||
H5F_SCOPE_LOCAL_F = 0, &
|
||||
H5F_SCOPE_GLOBAL_F = 1
|
||||
|
||||
!H5G group interface related flags
|
||||
INTEGER, PARAMETER :: H5G_UNKNOWN_F = -1
|
||||
INTEGER, PARAMETER :: H5G_LINK_F = 0
|
||||
INTEGER, PARAMETER :: H5G_GROUP_F =1
|
||||
INTEGER, PARAMETER :: H5G_DATASET_F =2
|
||||
INTEGER, PARAMETER :: H5G_TYPE_F =3
|
||||
|
||||
!H5P Property interface related flags
|
||||
|
||||
INTEGER, PARAMETER :: H5P_FILE_CREATE_F = 0
|
||||
INTEGER, PARAMETER :: H5P_FILE_ACCESS_F = 1
|
||||
INTEGER, PARAMETER :: H5P_DATASET_CREATE_F = 2
|
||||
INTEGER, PARAMETER :: H5P_DATASET_XFER_F = 3
|
||||
INTEGER, PARAMETER :: H5P_MOUNT_F = 4
|
||||
INTEGER, PARAMETER :: H5P_DEFAULT_F = 6
|
||||
|
||||
!H5R Reference interface related flags
|
||||
INTEGER, PARAMETER :: H5R_OBJECT_F = 0
|
||||
INTEGER, PARAMETER :: H5R_DATASET_REGION_F = -2
|
||||
|
||||
!H5S Dataspace interface related flags
|
||||
INTEGER, PARAMETER :: H5S_SCALAR_F = 0
|
||||
INTEGER, PARAMETER :: H5S_SIMPLE_F = 1
|
||||
INTEGER, PARAMETER :: H5S_SELECT_SET_F = 0
|
||||
INTEGER, PARAMETER :: H5S_SELECT_OR_F =1
|
||||
INTEGER, PARAMETER :: H5S_UNLIMITED_F = -1
|
||||
INTEGER, PARAMETER :: H5S_ALL_F = -2
|
||||
!USED IN PROERTY INTERFACE
|
||||
INTEGER, PARAMETER :: H5D_COMPACT_F = 0
|
||||
|
||||
INTEGER, PARAMETER :: H5D_CONTIGUOUS_F = 1
|
||||
INTEGER, PARAMETER :: H5D_CHUNKED_F = 2
|
||||
INTEGER, PARAMETER :: H5D_XFER_INDEPENDENT_F = 0
|
||||
INTEGER, PARAMETER :: H5D_XFER_COLLECTIVE_F = 1
|
||||
INTEGER, PARAMETER :: H5D_XFER_DFLT_F = 2
|
||||
|
||||
!H5T Data type interface related flags
|
||||
INTEGER, PARAMETER :: H5T_NO_CLASS_F = -1
|
||||
INTEGER, PARAMETER :: H5T_INTEGER_F = 0
|
||||
INTEGER, PARAMETER :: H5T_FLOAT_F = 1
|
||||
INTEGER, PARAMETER :: H5T_TIME_F = 2
|
||||
INTEGER, PARAMETER :: H5T_STRING_F = 3
|
||||
INTEGER, PARAMETER :: H5T_BITFIELD_F = 4
|
||||
INTEGER, PARAMETER :: H5T_OPAQUE_F = 5
|
||||
INTEGER, PARAMETER :: H5T_COMPOUND_F = 6
|
||||
INTEGER, PARAMETER :: H5T_REFERENCE_F = 7
|
||||
INTEGER, PARAMETER :: H5T_ENUM_F = 8
|
||||
INTEGER, PARAMETER :: H5T_ORDER_LE_F = 0
|
||||
INTEGER, PARAMETER :: H5T_ORDER_BE_F = 1
|
||||
INTEGER, PARAMETER :: H5T_ORDER_VAX_F = 2
|
||||
|
||||
INTEGER, PARAMETER :: H5T_PAD_ZERO_F = 0
|
||||
INTEGER, PARAMETER :: H5T_PAD_ONE_F = 1
|
||||
INTEGER, PARAMETER :: H5T_PAD_BACKGROUND_F = 2
|
||||
INTEGER, PARAMETER :: H5T_PAD_ERROR_F = -1
|
||||
INTEGER, PARAMETER :: H5T_PAD_NPAD_F = 3
|
||||
|
||||
!Unsigned integer type
|
||||
INTEGER, PARAMETER :: H5T_SGN_NONE_F = 0
|
||||
!Two's complement signed integer type
|
||||
INTEGER, PARAMETER :: H5T_SGN_2_F = 1
|
||||
|
||||
INTEGER, PARAMETER :: H5T_SGN_ERROR_F = -1
|
||||
!MSB of mantissa is not stored, always 1
|
||||
INTEGER, PARAMETER :: H5T_NORM_IMPLIED_F = 0
|
||||
!MSB of mantissa is always 1
|
||||
INTEGER, PARAMETER :: H5T_NORM_MSBSET_F = 1
|
||||
!Mantissa is not normalized
|
||||
INTEGER, PARAMETER :: H5T_NORM_NONE_F = 2
|
||||
!Character set is US ASCII
|
||||
INTEGER, PARAMETER :: H5T_CSET_ASCII_F = 0
|
||||
!Pad with zeros (as C does)
|
||||
INTEGER, PARAMETER :: H5T_STR_NULL_F = 0
|
||||
!Pad with spaces (as FORTRAN does)
|
||||
INTEGER, PARAMETER :: H5T_STR_SPACE_F = 1
|
||||
|
||||
!H5P interface related fortran flags:
|
||||
!identifier of the low-level file driver.
|
||||
INTEGER, PARAMETER :: H5F_LOW_STDIO_F = 0
|
||||
INTEGER, PARAMETER :: H5F_LOW_SEC2_F = 1
|
||||
INTEGER, PARAMETER :: H5F_LOW_MPIO_F = 2
|
||||
INTEGER, PARAMETER :: H5F_LOW_CORE_F = 3
|
||||
INTEGER, PARAMETER :: H5F_LOW_SPLIT_F = 4
|
||||
INTEGER, PARAMETER :: H5F_LOW_FAMILY_F = 5
|
||||
|
||||
!H5I interface related fortran flags:
|
||||
INTEGER, PARAMETER :: H5I_FILE_F = 1
|
||||
INTEGER, PARAMETER :: H5I_GROUP_F = 2
|
||||
INTEGER, PARAMETER :: H5I_DATATYPE_F = 3
|
||||
INTEGER, PARAMETER :: H5I_DATASPACE_F = 4
|
||||
INTEGER, PARAMETER :: H5I_DATASET_F = 5
|
||||
INTEGER, PARAMETER :: H5I_ATTR_F = 6
|
||||
INTEGER, PARAMETER :: H5I_BADID_F = -1
|
||||
|
||||
!H5E interface related fortran flags:
|
||||
!Turn on automatic printing of errors
|
||||
INTEGER, PARAMETER :: PRINTON = 1
|
||||
|
||||
!Turn off automatic printing of errors
|
||||
INTEGER, PARAMETER :: PRINTOFF = 0
|
||||
|
||||
!Error flags same as H5E_major_t
|
||||
|
||||
INTEGER, PARAMETER :: H5E_NONE_MAJOR_F = 0 !special zero, no error
|
||||
INTEGER, PARAMETER :: H5E_ARGS_F = 1 !invalid arguments to routine
|
||||
INTEGER, PARAMETER :: H5E_RESOURCE_F = 2 !resource unavailable
|
||||
INTEGER, PARAMETER :: H5E_INTERNAL_F = 3 !Internal error (too specific to
|
||||
!document in detail)
|
||||
INTEGER, PARAMETER :: H5E_FILE_F = 4 !file Accessability
|
||||
INTEGER, PARAMETER :: H5E_IO_F = 5 !Low-level I/O
|
||||
INTEGER, PARAMETER :: H5E_FUNC_F = 6 !function Entry/Exit
|
||||
INTEGER, PARAMETER :: H5E_ATOM_F = 7 !object Atom
|
||||
INTEGER, PARAMETER :: H5E_CACHE_F = 8 !object Cache
|
||||
INTEGER, PARAMETER :: H5E_BTREE_F = 9 !B-Tree Node
|
||||
INTEGER, PARAMETER :: H5E_SYM_F = 10 !symbol Table
|
||||
INTEGER, PARAMETER :: H5E_HEAP_F = 11 !Heap
|
||||
INTEGER, PARAMETER :: H5E_OHDR_F = 12 !object Header
|
||||
INTEGER, PARAMETER :: H5E_DATATYPE_F = 13 !Datatype
|
||||
INTEGER, PARAMETER :: H5E_DATASPACE_F = 14 ! Dataspace
|
||||
INTEGER, PARAMETER :: H5E_DATASET_F = 15 !Dataset
|
||||
INTEGER, PARAMETER :: H5E_STORAGE_F = 16 !data storage
|
||||
INTEGER, PARAMETER :: H5E_PLIST_F = 17 !Property lists
|
||||
INTEGER, PARAMETER :: H5E_ATTR_F = 18 !Attribute
|
||||
INTEGER, PARAMETER :: H5E_PLINE_F = 19 !Data filters
|
||||
INTEGER, PARAMETER :: H5E_EFL_F = 20 !External file list
|
||||
INTEGER, PARAMETER :: H5E_RAGGED_F = 21 !Ragged arrays
|
||||
INTEGER, PARAMETER :: H5E_REFERENCE_F = 22 !References
|
||||
|
||||
|
||||
END MODULE H5FORTRAN_FLAGS
|
29
fortran/src/H5fortran_types.f90.in
Normal file
29
fortran/src/H5fortran_types.f90.in
Normal file
@ -0,0 +1,29 @@
|
||||
!
|
||||
! This file contains HDF5 Fortran90 type definitions
|
||||
!
|
||||
MODULE H5FORTRAN_TYPES
|
||||
!
|
||||
! HDF5 integers
|
||||
!
|
||||
! Each of the arguments of SELECTED_INT_KIND function should be
|
||||
! determined by configure.
|
||||
! R_LARGE is the number of digits for the biggest integer supported.
|
||||
! R_INTEGER is the number of digits in INTEGER
|
||||
! For example:
|
||||
! On 64 bit machine ( DEC ALPHA) R_LARGE = 18 and R_INTEGER = 9
|
||||
! On 32 bit machines ( Sparc Solaris ) R_LARGE = 9 and R_INTEGER = 9
|
||||
!
|
||||
INTEGER, PARAMETER :: R_LARGE = @R_LARGE@
|
||||
INTEGER, PARAMETER :: R_INTEGER = @R_INTEGER@
|
||||
INTEGER, PARAMETER :: HSIZE_T = @HSIZE_T@
|
||||
INTEGER, PARAMETER :: HSSIZE_T = @HSSIZE_T@
|
||||
INTEGER, PARAMETER :: HID_T = @HID_T@
|
||||
INTEGER, PARAMETER :: SIZE_T = @SIZE_T@
|
||||
|
||||
!
|
||||
! Some HDF5 FORTARN90 default values ( here for now 8/5/99 EIP )
|
||||
!
|
||||
|
||||
INTEGER(SIZE_T), PARAMETER :: OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@
|
||||
|
||||
END MODULE H5FORTRAN_TYPES
|
14
fortran/src/HDF5.f90
Normal file
14
fortran/src/HDF5.f90
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
MODULE HDF5
|
||||
USE H5GLOBAL
|
||||
USE H5F
|
||||
USE H5G
|
||||
USE H5E
|
||||
USE H5I
|
||||
USE H5S
|
||||
USE H5D
|
||||
USE H5A
|
||||
USE H5T
|
||||
USE H5P
|
||||
USE H5R
|
||||
END MODULE HDF5
|
15
fortran/src/HDF5_parallel.f90
Normal file
15
fortran/src/HDF5_parallel.f90
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
MODULE HDF5
|
||||
USE H5GLOBAL
|
||||
USE H5F
|
||||
USE H5E
|
||||
USE H5G
|
||||
USE H5I
|
||||
USE H5S
|
||||
USE H5D
|
||||
USE H5A
|
||||
USE H5T
|
||||
USE H5P
|
||||
USE H5P_parallel
|
||||
USE H5R
|
||||
END MODULE HDF5
|
38
fortran/src/Makefile.in
Normal file
38
fortran/src/Makefile.in
Normal file
@ -0,0 +1,38 @@
|
||||
##
|
||||
## HDF5 Forgran Library Makefile(.in)
|
||||
##
|
||||
## Copyright (C) 2000 National Center for Supercomputing Applications.
|
||||
## All rights reserved.
|
||||
##
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=..
|
||||
srcdir=@srcdir@
|
||||
@COMMENCE@
|
||||
|
||||
hdf5_dir=$(top_srcdir)/../src
|
||||
|
||||
TRACE=perl $(top_srcdir)/bin/trace
|
||||
|
||||
## Add `-I.' to the C preprocessor flags.
|
||||
CPPFLAGS=-I. -I$(hdf5_dir) @CPPFLAGS@
|
||||
|
||||
## This is our main target
|
||||
LIB=libhdf5_fortran.la
|
||||
CLEAN=H5fortran_types.f90
|
||||
|
||||
## Source and object files for the library
|
||||
CPARALLEL=${PARALLEL:yes="H5Pf_parallel.c"}
|
||||
CLIB_SRC=H5f90kit.c H5f90misc.c H5Git.c H5Rf.c H5Ff.c H5Sf.c H5Df.c H5Gf.c \
|
||||
H5Af.c H5Tf.c H5Pf.c H5If.c H5Ef.c ${CPARALLEL:no=}
|
||||
|
||||
FPARALLEL=${PARALLEL:yes="H5Pff_parallel.f90 HDF5_parallel.f90"}
|
||||
FLIB_SRC=H5fortran_types.f90 H5fortran_flags.f90 H5f90global.f90 H5f90miscf.f90 \
|
||||
H5Rff.f90 H5Fff.f90 H5Sff.f90 H5Dff.f90 H5Gff.f90 H5Aff.f90 H5Tff.f90 \
|
||||
H5Pff.f90 H5Iff.f90 H5Eff.f90 HDF5.f90 ${FPARALLEL:no=}
|
||||
|
||||
LIB_SRC=$(CLIB_SRC) $(FLIB_SRC)
|
||||
LIB_OBJ=$(CLIB_SRC:.c=.lo) $(FLIB_SRC:.f90=.lo)
|
||||
|
||||
ARFLAGS=rc
|
||||
|
||||
@CONCLUDE@
|
240
fortran/src/README
Normal file
240
fortran/src/README
Normal file
@ -0,0 +1,240 @@
|
||||
|
||||
README for the FORTRAN90 Prototype APIs to HDF5
|
||||
|
||||
|
||||
This distribution contains the HDF5 FORTRAN90 APIs source code (prototype)
|
||||
based on the HDF5 1.2.2 release (ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current),
|
||||
tests and examples.
|
||||
|
||||
This prototype supports a selected subset of the HDF5 Library functionality.
|
||||
A complete list of the Fortran subroutines can be found in the HDF5
|
||||
Reference Manual provided with this release.
|
||||
Check the online documentation at http://hdf.ncsa.uiuc.edu/HDF5/doc (select
|
||||
the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column) or
|
||||
H5_F90.R1.2.2.RefMan.tar at ftp://hdf.ncsa.uiuc.edu/HDF5/fortran .
|
||||
|
||||
Changes since last release (October 1999)
|
||||
=========================================
|
||||
* Support for Linux
|
||||
* Support for parallel features (tested on O2K platform only)
|
||||
* Most of the functions from the H5R, H5P, H5T, H5E and H5I interfaces were
|
||||
implemented. See Reference Manual for complete list. The new functions
|
||||
include support for object and dataset region references, and for
|
||||
compound datatypes.
|
||||
* This prototype supports more predefined types. See list below in
|
||||
the "About the Fortran APIs" section.
|
||||
* This prototype supports T3E and T3E with mpt 1.3. One has to modify
|
||||
H5Dff.f90, H5Aff.f90, H5Pff.f90 to comment lines with the module procedures for
|
||||
double precision datatypes. See source code.
|
||||
|
||||
Supported platforms
|
||||
===================
|
||||
The FORTRAN90 APIs provided here are known to work with the
|
||||
following platforms and compilers:
|
||||
|
||||
* SunOS 5.6 with WorkshopCompilers 4.2 Fortran 90 1.2
|
||||
* SunOS 5.7 with WorkshopCompilers 5.0 Fortran 90 2.0
|
||||
* OSF1 V4.0 with Digital Fortran 90 4.1
|
||||
* IRIX64 6.5 (64 option only) with MIPSpro Compilers: Version 7.3.1m
|
||||
mpt.1.4
|
||||
* Linux RedHat 6.1, Kernel 2.2.12 with PGF90
|
||||
* T3E with Cray Fortran: Version 3.4.0.0
|
||||
with mpt 1.3
|
||||
|
||||
Compilation
|
||||
===========
|
||||
|
||||
1. Install HDF5 Release 1.2.2 on your system
|
||||
(ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current). If you are using a
|
||||
binary distribution provided by the HDF group, make sure that a GZIP
|
||||
library is installed on your system. If you do not have a GZIP library,
|
||||
you may copy it from the HDF FTP server.
|
||||
|
||||
2. In the src directory copy H5fortran_types.f90_<system> to
|
||||
H5fortran_types.f90, where <system> is one of the following:
|
||||
|
||||
solaris
|
||||
digunix
|
||||
irix
|
||||
linux
|
||||
|
||||
Example: On Digital Unix systems use the following command
|
||||
cp H5fortran_types.f90_digunix H5fortran_types.f90
|
||||
|
||||
3. Edit Makefile_<system >in the src/, test/ and examples/ directories
|
||||
to specify the locations of the HDF5 C Library, the GZIP Library, and the
|
||||
corresponding include files on your system.
|
||||
|
||||
4. In the src directory, run make to create the HDF5 FORTRAN90 library
|
||||
hdf5_fortran.a
|
||||
make -f Makefile_<system>
|
||||
|
||||
Example: On Solaris run
|
||||
make -f Makefile_solaris
|
||||
|
||||
The Fortran library hdf5_fortran.a will be created.
|
||||
|
||||
5. In the test directory, build tests by running
|
||||
make -f Makefile_<system>
|
||||
This command will build fortranlib_test, fflush1 and fflush2 executables.
|
||||
Run those executables to make sure that the library works on your system.
|
||||
|
||||
6. In the examples directory, run
|
||||
make -f Makefile_<system>
|
||||
to build the following examples:
|
||||
|
||||
fileexample - creates an HDF5 file
|
||||
dsetexample - creates an empty dataset of integers
|
||||
rwdsetexample - writes and reads to the dataset created by dsetexample
|
||||
groupexample - creates a group in the file
|
||||
grpsexample - creates groups using absolute and relative names
|
||||
grpdsetexample - creates datasets in the groups
|
||||
hyperslabexample - writes and reads a hyperslab
|
||||
selectele - writes element selections
|
||||
grpit - iterates through the members of the group
|
||||
attrexample - creates and writes a dataset attribute
|
||||
compound - creates, writes and reads one dim array of structures
|
||||
mountexample - shows how to use mounting files to access a dataset
|
||||
refobjexample - creates and stores references to the objects
|
||||
refregexample - creates and stores references to the dataset regions
|
||||
|
||||
The script run_example.sh runs the examples in the appropriate order.
|
||||
|
||||
Use the HDF5 utility, h5dump, to see the content of the created HDF5 files.
|
||||
|
||||
7. Install the HDF5 Reference Manual (in HTML format). The manual
|
||||
can be found in the Unix tar file H5_F90.R1.2.2.RefMan.tar
|
||||
on the ftp server and is served over the Web from
|
||||
http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select the "HDF5 Fortran90 Docs"
|
||||
link at the bottom of the left-hand column).
|
||||
|
||||
|
||||
8. Send bug reports and comments to hdfhelp@ncsa.uiuc.edu
|
||||
|
||||
User's Guide Notes
|
||||
+++++++++++++++++++
|
||||
|
||||
About the source code organization
|
||||
==================================
|
||||
|
||||
The Fortran APIs are organized in modules parallel to the HDF5 Interfaces.
|
||||
Each module is in a separate file with the name H5*ff.f. Corresponding C
|
||||
stubs are in the H5*f.c files. For example, the Fortran File APIs are in
|
||||
the file H5Fff.f and the corresponding C stubs are in the file H5Ff.c.
|
||||
|
||||
Each module contains Fortran definitions of the constants, interfaces to
|
||||
the subroutines if needed, and the subroutines themselves.
|
||||
|
||||
Users must use constant names in their programs instead of the numerical
|
||||
values, as the numerical values are subject to change without notice.
|
||||
|
||||
About the Fortran APIs
|
||||
=======================
|
||||
|
||||
* The Fortran APIs come in the form of Fortran subroutines.
|
||||
|
||||
* Each Fortran subroutine name is derived from the corresponding C function
|
||||
name by adding "_f" to the name. For example, the name of the C function
|
||||
to create an HDF5 file is H5Fcreate; the corresponding Fortran subroutine
|
||||
is h5fcreate_f.
|
||||
|
||||
* A description of each Fortran subroutine and its parameters can be found
|
||||
following the description of the corresponding C function in the
|
||||
Reference Manual provided with this release. The manual can be found in
|
||||
the Unix tar file H5_F90.R1.2.2.tar in this directory and
|
||||
is served over the Web from http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select
|
||||
the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column).
|
||||
|
||||
* The parameter list for each Fortran subroutine has two more parameters
|
||||
than the corresponding C function. These additional parameters hold
|
||||
the return value and an error code. The order of the Fortran subroutine
|
||||
parameters may differ from the order of the C function parameters.
|
||||
The Fortran subroutine parameters are listed in the following order:
|
||||
-- required input parameters,
|
||||
-- output parameters, including return value and error code, and
|
||||
-- optional input parameters.
|
||||
For example, the C function to create a dataset has the following
|
||||
prototype:
|
||||
|
||||
hid_t H5Dcreate(hid_it loc_id, char *name, hid_t type_id,
|
||||
hid_t space_id, hid_t creation_prp);
|
||||
|
||||
The corresponding Fortran subroutine has the following form:
|
||||
|
||||
SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id,
|
||||
hdferr, creation_prp)
|
||||
|
||||
The first four parameters of the Fortran subroutine correspond to the
|
||||
C function parameters. The fifth parameter dset_id is an output
|
||||
parameter and contains a valid dataset identifier if the value of the
|
||||
sixth output parameter hdferr indicates successful completion.
|
||||
(Error code descriptions are provided with the subroutine descriptions
|
||||
in the Reference Manual.) The seventh input parameter creation_prp
|
||||
is optional, and may be omitted when the default creation property
|
||||
list is used.
|
||||
|
||||
* Parameters to the Fortran subroutines have one of the following
|
||||
predefined datatypes (see the file H5fortran_types.f90 for KIND
|
||||
definitions):
|
||||
|
||||
INTEGER(HID_T) compares with hid_t type in HDF5 C APIs
|
||||
INTEGER(HSIZE_T) compares with hsize_t in HDF5 C APIs
|
||||
INTEGER(HSSIZE_T) compares with hssize_t in HDF5 C APIs
|
||||
INTEGER(SIZE_T) compares with the C size_t type
|
||||
These integer types usually correspond to 4 or 8 byte integers,
|
||||
depending on the FORTRAN90 compiler and corresponding HDF5
|
||||
C library definitions.
|
||||
|
||||
The H5R module defines two types:
|
||||
TYPE(HOBJ_REF_T_F) compares to the hobj_ref_t in HDF5 C API
|
||||
TYPE(HDSET_REG_REF_T_F) compares to hdset_reg_ref_t in HDF5 C API
|
||||
These types are represented by character arrays now.
|
||||
The internal representation can be changed in the future.
|
||||
|
||||
* Each Fortran application must call the h5init_types subroutine to
|
||||
initialize the Fortran predefined datatypes before calling the HDF5 Fortran
|
||||
subroutines. The application must call the h5close_types subroutine
|
||||
after all calls to the HDF5 Fortran Library.
|
||||
|
||||
* The following predefined types are implemented in this prototype:
|
||||
|
||||
H5T_NATIVE_INTEGER
|
||||
H5T_NATIVE_REAL
|
||||
H5T_NATIVE_DOUBLE
|
||||
H5T_NATIVE_CHARACTER
|
||||
H5T_STD_REF_OBJ
|
||||
H5T_STD_REF_DSETREG
|
||||
H5T_IEEE_F32BE
|
||||
H5T_IEEE_F32LE
|
||||
H5T_IEEE_F64BE
|
||||
H5T_IEEE_F64LE
|
||||
H5T_STD_I8BE
|
||||
H5T_STD_I8LE
|
||||
H5T_STD_I16BE
|
||||
H5T_STD_I16LE
|
||||
H5T_STD_I32BE
|
||||
H5T_STD_I32LE
|
||||
H5T_STD_I64BE
|
||||
H5T_STD_I64LE
|
||||
H5T_STD_U8BE
|
||||
H5T_STD_U8LE
|
||||
H5T_STD_U16BE
|
||||
H5T_STD_U16LE
|
||||
H5T_STD_U32BE
|
||||
H5T_STD_U32LE
|
||||
H5T_STD_U64BE
|
||||
H5T_STD_U64LE
|
||||
|
||||
|
||||
* When a C application reads data stored from a Fortran program, the data
|
||||
will appear to be transposed due to the difference in the C - Fortran
|
||||
storage order. For example, if Fortran writes a 4x6 two-dimensional dataset
|
||||
to the file, a C program will read it as a 6x4 two-dimensional dataset into
|
||||
memory. The HDF5 C utilities h5dump and h5ls display transposed data, if
|
||||
data is written from a Fortran program.
|
||||
|
||||
* Fortran indices are 1 based.
|
||||
|
||||
* Compound datatype datasets can be written or read by atomic fields only.
|
||||
|
||||
Not all of the APIs provided with this prototype have been fully tested.
|
0
fortran/test/Dependencies
Normal file
0
fortran/test/Dependencies
Normal file
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user