diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-10-14 18:39:47 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-10-14 18:39:47 (GMT) |
commit | 76e215174ab2afc3612e92b719d788b7d6c7f26f (patch) | |
tree | 00e1b9e99a8b1c30ad46f2f2543e2627020f5854 /fortran/src/H5Aff_F03.f90 | |
parent | b92a7abb344f9965853464697c64503c5953ee49 (diff) | |
download | hdf5-76e215174ab2afc3612e92b719d788b7d6c7f26f.zip hdf5-76e215174ab2afc3612e92b719d788b7d6c7f26f.tar.gz hdf5-76e215174ab2afc3612e92b719d788b7d6c7f26f.tar.bz2 |
[svn-r21568] Description:
Merged robodoc headers from trunk in the 1.8 branch, remove functions that should have not been merged into the 1.8 branch, removed the robodoc docomentation.
Tested: jam (gnu, intel, pgi)
Diffstat (limited to 'fortran/src/H5Aff_F03.f90')
-rw-r--r-- | fortran/src/H5Aff_F03.f90 | 242 |
1 files changed, 192 insertions, 50 deletions
diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 index e43e457..b9e6c92 100644 --- a/fortran/src/H5Aff_F03.f90 +++ b/fortran/src/H5Aff_F03.f90 @@ -173,6 +173,57 @@ MODULE H5A_PROVISIONAL CONTAINS +!****s* H5A (F03)/h5awrite_f_F90 +! +! NAME +! h5awrite_f_F90 +! +! PURPOSE +! Writes an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! dims - Array to hold corresponding dimension sizes of data buffer buf; +! dim(k) has value of the k-th dimension of buffer buf; +! values are ignored if buf is a scalar +! buf - Data buffer; may be a scalar or an array +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! +! Fortran90 Interface: +!! SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, dims, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE , INTENT(IN) :: buf +!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5awrite_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE @@ -201,8 +252,8 @@ CONTAINS DIMENSION(dims(1)), TARGET :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf) + + f_ptr = C_LOC(buf(1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5awrite_integer_1 @@ -221,7 +272,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) @@ -238,7 +289,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) @@ -257,7 +308,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) @@ -276,7 +327,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) @@ -295,7 +346,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5awrite_integer_6 @@ -313,7 +364,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) @@ -348,7 +399,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) @@ -368,7 +419,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) @@ -388,7 +439,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5awrite_real_3 @@ -407,7 +458,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5awrite_real_4 @@ -445,7 +496,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5awrite_real_6 @@ -463,7 +514,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5awrite_real_7 @@ -500,8 +551,6 @@ CONTAINS END SUBROUTINE h5awrite_char_scalar_fix - - SUBROUTINE h5awrite_char_1(attr_id, memtype_id, buf, dims, hdferr) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE @@ -626,22 +675,75 @@ CONTAINS END SUBROUTINE h5awrite_char_7 -!****s* H5A (F03)/h5aread_f +!****s* H5A (F03)/h5awrite_f_F03 ! ! NAME -! h5aread_f +! h5awrite_f_F03 +! +! PURPOSE +! Writes an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! buf - Data buffer; may be a scalar or an array +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! +! Fortran2003 Interface: +!! SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE(C_PTR) , INTENT(IN) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5awrite_ptr(attr_id, mem_type_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(IN), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = h5awrite_f_c(attr_id, mem_type_id, buf) + + END SUBROUTINE h5awrite_ptr + +!****s* H5A (F03)/h5aread_f_F90 +! +! NAME +! h5aread_f_F90 ! ! PURPOSE ! Reads an attribute. ! ! Inputs: -! attr_id - attribute identifier -! memtype_id - attribute memory type identifier -! dims - 1D array of size 7, stores sizes of the -! - buf array dimensions. +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! dims - Array to hold corresponding dimension sizes of data buffer buf; +! dim(k) has value of the k-th dimension of buffer buf; +! values are ignored if buf is a scalar +! ! Outputs: -! buf - buffer to read attribute data in -! hdferr - Returns 0 if successful and -1 if fails +! buf - Data buffer; may be a scalar or an array +! hdferr - Returns 0 if successful and -1 if fails +! ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -663,7 +765,13 @@ CONTAINS ! This function is overloaded to write INTEGER, ! REAL, DOUBLE PRECISION and CHARACTER buffers ! up to 7 dimensions. -! +! Fortran90 Interface: +!! SUBROUTINE h5aread_f(attr_id, memtype_id, buf, dims, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE , INTENT(INOUT) :: buf +!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims +!! INTEGER , INTENT(OUT) :: hdferr !***** SUBROUTINE h5aread_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) USE, INTRINSIC :: ISO_C_BINDING @@ -692,7 +800,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_integer_1 @@ -709,7 +817,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_integer_2 @@ -727,7 +835,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_integer_3 @@ -745,7 +853,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_integer_4 @@ -763,7 +871,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_integer_5 @@ -781,7 +889,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_integer_6 @@ -799,7 +907,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_integer_7 @@ -833,7 +941,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_real_1 @@ -851,7 +959,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_real_2 @@ -870,7 +978,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_real_3 @@ -888,7 +996,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_real_4 @@ -906,7 +1014,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_real_5 @@ -924,7 +1032,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_real_6 @@ -942,7 +1050,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code TYPE(C_PTR) :: f_ptr - f_ptr = C_LOC(buf) + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) END SUBROUTINE h5aread_real_7 @@ -1103,24 +1211,58 @@ CONTAINS END SUBROUTINE h5aread_char_7 - SUBROUTINE h5awrite_ptr(attr_id, mem_type_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - TYPE(C_PTR), INTENT(IN), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - hdferr = h5awrite_f_c(attr_id, mem_type_id, buf) - - END SUBROUTINE h5awrite_ptr +!****s* H5A (F03)/h5aread_f_F03 +! +! NAME +! h5aread_f_F03 +! +! PURPOSE +! Reads an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! +! Outputs: +! buf - Data buffer; may be a scalar or an array +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! Fortran2003 Interface: +!! SUBROUTINE h5aread_f(attr_id, memtype_id, buf, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE(C_PTR) , INTENT(INOUT) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!***** SUBROUTINE h5aread_ptr(attr_id, mem_type_id, buf, hdferr) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - TYPE(C_PTR), INTENT(IN), TARGET :: buf + TYPE(C_PTR), INTENT(INOUT), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr ! Error code hdferr = h5aread_f_c(attr_id, mem_type_id, buf) |