diff --git a/src/Fortran/Makefile.am b/src/Fortran/Makefile.am index c26383d..c1fdc07 100644 --- a/src/Fortran/Makefile.am +++ b/src/Fortran/Makefile.am @@ -7,13 +7,15 @@ F90_FILES = \ $(top_srcdir)/src/include/H5_const.f90 \ $(top_srcdir)/src/include/H5_file.f90 \ $(top_srcdir)/src/include/H5_model.f90 \ - $(top_srcdir)/src/include/H5_attribs.f90 \ + $(top_srcdir)/src/include/H5_file_attribs.f90 \ + $(top_srcdir)/src/include/H5_step_attribs.f90 \ $(top_srcdir)/src/include/H5_debug.f90 \ $(top_srcdir)/src/include/H5_error.f90 \ $(top_srcdir)/src/include/H5Part_model.f90 \ $(top_srcdir)/src/include/H5Part_io.f90 \ $(top_srcdir)/src/include/H5Block_model.f90 \ $(top_srcdir)/src/include/H5Block_attribs.f90 \ + $(top_srcdir)/src/include/H5Block_attribs.f90 \ $(top_srcdir)/src/include/H5Block_io.f90 EXTRA_HEADERS = diff --git a/src/include/H5Block.h b/src/include/H5Block.h deleted file mode 100644 index 182a946..0000000 --- a/src/include/H5Block.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (c) 2006-2016, The Regents of the University of California, - through Lawrence Berkeley National Laboratory (subject to receipt of any - required approvals from the U.S. Dept. of Energy) and the Paul Scherrer - Institut (Switzerland). All rights reserved. - - License: see file COPYING in top level of source distribution. -*/ - -#ifndef __H5BLOCK_H -#define __H5BLOCK_H - -/** - \ingroup h5block_model - - \note - Different field sizes are allowed in the same time-step. - - \note - The same layout can be used, if the size of the field matches the - size of the layout. If the size of the layout doesn't match the - size of the field, an error will be indicated. - - \note In write mode views might be reduced to make them - non-overlaping, i.e. ghost-zones are eliminated. This may shrink - views in an unexpected way. - - \todo - check whether layout is reasonable -*/ - -#include "H5Block_attribs.h" -#include "H5Block_model.h" -#include "H5Block_io.h" - -#endif - diff --git a/src/include/H5_file_attribs.f90 b/src/include/H5_file_attribs.f90 new file mode 100644 index 0000000..f29e1e9 --- /dev/null +++ b/src/include/H5_file_attribs.f90 @@ -0,0 +1,194 @@ +! +! Copyright (c) 2006-2016, The Regents of the University of California, +! through Lawrence Berkeley National Laboratory (subject to receipt of any +! required approvals from the U.S. Dept. of Energy) and the Paul Scherrer +! Institut (Switzerland). All rights reserved.! +! +! License: see file COPYING in top level of source distribution. +! + INTERFACE + !> + !! \addtogroup \h5_file_attribs_f + !! @{ + ! __ _ _ _ _ _ _ _ + ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ + ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| + ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ + ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ + ! __ _ _ _ ___ _ __ _ _ + ! / _` | | | |/ _ \ '__| | | | + ! | (_| | |_| | __/ | | |_| | + ! \__, |\__,_|\___|_| \__, | + ! |_| |___/ + + !> + !! See \ref H5GetNumFileAttribs + !! \return number of attributes or error code + + INTEGER*8 FUNCTION h5_getnfileattribs (filehandle) + INTEGER*8, INTENT(IN) :: filehandle !< file handle + END FUNCTION h5_getnfileattribs + + !> + !! See \ref H5GetFileAttribInfo + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_getfileattribinfo (fhandle, idx, name, type, nelem) + INTEGER*8,INTENT(IN) :: fhandle !< file handle + INTEGER*8,INTENT(IN) :: idx !< index of attribute being queried + CHARACTER(LEN=*), INTENT(OUT):: name !< name of attribute + INTEGER*8,INTENT(OUT):: type !< type of attribute + INTEGER*8,INTENT(OUT):: nelem !< number of elements in the attrib array + END FUNCTION h5_getfileattribinfo + + !> + !! See \ref H5GetFileAttribInfoByName + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_getfileattribinfo_by_name (fhandle, name, type, nelem) + INTEGER*8,INTENT(IN) :: fhandle !< file handle + CHARACTER(LEN=*), INTENT(IN):: name !< name of attribute + INTEGER*8,INTENT(OUT):: type !< type of attribute + INTEGER*8,INTENT(OUT):: nelem !< number of elements in the attrib array + END FUNCTION h5_getfileattribinfo_by_name + + ! __ _ _ _ _ _ _ _ + ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ + ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| + ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ + ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ + ! _ __ _ _ + ! (_) / /__ ___| |_ _ __(_)_ __ __ _ + ! | | / / _ \ / __| __| '__| | '_ \ / _` | + ! | |/ / (_) | \__ \ |_| | | | | | | (_| | + ! |_/_/ \___/ |___/\__|_| |_|_| |_|\__, | + ! |___/ + + !> + !! See \ref H5WriteFileAttribString + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_writefileattrib_string (filehandle, attrib_name, attrib_value) + INTEGER*8, INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write + CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data to be written + END FUNCTION h5_writefileattrib_string + + !> + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_readfileattrib_string (filehandle, attrib_name, attrib_value) + INTEGER*8, INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of the attribute to read + CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data will be read into this array + END FUNCTION h5_readfileattrib_string + + ! __ _ _ _ _ _ _ _ + ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ + ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| + ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ + ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ + ! _ __ _ + ! (_) / /__ _ __ ___ __ _| | + ! | | / / _ \ | '__/ _ \/ _` | | + ! | |/ / (_) | | | | __/ (_| | | + ! |_/_/ \___/ |_| \___|\__,_|_| + + !> + !! See \ref H5WriteFileAttribFloat64 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_writefileattrib_r8 (filehandle, attrib_name, attrib_value, attrib_nelem) + INTEGER*8,INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read + REAL*8, INTENT(IN):: attrib_value(*) !< attribute data to be written + INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array + END FUNCTION h5_writefileattrib_r8 + + !> + !! See \ref H5ReadFileAttribFloat64 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_readfileattrib_r8 (filehandle, attrib_name, attrib_value) + INTEGER*8,INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read + REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array + END FUNCTION h5_readfileattrib_r8 + + !> + !! See \ref H5WriteFileAttribFloat32 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_writefileattrib_r4 (filehandle, attrib_name, attrib_value, attrib_nelem) + INTEGER*8,INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read + REAL*4, INTENT(IN):: attrib_value(*) !< attribute data to be written + INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array + END FUNCTION h5_writefileattrib_r4 + + !> + !! See \ref H5ReadFileAttribFloat32 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_readfileattrib_r4 ( filehandle, attrib_name, attrib_value ) + INTEGER*8,INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read + REAL*4, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array + END FUNCTION h5_readfileattrib_r4 + + ! __ _ _ _ _ _ _ _ + ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ + ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| + ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ + ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ + ! _ __ _ _ + ! (_) / /__ (_)_ __ | |_ ___ __ _ ___ _ __ + ! | | / / _ \ | | '_ \| __/ _ \/ _` |/ _ \ '__| + ! | |/ / (_) | | | | | | || __/ (_| | __/ | + ! |_/_/ \___/ |_|_| |_|\__\___|\__, |\___|_| + ! |___/ + + !> + !! See \ref H5WriteFileAttribInt64 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_writefileattrib_i8 (filehandle, attrib_name, attrib_value, attrib_nelem) + INTEGER*8, INTENT(IN) :: filehandle !< file handle + CHARACTER (LEN=*), INTENT(IN) :: attrib_name!< name of attribute to write + INTEGER*8, INTENT(IN):: attrib_value(*) !< attribute data to be written + INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array + END FUNCTION h5_writefileattrib_i8 + + !> + !! See \ref H5ReadFileAttribInt64 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_readfileattrib_i8 (filehandle, attrib_name, attrib_value) + INTEGER*8,INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read + INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array + END FUNCTION h5_readfileattrib_i8 + + !> + !! See \ref H5WriteFileAttribInt32 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_writefileattrib_i4 (filehandle, attrib_name, attrib_value, attrib_nelem) + INTEGER*8,INTENT(IN) :: filehandle !< file handle + CHARACTER (LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write + INTEGER*4, INTENT(IN) :: attrib_value(*) !< attribute data to be written + INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array + END FUNCTION h5_writefileattrib_i4 + + !> + !! See \ref H5ReadFileAttribInt32 + !! \return 0 on success or error code + + INTEGER*8 FUNCTION h5_readfileattrib_i4 (filehandle, attrib_name, attrib_value) + INTEGER*8,INTENT(IN) :: filehandle !< file handle + CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read + INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array + END FUNCTION h5_readfileattrib_i4 + + !> @} + END INTERFACE diff --git a/src/include/H5_attribs.f90 b/src/include/H5_step_attribs.f90 similarity index 51% rename from src/include/H5_attribs.f90 rename to src/include/H5_step_attribs.f90 index 69a7bed..d1d68be 100644 --- a/src/include/H5_attribs.f90 +++ b/src/include/H5_step_attribs.f90 @@ -7,190 +7,6 @@ ! License: see file COPYING in top level of source distribution. ! INTERFACE - !> - !! \addtogroup \h5_file_attribs_f - !! @{ - ! __ _ _ _ _ _ _ _ - ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ - ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| - ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ - ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ - ! __ _ _ _ ___ _ __ _ _ - ! / _` | | | |/ _ \ '__| | | | - ! | (_| | |_| | __/ | | |_| | - ! \__, |\__,_|\___|_| \__, | - ! |_| |___/ - - !> - !! See \ref H5GetNumFileAttribs - !! \return number of attributes or error code - - INTEGER*8 FUNCTION h5_getnfileattribs (filehandle) - INTEGER*8, INTENT(IN) :: filehandle !< file handle - END FUNCTION h5_getnfileattribs - - !> - !! See \ref H5GetFileAttribInfo - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_getfileattribinfo (fhandle, idx, name, type, nelem) - INTEGER*8,INTENT(IN) :: fhandle !< file handle - INTEGER*8,INTENT(IN) :: idx !< index of attribute being queried - CHARACTER(LEN=*), INTENT(OUT):: name !< name of attribute - INTEGER*8,INTENT(OUT):: type !< type of attribute - INTEGER*8,INTENT(OUT):: nelem !< number of elements in the attrib array - END FUNCTION h5_getfileattribinfo - - !> - !! See \ref H5GetFileAttribInfoByName - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_getfileattribinfo_by_name (fhandle, name, type, nelem) - INTEGER*8,INTENT(IN) :: fhandle !< file handle - CHARACTER(LEN=*), INTENT(IN):: name !< name of attribute - INTEGER*8,INTENT(OUT):: type !< type of attribute - INTEGER*8,INTENT(OUT):: nelem !< number of elements in the attrib array - END FUNCTION h5_getfileattribinfo_by_name - - ! __ _ _ _ _ _ _ _ - ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ - ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| - ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ - ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ - ! _ __ _ _ - ! (_) / /__ ___| |_ _ __(_)_ __ __ _ - ! | | / / _ \ / __| __| '__| | '_ \ / _` | - ! | |/ / (_) | \__ \ |_| | | | | | | (_| | - ! |_/_/ \___/ |___/\__|_| |_|_| |_|\__, | - ! |___/ - - !> - !! See \ref H5WriteFileAttribString - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_writefileattrib_string (filehandle, attrib_name, attrib_value) - INTEGER*8, INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write - CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data to be written - END FUNCTION h5_writefileattrib_string - - !> - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_readfileattrib_string (filehandle, attrib_name, attrib_value) - INTEGER*8, INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of the attribute to read - CHARACTER(LEN=*), INTENT(IN) :: attrib_value!< attribute data will be read into this array - END FUNCTION h5_readfileattrib_string - - ! __ _ _ _ _ _ _ _ - ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ - ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| - ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ - ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ - ! _ __ _ - ! (_) / /__ _ __ ___ __ _| | - ! | | / / _ \ | '__/ _ \/ _` | | - ! | |/ / (_) | | | | __/ (_| | | - ! |_/_/ \___/ |_| \___|\__,_|_| - - !> - !! See \ref H5WriteFileAttribFloat64 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_writefileattrib_r8 (filehandle, attrib_name, attrib_value, attrib_nelem) - INTEGER*8,INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read - REAL*8, INTENT(IN):: attrib_value(*) !< attribute data to be written - INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array - END FUNCTION h5_writefileattrib_r8 - - !> - !! See \ref H5ReadFileAttribFloat64 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_readfileattrib_r8 (filehandle, attrib_name, attrib_value) - INTEGER*8,INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read - REAL*8, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array - END FUNCTION h5_readfileattrib_r8 - - !> - !! See \ref H5WriteFileAttribFloat32 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_writefileattrib_r4 (filehandle, attrib_name, attrib_value, attrib_nelem) - INTEGER*8,INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read - REAL*4, INTENT(IN):: attrib_value(*) !< attribute data to be written - INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array - END FUNCTION h5_writefileattrib_r4 - - !> - !! See \ref H5ReadFileAttribFloat32 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_readfileattrib_r4 ( filehandle, attrib_name, attrib_value ) - INTEGER*8,INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read - REAL*4, INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array - END FUNCTION h5_readfileattrib_r4 - - ! __ _ _ _ _ _ _ _ - ! / _(_) | ___ __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ - ! | |_| | |/ _ \ / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| - ! | _| | | __/ | (_| | |_| |_| | | | |_) | |_| | || __/\__ \ - ! |_| |_|_|\___| \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ - ! _ __ _ _ - ! (_) / /__ (_)_ __ | |_ ___ __ _ ___ _ __ - ! | | / / _ \ | | '_ \| __/ _ \/ _` |/ _ \ '__| - ! | |/ / (_) | | | | | | || __/ (_| | __/ | - ! |_/_/ \___/ |_|_| |_|\__\___|\__, |\___|_| - ! |___/ - - !> - !! See \ref H5WriteFileAttribInt64 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_writefileattrib_i8 (filehandle, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< file handle - CHARACTER (LEN=*), INTENT(IN) :: attrib_name!< name of attribute to write - INTEGER*8, INTENT(IN):: attrib_value(*) !< attribute data to be written - INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array - END FUNCTION h5_writefileattrib_i8 - - !> - !! See \ref H5ReadFileAttribInt64 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_readfileattrib_i8 (filehandle, attrib_name, attrib_value) - INTEGER*8,INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read - INTEGER*8,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array - END FUNCTION h5_readfileattrib_i8 - - !> - !! See \ref H5WriteFileAttribInt32 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_writefileattrib_i4 (filehandle, attrib_name, attrib_value, attrib_nelem) - INTEGER*8,INTENT(IN) :: filehandle !< file handle - CHARACTER (LEN=*), INTENT(IN) :: attrib_name !< name of attribute to write - INTEGER*4, INTENT(IN) :: attrib_value(*) !< attribute data to be written - INTEGER*8, INTENT(IN) :: attrib_nelem !< number of elements in data array - END FUNCTION h5_writefileattrib_i4 - - !> - !! See \ref H5ReadFileAttribInt32 - !! \return 0 on success or error code - - INTEGER*8 FUNCTION h5_readfileattrib_i4 (filehandle, attrib_name, attrib_value) - INTEGER*8,INTENT(IN) :: filehandle !< file handle - CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< name of attribute to read - INTEGER*4,INTENT(OUT):: attrib_value(*) !< attribute data will be read into this array - END FUNCTION h5_readfileattrib_i4 - - !> @} !> \addtogroup \h5_step_attribs_f !! @{ diff --git a/src/include/H5hut.f90 b/src/include/H5hut.f90 index d0137b6..0749f5b 100644 --- a/src/include/H5hut.f90 +++ b/src/include/H5hut.f90 @@ -11,7 +11,8 @@ MODULE H5hut include 'H5_file.f90' include 'H5_model.f90' - include 'H5_attribs.f90' + include 'H5_file_attribs.f90' + include 'H5_step_attribs.f90' include 'H5_log.f90' include 'H5_debug.f90' include 'H5_error.f90'