diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-09-13 03:37:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 03:37:01 (GMT) |
commit | 9348ba920eecacd35adde6c4573cc85c6033dc65 (patch) | |
tree | 9e23eb5142b4bbed1385c88d7409cd3c5586e5d3 /hl/fortran | |
parent | 033b7ace5aff35cced7561921789176fb3831cdb (diff) | |
download | hdf5-9348ba920eecacd35adde6c4573cc85c6033dc65.zip hdf5-9348ba920eecacd35adde6c4573cc85c6033dc65.tar.gz hdf5-9348ba920eecacd35adde6c4573cc85c6033dc65.tar.bz2 |
1 12 doxygen merge from 1.10 (#2094)
Diffstat (limited to 'hl/fortran')
-rw-r--r-- | hl/fortran/src/H5DSff.F90 | 395 | ||||
-rw-r--r-- | hl/fortran/src/H5IMff.F90 | 698 | ||||
-rw-r--r-- | hl/fortran/src/H5LTff.F90 | 1535 | ||||
-rw-r--r-- | hl/fortran/src/H5TBff.F90 | 911 |
4 files changed, 1736 insertions, 1803 deletions
diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index bbd9918..dcc6ed0 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -1,3 +1,14 @@ +!> @defgroup FH5DS Fortran High Level Dimension Scales (H5DS) Interface +!! +!! @see H5DS, C-HL API +!! +!! @see @ref H5DS_UG, User Guide +!! + +!> @ingroup FH5DS +!! +!! @brief This module contains Fortran interfaces for H5DS +! ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -10,12 +21,19 @@ ! If you do not have access to either file, you may request a copy from * ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| ! -! -! This file contains FORTRAN90 interfaces for H5DS functions +! If you add a new function here then you MUST add the function name to the +! Windows dll file 'hdf5_hl_fortrandll.def.in' in the hl/fortran/src directory. +! This is needed for Windows based operating systems. ! -MODULE h5ds +MODULE H5DS USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_FLOAT, C_DOUBLE, C_LOC, C_CHAR USE h5fortran_types @@ -23,32 +41,24 @@ MODULE h5ds CONTAINS -!------------------------------------------------------------------------- -! Function: H5DSset_scale_f -! -! Purpose: Convert dataset dsid to a dimension scale, with optional name, dimname. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Convert dataset \p dsid to a dimension scale, with optional name, \p dimname. +!! +!! \param dsid The dataset to be made a Dimemsion Scale. +!! \param errcode \fortran_error +!! \param dimname The dimension name +!! SUBROUTINE H5DSset_scale_f( dsid, errcode, dimname) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale - CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name - INTEGER :: errcode ! Error code + INTEGER(hid_t), INTENT(in) :: dsid + CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname + INTEGER :: errcode - INTEGER(SIZE_T) :: dimname_len ! length of dimname (if present) + INTEGER(SIZE_T) :: dimname_len ! length of dimname (if present) INTERFACE INTEGER FUNCTION H5DSset_scale_c(dsid, dimname, dimname_len) & @@ -56,8 +66,8 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dimname ! The dimension name + INTEGER(hid_t), INTENT(in) :: dsid + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dimname INTEGER(SIZE_T), INTENT(in) :: dimname_len END FUNCTION H5DSset_scale_c END INTERFACE @@ -71,31 +81,24 @@ CONTAINS END SUBROUTINE H5DSset_scale_f -!------------------------------------------------------------------------- -! Function: H5DSattach_scale_f -! -! Purpose: Attach dimension scale dsid to dimension idx of dataset did. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Attach dimension scale dsid to dimension \p idx of dataset \p did. +!! +!! \param did The dataset. +!! \param dsid The scale to be attached. +!! \param idx The dimension of \p did that \p dsid is associated with. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSattach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached - INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: did + INTEGER(hid_t), INTENT(in) :: dsid + INTEGER , INTENT(in) :: idx + INTEGER :: errcode INTEGER :: c_idx INTERFACE @@ -103,9 +106,9 @@ CONTAINS BIND(C,NAME='h5dsattach_scale_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached - INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. + INTEGER(hid_t), INTENT(in) :: did + INTEGER(hid_t), INTENT(in) :: dsid + INTEGER , INTENT(in) :: idx END FUNCTION H5DSattach_scale_c END INTERFACE @@ -115,31 +118,25 @@ CONTAINS END SUBROUTINE H5DSattach_scale_f -!------------------------------------------------------------------------- -! Function: H5DSdetach_scale_f -! -! Purpose: Detach dimension scale dsid from the dimension idx of Dataset did. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- +!> +!! \ingroup FH5DS +!! +!! \brief Detach dimension scale dsid from the dimension idx of dataset \p did. +!! +!! \param did The dataset. +!! \param dsid The scale to be detached. +!! \param idx The dimension of \p did to detach. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached - INTEGER , INTENT(in) :: idx ! the dimension of did to detach - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: did + INTEGER(hid_t), INTENT(in) :: dsid + INTEGER , INTENT(in) :: idx + INTEGER :: errcode INTEGER :: c_idx INTERFACE @@ -147,9 +144,9 @@ CONTAINS BIND(C,NAME='h5dsdetach_scale_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached - INTEGER , INTENT(in) :: idx ! the dimension of did to detach + INTEGER(hid_t), INTENT(in) :: did + INTEGER(hid_t), INTENT(in) :: dsid + INTEGER , INTENT(in) :: idx END FUNCTION H5DSdetach_scale_c END INTERFACE @@ -159,34 +156,26 @@ CONTAINS END SUBROUTINE H5DSdetach_scale_f - -!------------------------------------------------------------------------- -! Function: H5DSis_attached_f -! -! Purpose: Report if dimension scale dsid is currently attached to dimension idx of dataset did. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Report if dimension scale dsid is currently attached to dimension idx of dataset did. +!! +!! \param did The dataset. +!! \param dsid The scale to be attached. +!! \param idx The dimension of \p did that \p dsid is associated with. +!! \param is_attached If dimension scale \p dsid is currently attached to dimension \p idx of dataset \p did. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached - INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with - LOGICAL , INTENT(out) :: is_attached ! logical: dimension scale dsid is currently attached to - ! dimension idx of dataset did - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: did + INTEGER(hid_t), INTENT(in) :: dsid + INTEGER , INTENT(in) :: idx + LOGICAL , INTENT(out) :: is_attached + INTEGER :: errcode INTEGER :: c_is_attached INTEGER :: c_idx @@ -195,10 +184,10 @@ CONTAINS BIND(C,NAME='h5dsis_attached_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached - INTEGER , INTENT(in) :: idx ! the dimension of did to detach - INTEGER , INTENT(out) :: c_is_attached ! dimension scale dsid is currently attached to + INTEGER(hid_t), INTENT(in) :: did + INTEGER(hid_t), INTENT(in) :: dsid + INTEGER , INTENT(in) :: idx + INTEGER , INTENT(out) :: c_is_attached END FUNCTION H5DSis_attached_c END INTERFACE @@ -218,32 +207,22 @@ CONTAINS ! ! H5DSiterate_scales: Implement in F2003 ! - -!------------------------------------------------------------------------- -! Function: H5DSis_scale_f -! -! Purpose: Determines whether dset is a Dimension Scale. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Determines whether \p did is a Dimension Scale. +!! +!! \param did The data set to query. +!! \param is_scale If is a Dimension Scale. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the data set to query - LOGICAL , INTENT(out) :: is_scale ! logical: - ! .TRUE. if did is a Dimension Scale - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: did + LOGICAL , INTENT(out) :: is_scale + INTEGER , INTENT(out) :: errcode INTEGER :: c_is_scale INTERFACE @@ -267,30 +246,23 @@ CONTAINS END SUBROUTINE H5DSis_scale_f -!------------------------------------------------------------------------- -! Function: H5DSset_label_f -! -! Purpose: Set label for the dimension idx of did to the value label -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Set label for the dimension \p idx of \p did to the value \p label. +!! +!! \param did The data set. +!! \param idx The dimension. +!! \param label The label. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSset_label_f( did, idx, label, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! The dataset - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(LEN=*), INTENT(in) :: label ! The label + INTEGER(hid_t), INTENT(in) :: did + INTEGER , INTENT(in) :: idx + CHARACTER(LEN=*), INTENT(in) :: label INTEGER :: errcode ! Error code INTEGER(SIZE_T) :: label_len ! Length of label @@ -302,10 +274,10 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! The dataset - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: label ! The label - INTEGER(SIZE_T), INTENT(in) :: label_len ! Length of label + INTEGER(hid_t), INTENT(in) :: did + INTEGER , INTENT(in) :: idx + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: label + INTEGER(SIZE_T), INTENT(in) :: label_len END FUNCTION H5DSset_label_c END INTERFACE @@ -316,32 +288,26 @@ CONTAINS END SUBROUTINE H5DSset_label_f -!------------------------------------------------------------------------- -! Function: H5DSget_label_f -! -! Purpose: Read the label for dimension idx of did into buffer label. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Read the \p label for dimension \p idx of \p did into buffer \p label. +!! +!! \param did The dataset. +!! \param idx The dimension. +!! \param label The label. +!! \param size The length of the \p label buffer. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSget_label_f( did, idx, label, size, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! The dataget - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(LEN=*), INTENT(INOUT) :: label ! The label - INTEGER(size_t) , INTENT(INOUT) :: size ! The length of the label buffer - INTEGER :: errcode ! Error code + INTEGER(hid_t), INTENT(in) :: did + INTEGER , INTENT(in) :: idx + CHARACTER(LEN=*), INTENT(INOUT) :: label + INTEGER(size_t) , INTENT(INOUT) :: size + INTEGER :: errcode INTEGER :: c_idx INTERFACE @@ -350,10 +316,10 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! The dataget - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(INOUT) :: label ! The label - INTEGER(SIZE_T), INTENT(inout) :: size ! Length of label + INTEGER(hid_t), INTENT(in) :: did + INTEGER , INTENT(in) :: idx + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(INOUT) :: label + INTEGER(SIZE_T), INTENT(inout) :: size END FUNCTION H5DSget_label_c END INTERFACE @@ -363,32 +329,24 @@ CONTAINS END SUBROUTINE H5DSget_label_f - -!------------------------------------------------------------------------- -! Function: H5DSget_scale_name_f -! -! Purpose: Read the name of scale did into buffer name. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Read the name of scale \p did into buffer name. +!! +!! \param did Dimension scale identifier. +!! \param name Buffer to contain the returned name. +!! \param size Size in bytes, of the name buffer. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSget_scale_name_f(did, name, size, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! The dataget - CHARACTER(LEN=*), INTENT(INOUT) :: name ! The name - INTEGER(size_t) , INTENT(INOUT) :: size ! The length of the name buffer - INTEGER :: errcode ! Error code + INTEGER(hid_t), INTENT(in) :: did + CHARACTER(LEN=*), INTENT(INOUT) :: name + INTEGER(size_t) , INTENT(INOUT) :: size + INTEGER :: errcode INTERFACE INTEGER FUNCTION H5DSget_scale_name_c(did, name, size) & @@ -396,9 +354,9 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! The dataget - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(INOUT) :: name ! The name - INTEGER(SIZE_T), INTENT(inout) :: size ! Length of name + INTEGER(hid_t), INTENT(in) :: did + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(INOUT) :: name + INTEGER(SIZE_T), INTENT(inout) :: size END FUNCTION H5DSget_scale_name_c END INTERFACE @@ -406,30 +364,23 @@ CONTAINS END SUBROUTINE H5DSget_scale_name_f -!------------------------------------------------------------------------- -! Function: H5DSget_num_scales_f -! -! Purpose: Determines how many Dimension Scales are attached to dimension idx of did -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5DS +!! +!! \brief Determines how many Dimension Scales are attached to dimension idx of \p did. +!! +!! \param did The dataset to query. +!! \param idx The dimension of \p did to query. +!! \param num_scales Number of Dimension Scales associated with \p did. +!! \param errcode \fortran_error +!! SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER , INTENT(in) :: idx ! the dimension of did to query - INTEGER , INTENT(INOUT) :: num_scales ! the number of Dimension Scales associated with did - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: did + INTEGER , INTENT(in) :: idx + INTEGER , INTENT(INOUT) :: num_scales + INTEGER :: errcode INTEGER :: c_idx INTERFACE @@ -437,9 +388,9 @@ CONTAINS BIND(C,NAME='h5dsget_num_scales_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER , INTENT(in) :: idx ! the dimension of did to query - INTEGER , INTENT(INOUT) :: num_scales ! the number of Dimension Scales associated with did + INTEGER(hid_t), INTENT(in) :: did + INTEGER , INTENT(in) :: idx + INTEGER , INTENT(INOUT) :: num_scales END FUNCTION H5DSget_num_scales_c END INTERFACE diff --git a/hl/fortran/src/H5IMff.F90 b/hl/fortran/src/H5IMff.F90 index 9709032..967c35d 100644 --- a/hl/fortran/src/H5IMff.F90 +++ b/hl/fortran/src/H5IMff.F90 @@ -1,3 +1,14 @@ +!> @defgroup FH5IM Fortran High Level Images (H5IM) Interface +!! +!! @see H5IM, C-HL API +!! +!! @see @ref H5IM_UG, User Guide +!! + +!> @ingroup FH5IM +!! +!! @brief This module contains Fortran interfaces for H5IM. +! ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -10,12 +21,6 @@ ! If you do not have access to either file, you may request a copy from * ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN interfaces for H5IM functions -! -! NOTES -! ! _____ __ __ _____ ____ _____ _______ _ _ _______ ! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| ! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** @@ -28,29 +33,24 @@ ! This is needed for Windows based operating systems. ! -MODULE h5im +MODULE H5IM USE, INTRINSIC :: ISO_C_BINDING USE h5fortran_types USE hdf5 CONTAINS -!------------------------------------------------------------------------- -! Function: h5immake_image_8bit_f -! -! Purpose: Creates and writes an image an 8 bit image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5IM +!! +!! \brief Creates and writes an image an 8 bit image +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to create. +!! \param width The width of the image. +!! \param height The height of the image +!! \param buf Buffer with data to be written to the dataset +!! \param errcode \fortran_error +!! SUBROUTINE h5immake_image_8bit_f(loc_id,& dset_name,& width,& @@ -60,13 +60,13 @@ CONTAINS IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: width ! width of image - INTEGER(hsize_t), INTENT(in) :: height ! height of image - INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: width + INTEGER(hsize_t), INTENT(in) :: height + INTEGER, INTENT(in), DIMENSION(*) :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5immake_image_8bit_c(loc_id,namelen,dset_name,width,height,buf) & @@ -74,12 +74,12 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: width ! width of image - INTEGER(hsize_t), INTENT(in) :: height ! height of image - INTEGER , INTENT(in), DIMENSION(*) :: buf ! buffer + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: width + INTEGER(hsize_t), INTENT(in) :: height + INTEGER , INTENT(in), DIMENSION(*) :: buf END FUNCTION h5immake_image_8bit_c END INTERFACE @@ -88,22 +88,16 @@ CONTAINS END SUBROUTINE h5immake_image_8bit_f -!------------------------------------------------------------------------- -! Function: h5imread_image_f -! -! Purpose: Reads image data from disk. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- +!> +!! \ingroup FH5IM +!! +!! \brief Reads image data from disk. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to create. +!! \param buf Buffer with data to store the image. +!! \param errcode \fortran_error +!! SUBROUTINE h5imread_image_f(loc_id,& dset_name,& buf,& @@ -111,11 +105,11 @@ CONTAINS IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER, INTENT(inout), DIMENSION(*) :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5imread_image_c(loc_id,namelen,dset_name,buf) & @@ -123,10 +117,10 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER, INTENT(inout), DIMENSION(*) :: buf END FUNCTION h5imread_image_c END INTERFACE @@ -135,42 +129,32 @@ CONTAINS END SUBROUTINE h5imread_image_f -!------------------------------------------------------------------------- -! Function: h5immake_image_24bit_f -! -! Purpose: Creates and writes an image a 24 bit image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE h5immake_image_24bit_f(loc_id,& - dset_name,& - width,& - height,& - il,& - buf,& - errcode ) +!> +!! \ingroup FH5IM +!! +!! \brief Creates and writes an image a 24 bit image. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to create. +!! \param width The width of the image. +!! \param height The height of the image. +!! \param il String defining the interlace mode. +!! \param buf Buffer with data to be written to the dataset. +!! \param errcode \fortran_error +!! + SUBROUTINE h5immake_image_24bit_f(loc_id, dset_name, width, height, il, buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: width ! width of image - INTEGER(hsize_t), INTENT(in) :: height ! height of image - CHARACTER(len=*), INTENT(in) :: il ! interlace - INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: width + INTEGER(hsize_t), INTENT(in) :: height + CHARACTER(len=*), INTENT(in) :: il + INTEGER, INTENT(in), DIMENSION(*) :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length INTERFACE INTEGER FUNCTION h5immake_image_24bit_c(loc_id,namelen,dset_name,ILEN,il,width,height,buf) & @@ -178,14 +162,14 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: width ! width of image - INTEGER(hsize_t), INTENT(in) :: height ! height of image - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: il ! interlace - INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: width + INTEGER(hsize_t), INTENT(in) :: height + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: il + INTEGER, INTENT(in), DIMENSION(*) :: buf + INTEGER(size_t) :: namelen + INTEGER(size_t) :: ILEN END FUNCTION h5immake_image_24bit_c END INTERFACE @@ -196,24 +180,20 @@ CONTAINS END SUBROUTINE h5immake_image_24bit_f -!------------------------------------------------------------------------- -! Function: h5imget_image_info_f -! -! Purpose: Gets information about an image dataset (dimensions, interlace mode -! and number of associated palettes). -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5IM +!! +!! \brief Gets information about an image dataset (dimensions, interlace mode and number of associated palettes). +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset. +!! \param width The width of the image. +!! \param height The height of the image. +!! \param planes The number of color planes of the image. +!! \param interlace The interlace mode of the image. +!! \param npals The number of palettes associated to the image. +!! \param errcode \fortran_error +!! SUBROUTINE h5imget_image_info_f(loc_id,& dset_name,& width,& @@ -225,16 +205,16 @@ CONTAINS IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout) :: width ! width of image - INTEGER(hsize_t), INTENT(inout) :: height ! height of image - INTEGER(hsize_t), INTENT(inout) :: planes ! color planes - INTEGER(hsize_t), INTENT(inout) :: npals ! palettes - CHARACTER(len=*), INTENT(inout) :: interlace ! interlace - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(inout) :: width + INTEGER(hsize_t), INTENT(inout) :: height + INTEGER(hsize_t), INTENT(inout) :: planes + INTEGER(hsize_t), INTENT(inout) :: npals + CHARACTER(len=*), INTENT(inout) :: interlace + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length INTERFACE INTEGER FUNCTION h5imget_image_info_c(loc_id,namelen,dset_name,width,height,planes,npals,ILEN,interlace) & @@ -242,15 +222,15 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout) :: width ! width of image - INTEGER(hsize_t), INTENT(inout) :: height ! height of image - INTEGER(hsize_t), INTENT(inout) :: planes ! color planes - INTEGER(hsize_t), INTENT(inout) :: npals ! palettes - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: interlace ! interlace - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(inout) :: width + INTEGER(hsize_t), INTENT(inout) :: height + INTEGER(hsize_t), INTENT(inout) :: planes + INTEGER(hsize_t), INTENT(inout) :: npals + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: interlace + INTEGER(size_t) :: namelen + INTEGER(size_t) :: ILEN END FUNCTION h5imget_image_info_c END INTERFACE @@ -260,32 +240,22 @@ CONTAINS END SUBROUTINE h5imget_image_info_f -!------------------------------------------------------------------------- -! Function: h5imis_image_f -! -! Purpose: Inquires if a dataset is an image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - INTEGER FUNCTION h5imis_image_f(loc_id,& - dset_name) +!> +!! \ingroup FH5IM +!! +!! \brief Inquires if a dataset is an image. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset. +!! + INTEGER FUNCTION h5imis_image_f(loc_id, dset_name) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5imis_image_c(loc_id,namelen,dset_name) & @@ -293,9 +263,9 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name END FUNCTION h5imis_image_c END INTERFACE @@ -305,339 +275,285 @@ CONTAINS END FUNCTION h5imis_image_f - -!------------------------------------------------------------------------- -! Function: h5immake_palette_f -! -! Purpose: Creates and writes a palette -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5IM +!! +!! \brief Creates and writes a palette +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param pal_name The name of the palette. +!! \param pal_dims An array of the size of the palette dimensions. +!! \param pal_data Buffer with data to be written to the dataset. +!! \param errcode \fortran_error +!! SUBROUTINE h5immake_palette_f(loc_id,& - dset_name,& + pal_name,& pal_dims,& - buf,& + pal_data,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in), DIMENSION(*) :: pal_dims ! dimensions - INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: pal_name + INTEGER(hsize_t), INTENT(in), DIMENSION(*) :: pal_dims + INTEGER, INTENT(in), DIMENSION(*) :: pal_data + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE - INTEGER FUNCTION h5immake_palette_c(loc_id,namelen,dset_name,pal_dims,buf) & + INTEGER FUNCTION h5immake_palette_c(loc_id,namelen,pal_name,pal_dims,pal_data) & BIND(C,NAME='h5immake_palette_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in), DIMENSION(*) :: pal_dims ! dimensions - INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: pal_name + INTEGER(hsize_t), INTENT(in), DIMENSION(*) :: pal_dims + INTEGER, INTENT(in), DIMENSION(*) :: pal_data END FUNCTION h5immake_palette_c END INTERFACE - namelen = LEN(dset_name) - errcode = h5immake_palette_c(loc_id,namelen,dset_name,pal_dims,buf) + namelen = LEN(pal_name) + errcode = h5immake_palette_c(loc_id,namelen,pal_name,pal_dims,pal_data) END SUBROUTINE h5immake_palette_f -!------------------------------------------------------------------------- -! Function: h5imlink_palette_f -! -! Purpose: This function attaches a palette to an existing image dataset -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5IM +!! +!! \brief This function attaches a palette to an existing image dataset. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param image_name The name of the dataset to attach the palette to. +!! \param pal_name The name of the palette. +!! \param errcode \fortran_error +!! SUBROUTINE h5imlink_palette_f(loc_id,& - dset_name,& + image_name,& pal_name,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: pal_name ! palette name - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: image_name + CHARACTER(len=*), INTENT(in) :: pal_name + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length INTERFACE - INTEGER FUNCTION h5imlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) & + INTEGER FUNCTION h5imlink_palette_c(loc_id,namelen,image_name,ILEN,pal_name) & BIND(C,NAME='h5imlink_palette_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: pal_name ! palette name - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: image_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: pal_name + INTEGER(size_t) :: namelen + INTEGER(size_t) :: ILEN END FUNCTION h5imlink_palette_c END INTERFACE - namelen = LEN(dset_name) + namelen = LEN(image_name) ILEN = LEN(pal_name) - errcode = h5imlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) + errcode = h5imlink_palette_c(loc_id,namelen,image_name,ILEN,pal_name) END SUBROUTINE h5imlink_palette_f - -!------------------------------------------------------------------------- -! Function: h5imunlink_palette_f -! -! Purpose: This function dettaches a palette to an existing image dataset -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- +!> +!! \ingroup FH5IM +!! +!! \brief This function dettaches a palette to an existing image dataset. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param image_name The name of the image dataset. +!! \param pal_name The name of the palette. +!! \param errcode \fortran_error SUBROUTINE h5imunlink_palette_f(loc_id,& - dset_name,& + image_name,& pal_name,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: pal_name ! palette name - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: image_name + CHARACTER(len=*), INTENT(in) :: pal_name + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length INTERFACE - INTEGER FUNCTION h5imunlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) & + INTEGER FUNCTION h5imunlink_palette_c(loc_id,namelen,image_name,ILEN,pal_name) & BIND(C,NAME='h5imunlink_palette_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: pal_name ! palette name - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: ILEN ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: image_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: pal_name + INTEGER(size_t) :: namelen + INTEGER(size_t) :: ILEN END FUNCTION h5imunlink_palette_c END INTERFACE - namelen = LEN(dset_name) + namelen = LEN(image_name) ILEN = LEN(pal_name) - errcode = h5imunlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) + errcode = h5imunlink_palette_c(loc_id,namelen,image_name,ILEN,pal_name) END SUBROUTINE h5imunlink_palette_f -!------------------------------------------------------------------------- -! Function: h5imget_npalettes_f -! -! Purpose: Gets the number of palettes associated to an image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5IM +!! +!! \brief Gets the number of palettes associated to an image. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param image_name The name of the image dataset. +!! \param npals The number of palettes. +!! \param errcode \fortran_error +!! SUBROUTINE h5imget_npalettes_f(loc_id,& - dset_name,& + image_name,& npals,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout) :: npals ! palettes - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: image_name + INTEGER(hsize_t), INTENT(inout) :: npals + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE - INTEGER FUNCTION h5imget_npalettes_c(loc_id,namelen,dset_name,npals) & + INTEGER FUNCTION h5imget_npalettes_c(loc_id,namelen,image_name,npals) & BIND(C,NAME='h5imget_npalettes_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout) :: npals ! palettes - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: image_name + INTEGER(hsize_t), INTENT(inout) :: npals + INTEGER(size_t) :: namelen END FUNCTION h5imget_npalettes_c END INTERFACE - namelen = LEN(dset_name) - errcode = h5imget_npalettes_c(loc_id,namelen,dset_name,npals) + namelen = LEN(image_name) + errcode = h5imget_npalettes_c(loc_id,namelen,image_name,npals) END SUBROUTINE h5imget_npalettes_f - - -!------------------------------------------------------------------------- -! Function: h5imget_palette_info_f -! -! Purpose: Get palette information -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5IM +!! +!! \brief Gets information about a palette dataset (dimensions). +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param image_name The name of the image dataset. +!! \param pal_number The zero based index that identifies the palette. +!! \param pal_dims The dimensions of the palette dataset. +!! \param errcode \fortran_error +!! SUBROUTINE h5imget_palette_info_f(loc_id,& - dset_name,& + image_name,& pal_number,& - dims,& + pal_dims,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: pal_number ! palette number - INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: dims ! dimensions - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: image_name + INTEGER, INTENT(in) :: pal_number + INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: pal_dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE - INTEGER FUNCTION h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims) & + INTEGER FUNCTION h5imget_palette_info_c(loc_id,namelen,image_name,pal_number,pal_dims) & BIND(C,NAME='h5imget_palette_info_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: pal_number ! palette number - INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: dims ! dimensions - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: image_name + INTEGER, INTENT(in) :: pal_number + INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: pal_dims + INTEGER(size_t) :: namelen END FUNCTION h5imget_palette_info_c END INTERFACE - namelen = LEN(dset_name) - errcode = h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims) + namelen = LEN(image_name) + errcode = h5imget_palette_info_c(loc_id,namelen,image_name,pal_number,pal_dims) END SUBROUTINE h5imget_palette_info_f -!------------------------------------------------------------------------- -! Function: h5imget_palette_f -! -! Purpose: Reads palette -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5IM +!! +!! \brief Gets the palette dataset +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param image_name The name of the image dataset. +!! \param pal_number The zero based index that identifies the palette. +!! \param pal_data The palette dataset. +!! \param errcode \fortran_error +!! SUBROUTINE h5imget_palette_f(loc_id,& - dset_name,& + image_name,& pal_number,& - buf,& + pal_data,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: pal_number ! palette number - INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: image_name + INTEGER, INTENT(in) :: pal_number + INTEGER, INTENT(inout), DIMENSION(*) :: pal_data + INTEGER :: errcode + INTEGER(size_t) :: namelen ! length of name buffer INTERFACE - INTEGER FUNCTION h5imget_palette_c(loc_id,namelen,dset_name,pal_number,buf) & + INTEGER FUNCTION h5imget_palette_c(loc_id,namelen,image_name,pal_number,pal_data) & BIND(C,NAME='h5imget_palette_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: pal_number ! palette number - INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: image_name + INTEGER, INTENT(in) :: pal_number + INTEGER, INTENT(inout), DIMENSION(*) :: pal_data END FUNCTION h5imget_palette_c END INTERFACE - namelen = LEN(dset_name) - errcode = h5imget_palette_c(loc_id,namelen,dset_name,pal_number,buf) + namelen = LEN(image_name) + errcode = h5imget_palette_c(loc_id,namelen,image_name,pal_number,pal_data) END SUBROUTINE h5imget_palette_f - -!------------------------------------------------------------------------- -! Function: h5imis_palette_f -! -! Purpose: Inquires if a dataset is a palette -! -! Return: true, false, fail -! -! Programmer: Pedro Vicente -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - INTEGER FUNCTION h5imis_palette_f(loc_id,& - dset_name) +!> +!! \ingroup FH5IM +!! +!! \brief Inquires if a dataset is a palette. Returns zero (false), a positive (true) or a negative (failure) value. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset. +!! + INTEGER FUNCTION h5imis_palette_f(loc_id, dset_name) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5imis_palette_c(loc_id,namelen,dset_name) & @@ -645,9 +561,9 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name END FUNCTION h5imis_palette_c END INTERFACE @@ -659,7 +575,3 @@ CONTAINS END MODULE H5IM - - - - diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index a4ab247..3b50ad8 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -1,3 +1,14 @@ +!> @defgroup FH5LT Fortran High Level Lite (H5LT) Interface +!! +!! @see H5LT, C-HL API +!! +!! @see @ref H5LT_UG, User Guide +!! + +!> @ingroup H5LT +!! +!! @brief This module contains Fortran interfaces for H5LT. +! ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -10,12 +21,6 @@ ! If you do not have access to either file, you may request a copy from * ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN interfaces for H5LT functions -! -! NOTES -! ! _____ __ __ _____ ____ _____ _______ _ _ _______ ! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| ! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** @@ -30,11 +35,18 @@ #include <H5config_f.inc> +#ifdef H5_DOXYGEN_FORTRAN +MODULE H5LT +#else MODULE H5LT_CONST +#endif + USE, INTRINSIC :: ISO_C_BINDING USE h5fortran_types USE hdf5 +#ifndef H5_DOXYGEN_FORTRAN + INTERFACE h5ltmake_dataset_f MODULE PROCEDURE h5ltmake_dataset_f_ptr END INTERFACE @@ -86,8 +98,7 @@ MODULE H5LT_CONST CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute INTEGER(size_t), INTENT(in) :: size ! size of attribute array TYPE(C_PTR), VALUE :: buf ! data buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dtype ! flag indicating the datatype of the - ! the buffer: + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dtype ! flag indicating the datatype of the buffer: ! R=Real, D=DOUBLE, I=Integer, C=Character INTEGER(size_t) :: SizeOf_buf ! Sizeof the buf datatype END FUNCTION h5ltset_attribute_c @@ -105,76 +116,88 @@ MODULE H5LT_CONST CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute TYPE(C_PTR), VALUE :: buf ! data buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dtype ! flag indicating the datatype of the - ! the buffer: + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dtype ! flag indicating the datatype of the buffer: ! R=Real, D=DOUBLE, I=Integer INTEGER(size_t), INTENT(in) :: SizeOf_buf ! Sizeof the buf data type END FUNCTION h5ltget_attribute_c END INTERFACE +#endif + CONTAINS - !------------------------------------------------------------------------- - ! Make/Read dataset functions - !------------------------------------------------------------------------- !------------------------------------------------------------------------- - ! Function(s): h5ltmake_dataset_f_ptr - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: APR 29, 2015 - ! - ! Comments: - ! - ! Modifications: - ! + ! Make/Read dataset functions !------------------------------------------------------------------------- - SUBROUTINE h5ltmake_dataset_f_ptr(loc_id,& +#ifdef H5_DOXYGEN_FORTRAN + !> + !! \ingroup FH5LT + !! + !! \brief Creates and writes a dataset of a type \p type_id. + !! + !! \note \fortran_approved + !! + !! \param loc_id Location identifier. The identifier may be that of a file or group. + !! \param dset_name The name of the dataset to create. + !! \param rank Number of dimensions of dataspace. + !! \param dims An array of the size of each dimension. + !! \param type_id Identifier of the datatype to use when creating the dataset. + !! \param buf Buffer with data to be written to the dataset. + !! \param errcode \fortran_error + !! + SUBROUTINE h5ltmake_dataset_f(& +#else + SUBROUTINE h5ltmake_dataset_f_ptr( & +#endif + loc_id,& dset_name,& rank,& dims,& type_id,& buf,& - errcode ) + errcode) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - TYPE(C_PTR) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id + TYPE(C_PTR) :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length namelen = LEN(dset_name) errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5ltmake_dataset_f +#else END SUBROUTINE h5ltmake_dataset_f_ptr +#endif - !------------------------------------------------------------------------- - ! Function(s): h5ltmake_dataset_f_int(1-7) - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: Changed to passing C_PTR. - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int1(loc_id,& +#ifdef H5_DOXYGEN_FORTRAN + !> + !! \ingroup FH5LT + !! + !! \brief Creates and writes a dataset of a type \p type_id. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Location identifier. The identifier may be that of a file or group. + !! \param dset_name The name of the dataset to create. + !! \param rank Number of dimensions of dataspace. + !! \param dims An array of the size of each dimension. Limited to seven dimensions. + !! \param type_id Identifier of the datatype to use when creating the dataset. + !! \param buf Buffer with data to be written to the dataset. + !! \param errcode \fortran_error + !! + SUBROUTINE h5ltmake_dataset_f(& +#else + SUBROUTINE h5ltmake_dataset_f_int1(& +#endif + loc_id,& dset_name,& rank,& dims,& @@ -183,20 +206,26 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id +#ifdef H5_DOXYGEN_FORTRAN + TYPE(TYPE), INTENT(in), DIMENSION(*,*,...) :: buf +#else + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf +#endif + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)) namelen = LEN(dset_name) errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) - +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5ltmake_dataset_f +#else END SUBROUTINE h5ltmake_dataset_f_int1 SUBROUTINE h5ltmake_dataset_f_int2(loc_id,& @@ -208,15 +237,15 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2)), TARGET :: buf ! data buffer + DIMENSION(dims(1),dims(2)), TARGET :: buf ! data buffer TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1,1)) @@ -235,15 +264,15 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! data buffer + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! data buffer TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1,1,1)) @@ -257,15 +286,15 @@ CONTAINS type_id, buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! data buffer + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! data buffer TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1,1,1,1)) @@ -279,15 +308,15 @@ CONTAINS type_id, buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! data buffer + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! data buffer TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1,1,1,1,1)) @@ -301,15 +330,15 @@ CONTAINS type_id, buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! data buffer + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! data buffer TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1,1,1,1,1,1)) @@ -323,13 +352,13 @@ CONTAINS type_id, buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! data buffer TYPE(C_PTR) :: f_ptr @@ -340,62 +369,68 @@ CONTAINS errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) END SUBROUTINE h5ltmake_dataset_f_int7 +#endif - - !------------------------------------------------------------------------- - ! Function(s): h5ltread_dataset_f_ptr - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: Apr 29, 2015 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_ptr(loc_id,& +#ifdef H5_DOXYGEN_FORTRAN + !> + !! \ingroup FH5LT + !! + !! \brief Reads a dataset of a type \p type_id. + !! + !! \note \fortran_approved + !! + !! \param loc_id Location identifier. The identifier may be that of a file or group. + !! \param dset_name The name of the dataset to create. + !! \param type_id Identifier of the datatype to use when creating the dataset. + !! \param buf Buffer with data to be written to the dataset. + !! \param errcode \fortran_error + !! + SUBROUTINE h5ltread_dataset_f(& +#else + SUBROUTINE h5ltread_dataset_f_ptr(& +#endif + loc_id,& dset_name,& type_id,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - TYPE(C_PTR) :: buf ! data buffer - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + TYPE(C_PTR) :: buf + INTEGER :: errcode INTEGER(size_t) :: namelen namelen = LEN(dset_name) errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id, buf) - +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5ltread_dataset_f +#else END SUBROUTINE h5ltread_dataset_f_ptr +#endif - !------------------------------------------------------------------------- - ! Function(s): h5ltread_dataset_f_int(1-7) - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int1(loc_id,& +#ifdef H5_DOXYGEN_FORTRAN + !> + !! \ingroup FH5LT + !! + !! \brief Reads a dataset of a type \p type_id. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Location identifier. The identifier may be that of a file or group. + !! \param dset_name The name of the dataset to create. + !! \param type_id Identifier of the datatype to use when creating the dataset. + !! \param buf Buffer with data to be written to the dataset. + !! \param dims An array of the size of each dimension. Limited to seven dimensions. + !! \param errcode \fortran_error + !! + SUBROUTINE h5ltread_dataset_f(& +#else + SUBROUTINE h5ltread_dataset_f_int1(& +#endif + loc_id,& dset_name,& type_id,& buf,& @@ -403,12 +438,16 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims +#ifdef H5_DOXYGEN_FORTRAN + TYPE(TYPE), INTENT(inout), DIMENSION(*,*,...) :: buf +#else + INTEGER, INTENT(inout), DIMENSION(*), TARGET :: buf +#endif + INTEGER :: errcode INTEGER(size_t) :: namelen TYPE(C_PTR) :: f_ptr @@ -417,25 +456,11 @@ CONTAINS namelen = LEN(dset_name) errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5ltread_dataset_f +#else END SUBROUTINE h5ltread_dataset_f_int1 - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int2 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - SUBROUTINE h5ltread_dataset_f_int2(loc_id,& dset_name,& type_id,& @@ -444,12 +469,12 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -469,12 +494,12 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -490,12 +515,12 @@ CONTAINS dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -511,12 +536,12 @@ CONTAINS dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -528,33 +553,16 @@ CONTAINS END SUBROUTINE h5ltread_dataset_f_int5 - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int6 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 12, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - SUBROUTINE h5ltread_dataset_f_int6(loc_id, dset_name, type_id, buf, & dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -570,12 +578,12 @@ CONTAINS dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hid_t), INTENT(in) :: type_id + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -587,11 +595,10 @@ CONTAINS END SUBROUTINE h5ltread_dataset_f_int7 - !------------------------------------------------------------------------- ! Function: h5ltmake_dataset_int_f_1 ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type + !! \brief Creates and writes a dataset of H5T_NATIVE_INT type ! ! Return: Success: 0, Failure: -1 ! @@ -613,13 +620,13 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)) @@ -637,12 +644,12 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & DIMENSION(dims(1),dims(2)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -662,12 +669,12 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -683,12 +690,12 @@ CONTAINS buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -704,12 +711,12 @@ CONTAINS buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -725,12 +732,12 @@ CONTAINS buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -746,12 +753,12 @@ CONTAINS buf, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(in), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -766,7 +773,7 @@ CONTAINS !------------------------------------------------------------------------- ! Function(s): h5ltread_dataset_int_f_(1-7) ! - ! Purpose: Read a dataset + !! \brief Read a dataset ! ! Return: Success: 0, Failure: -1 ! @@ -787,11 +794,11 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -810,11 +817,11 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -833,11 +840,11 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -852,11 +859,11 @@ CONTAINS SUBROUTINE h5ltread_dataset_int_f_4(loc_id, dset_name, buf, dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -871,11 +878,11 @@ CONTAINS SUBROUTINE h5ltread_dataset_int_f_5(loc_id, dset_name, buf, dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -890,11 +897,11 @@ CONTAINS SUBROUTINE h5ltread_dataset_int_f_6(loc_id, dset_name, buf, dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -909,11 +916,11 @@ CONTAINS SUBROUTINE h5ltread_dataset_int_f_7(loc_id, dset_name, buf, dims, errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTEGER, INTENT(inout), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf TYPE(C_PTR) :: f_ptr @@ -929,7 +936,7 @@ CONTAINS !------------------------------------------------------------------------- ! Function: h5ltmake_dataset_string_f ! - ! Purpose: Creates and writes a dataset + !! \brief Creates and writes a dataset ! ! Return: Success: 0, Failure: -1 ! @@ -949,10 +956,10 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: buf ! data buffer - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: buf + INTEGER :: errcode INTEGER(size_t) :: namelen ! name length INTEGER(size_t) :: buflen ! buffer length @@ -962,11 +969,11 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(hid_t), INTENT(in) :: loc_id INTEGER(size_t) :: namelen ! length of name buffer INTEGER(size_t) :: buflen ! length of data buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: buf ! data buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: buf END FUNCTION h5ltmake_dataset_string_c END INTERFACE @@ -979,7 +986,7 @@ CONTAINS !------------------------------------------------------------------------- ! Function: h5ltread_dataset_string_f ! - ! Purpose: Read a dataset + !! \brief Read a dataset ! ! Return: Success: 0, Failure: -1 ! @@ -999,10 +1006,10 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(inout) :: buf ! data buffer - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(inout) :: buf + INTEGER :: errcode INTEGER(size_t) :: namelen ! name length INTERFACE @@ -1011,10 +1018,10 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(hid_t), INTENT(in) :: loc_id INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: buf ! data buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: buf END FUNCTION h5ltread_dataset_string_c END INTERFACE @@ -1023,49 +1030,51 @@ CONTAINS END SUBROUTINE h5ltread_dataset_string_f - !------------------------------------------------------------------------- - ! Make/Read attribute functions - !------------------------------------------------------------------------- +#endif !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: May 4, 2015 - ! - ! Comments: - ! - ! Modifications: - ! + ! Make/Read attribute functions !------------------------------------------------------------------------- + !> + !! \ingroup FH5LT + !! + !! \brief Creates and writes an attribute and is a generic replacement for data type specific + !! Fortran h5ltset_attribute_*_f APIs. There is no C equivalent API. + !! + !! \note \fortran_approved + !! + !! \param loc_id Location identifier. The identifier may be that of a file or group. + !! \param dset_name The name of the dataset to create. + !! \param attr_name The name of the attribute to create. + !! \param buf The data buffer. + !! \param buf_type Valid data types are CHARACTER, INTEGER or REAL. + !! NOTE: only the first character matters and is case insensitive. + !! \param SizeOf_buf_type Size of \p buf's data type, in bytes. + !! \param size Size of attribute array. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltset_attribute_f(loc_id,& dset_name,& attr_name,& buf,& - buf_type, SizeOf_buf_type, & + buf_type,& + SizeOf_buf_type, & size,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - TYPE(C_PTR) :: buf ! data buffer - CHARACTER(LEN=*), INTENT(in) :: buf_type ! valid data types are: - ! CHARACTER, INTEGER or REAL - ! NOTE: only the first character matters and is case insensitive - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER(size_t), INTENT(in) :: SizeOf_buf_type ! size of buf's data type - INTEGER, INTENT(out) :: errcode ! error code - - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + TYPE(C_PTR) :: buf + CHARACTER(LEN=*), INTENT(in) :: buf_type + INTEGER(size_t), INTENT(in) :: size + INTEGER(size_t), INTENT(in) :: SizeOf_buf_type + INTEGER, INTENT(out) :: errcode + + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length CHARACTER(KIND=C_CHAR) :: buf_type_uppercase namelen = LEN(dset_name) @@ -1085,39 +1094,37 @@ CONTAINS END SUBROUTINE h5ltset_attribute_f - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_int_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Creates and writes an attribute. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object to attach the attribute. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param size The size of the 1D array (one in the case of a scalar attribute). + !! This value is used by H5Screate_simple() to create the dataspace. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltset_attribute_int_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& size,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER :: errcode ! error code - INTEGER, DIMENSION(*), TARGET :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER(size_t), INTENT(in) :: size + INTEGER :: errcode + INTEGER, DIMENSION(*), TARGET :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length TYPE(C_PTR) :: f_ptr INTEGER(size_t) :: SizeOf_buf_type @@ -1129,46 +1136,44 @@ CONTAINS SizeOf_buf_type = SIZEOF(buf(1)) #endif - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,& + errcode = h5ltset_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name,size,& f_ptr,'I'//C_NULL_CHAR,SizeOf_buf_type) END SUBROUTINE h5ltset_attribute_int_f - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_float_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Creates and writes an attribute. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object to attach the attribute. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param size The size of the 1D array (one in the case of a scalar attribute). + !! This value is used by H5Screate_simple() to create the dataspace. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltset_attribute_float_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& size,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER :: errcode ! error code - REAL(KIND=C_FLOAT), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER(size_t), INTENT(in) :: size + INTEGER :: errcode + REAL(KIND=C_FLOAT), INTENT(in), DIMENSION(*), TARGET :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length TYPE(C_PTR) :: f_ptr INTEGER(size_t) :: SizeOf_buf_type @@ -1179,46 +1184,44 @@ CONTAINS SizeOf_buf_type = SIZEOF(buf(1)) #endif - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,& + errcode = h5ltset_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name,size,& f_ptr,'R'//C_NULL_CHAR, SizeOf_buf_type) END SUBROUTINE h5ltset_attribute_float_f - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_double_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Creates and writes an attribute. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object to attach the attribute. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param size The size of the 1D array (one in the case of a scalar attribute). + !! This value is used by H5Screate_simple() to create the dataspace. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltset_attribute_double_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& size,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER :: errcode ! error code - REAL(KIND=C_DOUBLE), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER(size_t), INTENT(in) :: size + INTEGER :: errcode + REAL(KIND=C_DOUBLE), INTENT(in), DIMENSION(*), TARGET :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length TYPE(C_PTR) :: f_ptr INTEGER(size_t) :: SizeOf_buf_type @@ -1230,46 +1233,41 @@ CONTAINS SizeOf_buf_type = SIZEOF(buf(1)) #endif - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,& + errcode = h5ltset_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name,size,& f_ptr,'R'//C_NULL_CHAR,SizeOf_buf_type) END SUBROUTINE h5ltset_attribute_double_f - - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_string_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Creates and writes an attribute. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object to attach the attribute. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltset_attribute_string_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code - CHARACTER(LEN=*), DIMENSION(*), INTENT(in), TARGET :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - INTEGER(size_t) :: buflen ! data buffer length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER :: errcode + CHARACTER(LEN=*), DIMENSION(*), INTENT(in), TARGET :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + INTEGER(size_t) :: buflen ! data buffer length TYPE(C_PTR) :: f_ptr INTEGER(size_t) :: SizeOf_buf_type @@ -1281,52 +1279,48 @@ CONTAINS SizeOf_buf_type = SIZEOF(buf(1:1)(1:1)) #endif - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) buflen = LEN(buf) - errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,& + errcode = h5ltset_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name,buflen,& f_ptr,'C'//C_NULL_CHAR, SizeOf_buf_type) END SUBROUTINE h5ltset_attribute_string_f - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: Apr 29, 2015 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Reads an attribute from disk. + !! + !! \note \fortran_approved + !! + !! \param loc_id Location identifier. The identifier may be that of a file or group. + !! \param obj_name The name of the object that the attribute is attached to. + !! \param attr_name The name of the attribute to create. + !! \param buf The data buffer. + !! \param buf_type Valid data types are CHARACTER, INTEGER or REAL. + !! NOTE: only the first character matters and is case insensitive. + !! \param SizeOf_buf_type Size of \p buf's data type, in bytes. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_attribute_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf, buf_type, SizeOf_buf_type, & errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - TYPE(C_PTR) :: buf ! data buffer - CHARACTER(LEN=*), INTENT(in) :: buf_type ! valid data types are: - ! CHARACTER, INTEGER or REAL - ! NOTE: only the first character matters and is case insensitive - INTEGER(size_t), INTENT(in) :: SizeOf_buf_type ! size of buf's data type - INTEGER, INTENT(out) :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! attr length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + TYPE(C_PTR) :: buf + CHARACTER(LEN=*), INTENT(in) :: buf_type + INTEGER(size_t), INTENT(in) :: SizeOf_buf_type + INTEGER, INTENT(out) :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! attr length CHARACTER(KIND=C_CHAR) :: buf_type_uppercase - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) buf_type_uppercase(1:1) = buf_type(1:1) @@ -1337,43 +1331,38 @@ CONTAINS ELSE IF(buf_type_uppercase(1:1).EQ.'c')THEN buf_type_uppercase(1:1) = 'C' ENDIF - errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name, & + errcode = h5ltget_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name, & buf, buf_type_uppercase//C_NULL_CHAR, SizeOf_buf_type) - END SUBROUTINE h5ltget_attribute_f - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_int_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Reads an attribute from disk. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object that the attribute is attached to. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_attribute_int_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code - INTEGER, INTENT(inout), DIMENSION(*), TARGET :: buf! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER :: errcode + INTEGER, INTENT(inout), DIMENSION(*), TARGET :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length TYPE(C_PTR) :: f_ptr INTEGER(size_t) :: SizeOf_buf @@ -1384,43 +1373,39 @@ CONTAINS #else SizeOf_buf = SIZEOF(buf(1)) #endif - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,f_ptr,'I'//C_NULL_CHAR, SizeOf_buf) + errcode = h5ltget_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name,f_ptr,'I'//C_NULL_CHAR, SizeOf_buf) END SUBROUTINE h5ltget_attribute_int_f - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_float_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Reads an attribute from disk. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object that the attribute is attached to. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_attribute_float_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER :: errcode REAL(KIND=C_FLOAT), INTENT(inout), DIMENSION(*), TARGET :: buf - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length TYPE(C_PTR) :: f_ptr INTEGER(size_t) :: SizeOf_buf @@ -1430,43 +1415,39 @@ CONTAINS #else SizeOf_buf = SIZEOF(buf(1)) #endif - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,f_ptr,'R'//C_NULL_CHAR, SizeOf_buf) + errcode = h5ltget_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name,f_ptr,'R'//C_NULL_CHAR, SizeOf_buf) END SUBROUTINE h5ltget_attribute_float_f - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_c_double_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Reads an attribute from disk. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object that the attribute is attached to. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_attribute_double_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER :: errcode REAL(KIND=C_DOUBLE),INTENT(inout),DIMENSION(*), TARGET :: buf - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length TYPE(C_PTR) :: f_ptr INTEGER(size_t) :: SizeOf_buf @@ -1477,66 +1458,62 @@ CONTAINS SizeOf_buf = SIZEOF(buf(1)) #endif - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,f_ptr,'R'//C_NULL_CHAR, SizeOf_buf) + errcode = h5ltget_attribute_c(loc_id,namelen,obj_name,attrlen,attr_name,f_ptr,'R'//C_NULL_CHAR, SizeOf_buf) END SUBROUTINE h5ltget_attribute_double_f - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_string_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Reads an attribute from disk. + !! + !! \note \fortran_obsolete + !! + !! \param loc_id Identifier of the object (dataset or group) to create the attribute within + !! \param obj_name The name of the object that the attribute is attached to. + !! \param attr_name The attribute name. + !! \param buf Buffer with data to be written to the attribute. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_attribute_string_f(loc_id,& - dset_name,& + obj_name,& attr_name,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER :: errcode CHARACTER(LEN=*), INTENT(inout) :: buf - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - INTEGER(size_t) :: buf_size ! buf size + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + INTEGER(size_t) :: buf_size ! buf size INTERFACE - INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) & + INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,obj_name,attrlen,attr_name,buf,buf_size) & BIND(C,NAME='h5ltget_attribute_string_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: buf ! data buffer - INTEGER(size_t) :: buf_size ! data buffer size + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + INTEGER(size_t) :: attrlen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: buf + INTEGER(size_t) :: buf_size END FUNCTION h5ltget_attribute_string_c END INTERFACE - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) buf_size = LEN(buf) - errcode = h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) + errcode = h5ltget_attribute_string_c(loc_id,namelen,obj_name,attrlen,attr_name,buf,buf_size) END SUBROUTINE h5ltget_attribute_string_f @@ -1544,34 +1521,27 @@ CONTAINS ! Query dataset functions !------------------------------------------------------------------------- - !------------------------------------------------------------------------- - ! Function: h5ltget_dataset_ndims_f - ! - ! Purpose: Gets the dimensionality of a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: September 30, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Gets the dimensionality of a dataset. + !! + !! \param loc_id Identifier of the object to locate the dataset within. + !! \param dset_name The dataset name. + !! \param rank The dimensionality of the dataset. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_dataset_ndims_f(loc_id,& dset_name,& rank,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(inout) :: rank ! rank - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(inout) :: rank + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5ltget_dataset_ndims_c(loc_id,namelen,dset_name,rank) & @@ -1579,10 +1549,10 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(inout) :: rank ! rank + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER, INTENT(inout) :: rank END FUNCTION h5ltget_dataset_ndims_c END INTERFACE @@ -1591,33 +1561,24 @@ CONTAINS END SUBROUTINE h5ltget_dataset_ndims_f - - !------------------------------------------------------------------------- - ! Function: h5ltfind_dataset_f - ! - ! Purpose: Inquires if a dataset named dset_name exists attached - ! to the object loc_id. - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Determines whether a dataset exists. + !! + !! \param loc_id Identifier of the group containing the dataset. + !! \param dset_name The dataset name. + !! + !! \result Returns zero (false), a positive (true) or a negative (failure) value. + !! INTEGER FUNCTION h5ltfind_dataset_f(loc_id,& dset_name) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5ltfind_dataset_c(loc_id,namelen,dset_name) & @@ -1625,9 +1586,9 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name END FUNCTION h5ltfind_dataset_c END INTERFACE @@ -1637,23 +1598,18 @@ CONTAINS END FUNCTION h5ltfind_dataset_f - !------------------------------------------------------------------------- - ! Function: h5ltget_dataset_info_f - ! - ! Purpose: Gets information about a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: September 30, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Retrieves information about a dataset. + !! + !! \param loc_id Identifier of the object to locate the dataset within. + !! \param dset_name The dataset name. + !! \param dims The dimensions of the dataset. + !! \param type_class The class identifier. See H5Tget_class_f() for a list of class types. + !! \param type_size The size of the datatype in bytes. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_dataset_info_f(loc_id,& dset_name,& dims,& @@ -1662,13 +1618,13 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims + INTEGER, INTENT(inout) :: type_class + INTEGER(size_t), INTENT(inout) :: type_size + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5ltget_dataset_info_c(loc_id,namelen,dset_name,dims,type_class,type_size) & @@ -1676,12 +1632,12 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims + INTEGER, INTENT(inout) :: type_class + INTEGER(size_t), INTENT(inout) :: type_size END FUNCTION h5ltget_dataset_info_c END INTERFACE @@ -1695,80 +1651,68 @@ CONTAINS ! Query attribute functions !------------------------------------------------------------------------- - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_ndims_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Gets the dimensionality of an attribute. + !! + !! \param loc_id Identifier of the object (dataset or group) to read the attribute from. + !! \param obj_name The name of the object that the attribute is attached to. + !! \param attr_name The attribute name. + !! \param rank The dimensionality of the attribute. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_attribute_ndims_f(loc_id,& - dset_name,& + obj_name,& attr_name,& rank,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER, INTENT(inout) :: rank ! rank - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER, INTENT(inout) :: rank + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length INTERFACE - INTEGER FUNCTION h5ltget_attribute_ndims_c(loc_id,namelen,dset_name,attrlen,attr_name,rank) & + INTEGER FUNCTION h5ltget_attribute_ndims_c(loc_id,namelen,obj_name,attrlen,attr_name,rank) & BIND(C,NAME='h5ltget_attribute_ndims_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute - INTEGER, INTENT(inout) :: rank ! rank + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + INTEGER(size_t) :: attrlen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name + INTEGER, INTENT(inout) :: rank END FUNCTION h5ltget_attribute_ndims_c END INTERFACE - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltget_attribute_ndims_c(loc_id,namelen,dset_name,attrlen,attr_name,rank) + errcode = h5ltget_attribute_ndims_c(loc_id,namelen,obj_name,attrlen,attr_name,rank) END SUBROUTINE h5ltget_attribute_ndims_f - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_info_f - ! - ! Purpose: Gets information about an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: Pedro Vicente - ! - ! Date: September 30, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Gets information about an attribute. + !! + !! \param loc_id Identifier of the object (dataset or group) to read the attribute from. + !! \param obj_name The name of the object that the attribute is attached to. + !! \param attr_name The attribute name. + !! \param dims The dimensions of the attribute. + !! \param type_class The class identifier. For a list of valid class types see: H5Tget_class_f(). + !! \param type_size The size of the datatype in bytes. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltget_attribute_info_f(loc_id,& - dset_name,& + obj_name,& attr_name,& dims,& type_class,& @@ -1776,65 +1720,58 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: obj_name + CHARACTER(LEN=*), INTENT(in) :: attr_name + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims + INTEGER, INTENT(inout) :: type_class + INTEGER(size_t), INTENT(inout) :: type_size + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length INTERFACE - INTEGER FUNCTION h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) & + INTEGER FUNCTION h5ltget_attribute_info_c(loc_id,namelen,obj_name,attrlen,attr_name,dims,type_class,type_size) & BIND(C,NAME='h5ltget_attribute_info_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size + INTEGER(hid_t), INTENT(in) :: loc_id + INTEGER(size_t) :: namelen + INTEGER(size_t) :: attrlen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims + INTEGER, INTENT(inout) :: type_class + INTEGER(size_t), INTENT(inout) :: type_size END FUNCTION h5ltget_attribute_info_c END INTERFACE - namelen = LEN(dset_name) + namelen = LEN(obj_name) attrlen = LEN(attr_name) - errcode = h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) + errcode = h5ltget_attribute_info_c(loc_id,namelen,obj_name,attrlen,attr_name,dims,type_class,type_size) END SUBROUTINE h5ltget_attribute_info_f - !------------------------------------------------------------------------- - ! Function: h5ltpath_valid_f - ! - ! Purpose: Validates a path - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: February 18, 2012 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - + !> + !! \ingroup FH5LT + !! + !! \brief Determines whether an HDF5 path is valid and, optionally, whether the path resolves to an HDF5 object. + !! + !! \param loc_id Identifier of an object in the file. + !! \param path The path to the object to check; links in path may be of any type. + !! \param check_object_valid Indicates whether to check if the final component of the path resolves to a valid object. + !! \param path_valid Object status. + !! \param errcode \fortran_error + !! SUBROUTINE h5ltpath_valid_f(loc_id, path, check_object_valid, path_valid, errcode) IMPLICIT NONE - INTEGER(hid_t) , INTENT(IN) :: loc_id ! An identifier of an object in the file. - CHARACTER(LEN=*), INTENT(IN) :: path ! Path to the object to check, relative to loc_id. - LOGICAL , INTENT(IN) :: check_object_valid ! Indicates whether to check if the final component - ! of the path resolves to a valid object - LOGICAL , INTENT(OUT) :: path_valid ! Object status - INTEGER , INTENT(OUT) :: errcode ! Error code: 0 on success and -1 on failure + INTEGER(hid_t) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: path + LOGICAL , INTENT(IN) :: check_object_valid + LOGICAL , INTENT(OUT) :: path_valid + INTEGER , INTENT(OUT) :: errcode INTEGER(size_t) :: pathlen INTEGER :: check_object_valid_c @@ -1871,7 +1808,11 @@ CONTAINS END SUBROUTINE h5ltpath_valid_f +#ifdef H5_DOXYGEN_FORTRAN +END MODULE H5LT +#else END MODULE H5LT_CONST +#endif diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90 index 82f34a8..52af33f 100644 --- a/hl/fortran/src/H5TBff.F90 +++ b/hl/fortran/src/H5TBff.F90 @@ -1,3 +1,14 @@ +!> @defgroup FH5TB Fortran High Level Table (H5TB) Interface +!! +!! @see H5TB, C-HL API +!! +!! @see @ref H5TB_UG, User Guide +!! + +!> @ingroup FH5TB +!! +!! @brief This module contains Fortran interfaces for H5TB. +! ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -10,13 +21,6 @@ ! If you do not have access to either file, you may request a copy from * ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN interfaces for H5TB functions -! -! -! NOTES -! ! _____ __ __ _____ ____ _____ _______ _ _ _______ ! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| ! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** @@ -29,38 +33,64 @@ ! This is needed for Windows based operating systems. ! #include "H5config_f.inc" - -MODULE h5tb_CONST +#ifdef H5_DOXYGEN_FORTRAN + MODULE H5TB +#else + MODULE H5TB_CONST +#endif USE, INTRINSIC :: ISO_C_BINDING USE h5fortran_types USE hdf5 INTERFACE h5tbwrite_field_name_f +#ifdef H5_DOXYGEN_FORTRAN + MODULE PROCEDURE h5tbwrite_field_name_f +#else MODULE PROCEDURE h5tbwrite_field_name_f_int MODULE PROCEDURE h5tbwrite_field_name_f_string +#endif END INTERFACE INTERFACE h5tbread_field_name_f +#ifdef H5_DOXYGEN_FORTRAN + MODULE PROCEDURE h5tbread_field_name_f +#else MODULE PROCEDURE h5tbread_field_name_f_int MODULE PROCEDURE h5tbread_field_name_f_string +#endif END INTERFACE INTERFACE h5tbwrite_field_index_f +#ifdef H5_DOXYGEN_FORTRAN + MODULE PROCEDURE h5tbwrite_field_index_f +#else MODULE PROCEDURE h5tbwrite_field_index_f_int MODULE PROCEDURE h5tbwrite_field_index_f_string +#endif END INTERFACE INTERFACE h5tbread_field_index_f +#ifdef H5_DOXYGEN_FORTRAN + MODULE PROCEDURE h5tbread_field_index_f +#else MODULE PROCEDURE h5tbread_field_index_f_int MODULE PROCEDURE h5tbread_field_index_f_string +#endif END INTERFACE INTERFACE h5tbinsert_field_f +#ifdef H5_DOXYGEN_FORTRAN + MODULE PROCEDURE h5tbinsert_field_f +#else MODULE PROCEDURE h5tbinsert_field_f_int MODULE PROCEDURE h5tbinsert_field_f_string +#endif END INTERFACE + +#ifndef H5_DOXYGEN_FORTRAN + INTERFACE h5tbmake_table_f MODULE PROCEDURE h5tbmake_table_f90 MODULE PROCEDURE h5tbmake_table_ptr_f @@ -144,7 +174,6 @@ MODULE h5tb_CONST END FUNCTION h5tbread_field_index_c END INTERFACE - INTERFACE INTEGER FUNCTION h5tbinsert_field_c(loc_id,namelen,dset_name,namelen1,field_name,& field_type,field_index,buf) & @@ -153,8 +182,8 @@ MODULE h5tb_CONST IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: field_name ! name of the field + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: field_name ! name of the field INTEGER(hid_t), INTENT(in) :: field_type ! field type INTEGER, INTENT(in) :: field_index ! field_index TYPE(C_PTR), VALUE :: buf ! data buffer @@ -163,26 +192,36 @@ MODULE h5tb_CONST END FUNCTION h5tbinsert_field_c END INTERFACE -CONTAINS +#endif -!------------------------------------------------------------------------- -! Function: h5tbmake_table_f90 -! -! Purpose: Make a table -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- +CONTAINS - SUBROUTINE h5tbmake_table_f90(table_title,& +!> +!! \ingroup FH5TB +!! +!! \brief Creates (DOES NOT WRITE) a dataset named \p dset_name attached to the object specified by the identifier \p loc_id. +!! +!! \note \fortran_obsolete +!! +!! \param table_title The title of the table. +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to create. +!! \param nfields The number of fields. +!! \param nrecords The number of records. +!! \param type_size The size in bytes of the structure associated with the table. Obtained with sizeof or storage_size. +!! \param field_names An array containing the names of the fields. +!! \param field_offset An array containing the offsets of the fields. +!! \param field_types An array containing the type of the fields. +!! \param chunk_size The chunk size. +!! \param compress Flag that turns compression on or off. +!! \param errcode \fortran_error +!! +#ifdef H5_DOXYGEN_FORTRAN + SUBROUTINE h5tbmake_table_f(& +#else + SUBROUTINE h5tbmake_table_f90(& +#endif + table_title,& loc_id,& dset_name,& nfields,& @@ -196,20 +235,20 @@ CONTAINS errcode ) IMPLICIT NONE - CHARACTER(LEN=*), INTENT(in) :: table_title ! name of the dataset - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! fields - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), DIMENSION(1:nfields), INTENT(in) :: field_names ! field names - INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: field_offset ! field offset - INTEGER(hid_t), DIMENSION(1:nfields), INTENT(in) :: field_types ! field types - INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size - INTEGER, INTENT(in) :: compress ! compress + CHARACTER(LEN=*), INTENT(in) :: table_title + INTEGER(hid_t) , INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: nfields + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t) , INTENT(in) :: type_size + CHARACTER(LEN=*), DIMENSION(1:nfields), INTENT(in) :: field_names + INTEGER(size_t) , DIMENSION(1:nfields), INTENT(in) :: field_offset + INTEGER(hid_t), DIMENSION(1:nfields), INTENT(in) :: field_types + INTEGER(hsize_t), INTENT(in) :: chunk_size + INTEGER, INTENT(in) :: compress + INTEGER :: errcode INTEGER(size_t) :: namelen ! name length INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code INTEGER(size_t), DIMENSION(1:nfields) :: char_len_field_names ! field name lengths INTEGER(size_t) :: max_char_size_field_names ! character len of field names INTEGER(hsize_t) :: i ! general purpose integer @@ -234,21 +273,21 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: table_title ! name of the dataset - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! fields - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(KIND=C_CHAR), DIMENSION(nfields), INTENT(in) :: field_names ! field names - INTEGER(size_t), DIMENSION(nfields), INTENT(in) :: field_offset ! field offset - INTEGER(hid_t), DIMENSION(nfields), INTENT(in) :: field_types ! field types - INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size - INTEGER, INTENT(in) :: compress ! compress - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER(size_t), DIMENSION(nfields) :: char_len_field_names ! field name's lengths - INTEGER(size_t) :: max_char_size_field_names ! character len of field names + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: table_title + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: nfields + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size + CHARACTER(KIND=C_CHAR), DIMENSION(nfields), INTENT(in) :: field_names + INTEGER(size_t), DIMENSION(nfields), INTENT(in) :: field_offset + INTEGER(hid_t), DIMENSION(nfields), INTENT(in) :: field_types + INTEGER(hsize_t), INTENT(in) :: chunk_size + INTEGER, INTENT(in) :: compress + INTEGER(size_t) :: namelen + INTEGER(size_t) :: namelen1 + INTEGER(size_t), DIMENSION(nfields) :: char_len_field_names + INTEGER(size_t) :: max_char_size_field_names END FUNCTION h5tbmake_table_c END INTERFACE @@ -266,9 +305,40 @@ CONTAINS type_size, field_offset, field_types, chunk_size, compress, char_len_field_names, & max_char_size_field_names, field_names) +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5tbmake_table_f +#else END SUBROUTINE h5tbmake_table_f90 - - SUBROUTINE h5tbmake_table_ptr_f(table_title,& +#endif + +!> +!! \ingroup FH5TB +!! +!! \brief Creates and writes a dataset named \p dset_name attached to the object specified by the identifier \p loc_id. +!! +!! \note \fortran_approved +!! +!! \param table_title The title of the table +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to create +!! \param nfields The number of fields +!! \param nrecords The number of records +!! \param type_size The size in bytes of the structure associated with the table; This value is obtained with sizeof(). +!! \param field_names An array containing the names of the fields +!! \param field_offset An array containing the offsets of the fields +!! \param field_types An array containing the type of the fields +!! \param chunk_size The chunk size +!! \param fill_data Fill values data +!! \param compress Flag that turns compression on or off +!! \param data Buffer with data to be written to the table +!! \param errcode \fortran_error +!! +#ifdef H5_DOXYGEN_FORTRAN + SUBROUTINE h5tbmake_table_f(& +#else + SUBROUTINE h5tbmake_table_ptr_f(& +#endif + table_title,& loc_id,& dset_name,& nfields,& @@ -285,22 +355,22 @@ CONTAINS USE ISO_C_BINDING IMPLICIT NONE - CHARACTER(LEN=*), INTENT(in) :: table_title ! name of the dataset - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! fields - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), DIMENSION(1:nfields), INTENT(in) :: field_names ! field names - INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: field_offset ! field offset - INTEGER(hid_t), DIMENSION(1:nfields), INTENT(in) :: field_types ! field types - INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size - TYPE(C_PTR), INTENT(in) :: fill_data ! Fill values data - INTEGER, INTENT(in) :: compress ! compress - TYPE(C_PTR), INTENT(in) :: data ! Buffer with data to be written to the table + CHARACTER(LEN=*), INTENT(in) :: table_title + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: nfields + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size + CHARACTER(LEN=*), DIMENSION(1:nfields), INTENT(in) :: field_names + INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: field_offset + INTEGER(hid_t), DIMENSION(1:nfields), INTENT(in) :: field_types + INTEGER :: errcode + INTEGER(hsize_t), INTENT(in) :: chunk_size + TYPE(C_PTR), INTENT(in) :: fill_data + INTEGER, INTENT(in) :: compress + TYPE(C_PTR), INTENT(in) :: data INTEGER(size_t) :: namelen ! name length INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code INTEGER(size_t), DIMENSION(1:nfields) :: char_len_field_names ! field name lengths INTEGER(size_t) :: max_char_size_field_names ! character len of field names INTEGER(hsize_t) :: i ! general purpose integer @@ -327,22 +397,22 @@ CONTAINS IMPORT :: C_CHAR, C_PTR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: table_title ! name of the dataset - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! fields - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(KIND=C_CHAR), DIMENSION(nfields), INTENT(in) :: field_names ! field names - INTEGER(size_t), DIMENSION(nfields), INTENT(in) :: field_offset ! field offset - INTEGER(hid_t), DIMENSION(nfields), INTENT(in) :: field_types ! field types - INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size - TYPE(C_PTR), INTENT(in), VALUE :: fill_data ! Fill values data - INTEGER, INTENT(in) :: compress ! compress - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER(size_t), DIMENSION(nfields) :: char_len_field_names ! field name's lengths - INTEGER(size_t) :: max_char_size_field_names ! character len of field names + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: table_title + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: nfields + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size + CHARACTER(KIND=C_CHAR), DIMENSION(nfields), INTENT(in) :: field_names + INTEGER(size_t), DIMENSION(nfields), INTENT(in) :: field_offset + INTEGER(hid_t), DIMENSION(nfields), INTENT(in) :: field_types + INTEGER(hsize_t), INTENT(in) :: chunk_size + TYPE(C_PTR), INTENT(in), VALUE :: fill_data + INTEGER, INTENT(in) :: compress + INTEGER(size_t) :: namelen + INTEGER(size_t) :: namelen1 + INTEGER(size_t), DIMENSION(nfields) :: char_len_field_names + INTEGER(size_t) :: max_char_size_field_names TYPE(C_PTR), INTENT(in), VALUE :: data END FUNCTION h5tbmake_table_ptr_c END INTERFACE @@ -361,28 +431,44 @@ CONTAINS type_size, field_offset, field_types, chunk_size, fill_data, compress, char_len_field_names, & max_char_size_field_names, field_names, data) - END SUBROUTINE h5tbmake_table_ptr_f - - SUBROUTINE h5tbread_table_f(loc_id, table_name, nfields, dst_size, dst_offset, & +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5tbmake_table_f +#else + END SUBROUTINE h5tbmake_table_ptr_f +#endif +!> +!! \ingroup FH5TB +!! +!! \brief Reads a table. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to read +!! \param nfields Number of fields, i.e., size of dst_offset and dst_sizes arrays. +!! \param dst_size The size of the structure type, as calculated by sizeof or storage_size +!! \param dst_offset An array containing the offsets of the fields. These offsets can be calculated with H5OFFSETOF. +!! \param dst_sizes An array containing the sizes of the fields. These sizes can be calculated with sizeof or storage_size. +!! \param dst_buf Pointer to buffer with data. +!! \param errcode \fortran_error +!! + SUBROUTINE h5tbread_table_f(loc_id, dset_name, nfields, dst_size, dst_offset, & dst_sizes, dst_buf, errcode) USE ISO_C_BINDING IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! An array containing the sizes of the fields - CHARACTER(LEN=*), INTENT(in) :: table_name ! The name of the dataset to read - INTEGER(hsize_t), INTENT(in) :: nfields ! number of fields - INTEGER(size_t), INTENT(in) :: dst_size ! The size of the structure type - INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_offset ! An array containing the offsets of the fields - INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_sizes ! An array containing the sizes of the fields - TYPE(C_PTR) :: dst_buf ! Buffer with data !! do not use INTENT, causes NAG - ! to segfault in C APIs - INTEGER :: errcode ! error code - - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: nfields + INTEGER(size_t), INTENT(in) :: dst_size + INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_offset + INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_sizes + TYPE(C_PTR) :: dst_buf !!! do not use INTENT, causes NAG to segfault in C APIs + INTEGER :: errcode + + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5tbread_table_c(loc_id,& - table_name,& + dset_name,& namelen,& nfields,& dst_size,& @@ -393,22 +479,22 @@ CONTAINS IMPORT :: C_PTR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=1), INTENT(in) :: table_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=1), INTENT(in) :: dset_name INTEGER(hsize_t), INTENT(in) :: nfields - INTEGER(size_t), INTENT(in) :: dst_size ! type size - INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_offset ! An array containing the sizes of the fields - INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_sizes ! An array containing the sizes of the fields - INTEGER(size_t) :: namelen ! name length + INTEGER(size_t), INTENT(in) :: dst_size + INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_offset + INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_sizes + INTEGER(size_t) :: namelen TYPE(C_PTR), VALUE :: dst_buf END FUNCTION h5tbread_table_c END INTERFACE - namelen = LEN(table_name) + namelen = LEN(dset_name) errcode = h5tbread_table_c(loc_id,& - table_name,& + dset_name,& namelen, & nfields, & dst_size,& @@ -416,25 +502,28 @@ CONTAINS dst_sizes, & dst_buf) - END SUBROUTINE h5tbread_table_f -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_name_f_int -! -! Purpose: Writes one field -! -! Programmer: Pedro Vicente -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE h5tbwrite_field_name_f_int(loc_id,& +#ifdef H5_DOXYGEN_FORTRAN +!> +!! \ingroup FH5TB +!! +!! \brief Overwrites field. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to overwrite +!! \param field_name The names of the fields to write +!! \param start The zero index record to start writing +!! \param nrecords The number of records to write +!! \param type_size The size of the structure type, as calculated by sizeof or storage_size. +!! \param buf Buffer with data. +!! \param errcode \fortran_error +!! + SUBROUTINE h5tbwrite_field_name_f(& +#else + SUBROUTINE h5tbwrite_field_name_f_int(& +#endif + loc_id,& dset_name,& field_name,& start,& @@ -444,16 +533,20 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: field_name + INTEGER(hsize_t), INTENT(in) :: start + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size +#ifdef H5_DOXYGEN_FORTRAN + TYPE(TYPE), INTENT(in), DIMENSION(*) :: buf +#else + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf +#endif + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)) @@ -462,10 +555,11 @@ CONTAINS errcode = h5tbwrite_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,& start,nrecords,type_size,f_ptr) - +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5tbwrite_field_name_f +#else END SUBROUTINE h5tbwrite_field_name_f_int - SUBROUTINE h5tbwrite_field_name_f_string(loc_id,& dset_name,& field_name,& @@ -498,24 +592,28 @@ CONTAINS start,nrecords,type_size,f_ptr) END SUBROUTINE h5tbwrite_field_name_f_string - - -!------------------------------------------------------------------------- -! Function: h5tbread_field_name_f_int -! -! Purpose: Reads one field -! -! Programmer: Pedro Vicente -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE h5tbread_field_name_f_int(loc_id,& +#endif + +#ifdef H5_DOXYGEN_FORTRAN +!> +!! \ingroup FH5TB +!! +!! \brief Reads one or several fields. The fields are identified by name. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to read. +!! \param field_name An array containing the names of the fields to read. +!! \param start The start record to read from. +!! \param nrecords The number of records to read. +!! \param type_size The size in bytes of the structure associated with the table. Obtained with sizeof or storage_size. +!! \param buf Buffer with data +!! \param errcode \fortran_error +!! + SUBROUTINE h5tbread_field_name_f(& +#else + SUBROUTINE h5tbread_field_name_f_int(& +#endif + loc_id,& dset_name,& field_name,& start,& @@ -526,19 +624,23 @@ CONTAINS IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: field_name + INTEGER(hsize_t), INTENT(in) :: start + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size +#ifdef H5_DOXYGEN_FORTRAN + TYPE(TYPE), INTENT(INOUT), DIMENSION(*):: buf +#else + INTEGER, INTENT(INOUT), DIMENSION(*), TARGET :: buf +#endif + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf(1)) ! name length + f_ptr = C_LOC(buf(1)) namelen = LEN(dset_name) namelen1 = LEN(field_name) @@ -546,6 +648,9 @@ CONTAINS errcode = h5tbread_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,& start,nrecords,type_size,f_ptr) +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5tbread_field_name_f +#else END SUBROUTINE h5tbread_field_name_f_int SUBROUTINE h5tbread_field_name_f_string(loc_id,& @@ -558,16 +663,16 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: field_name + INTEGER(hsize_t), INTENT(in) :: start + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size + CHARACTER(LEN=*), INTENT(INOUT), DIMENSION(*), TARGET :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)(1:1)) @@ -579,24 +684,28 @@ CONTAINS start,nrecords,type_size,f_ptr) END SUBROUTINE h5tbread_field_name_f_string - - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_index_f_int -! -! Purpose: Writes one field -! -! Programmer: Pedro Vicente -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE h5tbwrite_field_index_f_int(loc_id,& +#endif + +#ifdef H5_DOXYGEN_FORTRAN +!> +!! \ingroup FH5TB +!! +!! \brief Overwrites a field. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to overwrite. +!! \param field_index The indexe of the fields to write. +!! \param start The zero based index record to start writing. +!! \param nrecords The number of records to write. +!! \param type_size The size of the structure type, as calculated by sizeof or storage_size. +!! \param buf Buffer with data. +!! \param errcode \fortran_error +!! + SUBROUTINE h5tbwrite_field_index_f(& +#else + SUBROUTINE h5tbwrite_field_index_f_int(& +#endif + loc_id,& dset_name,& field_index,& start,& @@ -606,15 +715,19 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: field_index + INTEGER(hsize_t), INTENT(in) :: start + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size +#ifdef H5_DOXYGEN_FORTRAN + INTEGER, INTENT(in), DIMENSION(*) :: buf +#else + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf +#endif + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)) @@ -624,6 +737,9 @@ CONTAINS errcode = h5tbwrite_field_index_c(loc_id,namelen,dset_name,field_index,& start,nrecords,type_size,f_ptr) +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5tbwrite_field_index_f +#else END SUBROUTINE h5tbwrite_field_index_f_int SUBROUTINE h5tbwrite_field_index_f_string(loc_id,& @@ -636,15 +752,15 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: field_index + INTEGER(hsize_t), INTENT(in) :: start + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size + CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)(1:1)) @@ -654,24 +770,28 @@ CONTAINS start,nrecords,type_size,f_ptr) END SUBROUTINE h5tbwrite_field_index_f_string - - -!------------------------------------------------------------------------- -! Function: h5tbread_field_index_f_int -! -! Purpose: Reads one field -! -! Programmer: Pedro Vicente -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE h5tbread_field_index_f_int(loc_id,& +#endif + +#ifdef H5_DOXYGEN_FORTRAN +!> +!! \ingroup FH5TB +!! +!! \brief Reads field. The fields are identified by index. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to read. +!! \param field_index The indexes of the fields to read. +!! \param start The start record to read from. +!! \param nrecords The number of records to read. +!! \param type_size The size in bytes of the structure associated with the table. Obtained with sizeof or storage_size. +!! \param buf Buffer with data. +!! \param errcode \fortran_error +!! + SUBROUTINE h5tbread_field_index_f(& +#else + SUBROUTINE h5tbread_field_index_f_int(& +#endif + loc_id,& dset_name,& field_index,& start,& @@ -681,15 +801,19 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: field_index + INTEGER(hsize_t), INTENT(in) :: start + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size +#ifdef H5_DOXYGEN_FORTRAN + TYPE(TYPE), INTENT(INOUT), DIMENSION(*) :: buf +#else + INTEGER, INTENT(INOUT), DIMENSION(*), TARGET :: buf +#endif + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)) @@ -697,7 +821,9 @@ CONTAINS errcode = h5tbread_field_index_c(loc_id,namelen,dset_name,field_index,& start,nrecords,type_size,f_ptr) - +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5tbread_field_index_f +#else END SUBROUTINE h5tbread_field_index_f_int SUBROUTINE h5tbread_field_index_f_string(loc_id,& @@ -710,15 +836,15 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER, INTENT(in) :: field_index + INTEGER(hsize_t), INTENT(in) :: start + INTEGER(hsize_t), INTENT(in) :: nrecords + INTEGER(size_t), INTENT(in) :: type_size + CHARACTER(LEN=*), INTENT(INOUT), DIMENSION(*), TARGET :: buf + INTEGER :: errcode + INTEGER(size_t) :: namelen TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)(1:1)) @@ -728,39 +854,48 @@ CONTAINS start,nrecords,type_size,f_ptr) END SUBROUTINE h5tbread_field_index_f_string - -!------------------------------------------------------------------------- -! Function: h5tbinsert_field_f -! -! Purpose: Inserts one field -! -! Programmer: Pedro Vicente -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE h5tbinsert_field_f_int(loc_id,& +#endif + +#ifdef H5_DOXYGEN_FORTRAN +!> +!! \ingroup FH5TB +!! +!! \brief Insert a new field into a table. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the table. +!! \param field_name The name of the field to insert. +!! \param field_type The data type of the field. +!! \param position The zero based index position where to insert the field. +!! \param buf Buffer with data. +!! \param errcode \fortran_error +!! + SUBROUTINE h5tbinsert_field_f(& +#else + SUBROUTINE h5tbinsert_field_f_int(& +#endif + loc_id,& dset_name,& field_name,& field_type,& - field_index,& + position,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: field_name + INTEGER(hid_t), INTENT(in) :: field_type + INTEGER, INTENT(in) :: position +#ifdef H5_DOXYGEN_FORTRAN + TYPE(TYPE), INTENT(in), DIMENSION(*) :: buf +#else + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf +#endif + INTEGER :: errcode + + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)) @@ -769,27 +904,31 @@ CONTAINS namelen1 = LEN(field_name) errcode = h5tbinsert_field_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,f_ptr) + field_type,position,f_ptr) +#ifdef H5_DOXYGEN_FORTRAN + END SUBROUTINE h5tbinsert_field_f +#else END SUBROUTINE h5tbinsert_field_f_int SUBROUTINE h5tbinsert_field_f_string(loc_id,& dset_name,& field_name,& field_type,& - field_index,& + position,& buf,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: field_name + INTEGER(hid_t), INTENT(in) :: field_type + INTEGER, INTENT(in) :: position + CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf + INTEGER :: errcode + + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(buf(1)(1:1)) @@ -798,36 +937,33 @@ CONTAINS namelen1 = LEN(field_name) errcode = h5tbinsert_field_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,f_ptr) + field_type,position,f_ptr) END SUBROUTINE h5tbinsert_field_f_string - -!------------------------------------------------------------------------- -! Function: h5tbdelete_field_f -! -! Purpose: Inserts one field -! -! Programmer: Pedro Vicente -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +#endif + +!> +!! \ingroup FH5TB +!! +!! \brief Deletes a field from a table. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the table. +!! \param field_name The name of the field to delete. +!! \param errcode \fortran_error +!! SUBROUTINE h5tbdelete_field_f(loc_id,& dset_name,& field_name,& errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + CHARACTER(LEN=*), INTENT(in) :: field_name + INTEGER :: errcode + + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length INTERFACE @@ -836,11 +972,11 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dset_name ! name of the dataset - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: field_name ! name of the field - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length length + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dset_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: field_name + INTEGER(size_t) :: namelen + INTEGER(size_t) :: namelen1 END FUNCTION h5tbdelete_field_c END INTERFACE @@ -850,24 +986,17 @@ CONTAINS errcode = h5tbdelete_field_c(loc_id,namelen,dset_name,namelen1,field_name) END SUBROUTINE h5tbdelete_field_f - -!------------------------------------------------------------------------- -! Function: h5tbget_table_info_f -! -! Purpose: Gets the number of records and fields of a table -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5TB +!! +!! \brief Gets the table dimensions. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to read. +!! \param nfields The number of fields. +!! \param nrecords The number of records. +!! \param errcode \fortran_error +!! SUBROUTINE h5tbget_table_info_f(loc_id,& dset_name,& nfields,& @@ -875,12 +1004,12 @@ CONTAINS errcode ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout):: nfields ! nfields - INTEGER(hsize_t), INTENT(inout):: nrecords ! nrecords - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(inout):: nfields + INTEGER(hsize_t), INTENT(inout):: nrecords + INTEGER :: errcode + INTEGER(size_t) :: namelen ! name length INTERFACE INTEGER FUNCTION h5tbget_table_info_c(loc_id,namelen,dset_name,nfields,nrecords) & @@ -888,11 +1017,11 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout):: nfields ! nfields - INTEGER(hsize_t), INTENT(inout):: nrecords ! nrecords - INTEGER(size_t) :: namelen ! name length + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(inout):: nfields + INTEGER(hsize_t), INTENT(inout):: nrecords + INTEGER(size_t) :: namelen END FUNCTION h5tbget_table_info_c END INTERFACE @@ -901,26 +1030,22 @@ CONTAINS END SUBROUTINE h5tbget_table_info_f - -!------------------------------------------------------------------------- -! Function: h5tbget_field_info_f -! -! Purpose: Get information about fields -! -! Return: Success: 0, Failure: -1 -! -! Programmer: Pedro Vicente -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! Added optional parameter for returning the maximum character length -! in the field name array. March 3, 2011 -! -!------------------------------------------------------------------------- - +!> +!! \ingroup FH5TB +!! +!! \brief Gets information about a table. +!! +!! \param loc_id Location identifier. The identifier may be that of a file or group. +!! \param dset_name The name of the dataset to read. +!! \param nfields The number of fields. +!! \param field_names An array containing the names of the fields. +!! \param field_sizes An array containing the size of the fields. +!! \param field_offsets An array containing the offsets of the fields. +!! \param type_size The size of the HDF5 datatype associated with the table +!! (i.e., the size in bytes of the HDF5 compound datatype used to define a row, or record, in the table). +!! \param errcode \fortran_error +!! \param maxlen_out Maximum character length of the field names. +!! SUBROUTINE h5tbget_field_info_f(loc_id,& dset_name,& nfields,& @@ -931,18 +1056,18 @@ CONTAINS errcode, maxlen_out ) IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! nfields - CHARACTER(LEN=*), DIMENSION(nfields), INTENT(inout) :: field_names ! field names - INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_sizes ! field sizes - INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_offsets ! field offsets - INTEGER(size_t), INTENT(inout):: type_size ! type size - INTEGER :: errcode ! error code - INTEGER(size_t), OPTIONAL :: maxlen_out ! maximum character len of the field names - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t), DIMENSION(nfields) :: namelen2 ! name lengths - INTEGER(hsize_t) :: i ! general purpose integer + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(LEN=*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in) :: nfields + CHARACTER(LEN=*), DIMENSION(nfields), INTENT(inout) :: field_names + INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_sizes + INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_offsets + INTEGER(size_t), INTENT(inout):: type_size + INTEGER :: errcode + INTEGER(size_t), OPTIONAL :: maxlen_out + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t), DIMENSION(nfields) :: namelen2 ! name lengths + INTEGER(hsize_t) :: i INTEGER(size_t) :: maxlen INTEGER(size_t) :: c_maxlen_out @@ -953,17 +1078,17 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T, HSIZE_T IMPLICIT NONE - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in):: nfields ! nfields - CHARACTER(KIND=C_CHAR), DIMENSION(1:nfields), INTENT(inout) :: field_names ! field names - INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_sizes ! field sizes - INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_offsets ! field offsets - INTEGER(size_t), INTENT(inout):: type_size ! type size - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: maxlen ! maximum length of input field names - INTEGER(size_t), DIMENSION(1:nfields) :: namelen2 ! name lengths - INTEGER(size_t) :: c_maxlen_out ! maximum character length of a field array element + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name + INTEGER(hsize_t), INTENT(in):: nfields + CHARACTER(KIND=C_CHAR), DIMENSION(1:nfields), INTENT(inout) :: field_names + INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_sizes + INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_offsets + INTEGER(size_t), INTENT(inout):: type_size + INTEGER(size_t) :: namelen + INTEGER(size_t) :: maxlen + INTEGER(size_t), DIMENSION(1:nfields) :: namelen2 + INTEGER(size_t) :: c_maxlen_out END FUNCTION h5tbget_field_info_c END INTERFACE @@ -981,7 +1106,11 @@ CONTAINS END SUBROUTINE h5tbget_field_info_f +#ifdef H5_DOXYGEN_FORTRAN +END MODULE H5TB +#else END MODULE H5TB_CONST +#endif |