summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Fff.F90
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2024-02-15 22:51:33 (GMT)
committerGitHub <noreply@github.com>2024-02-15 22:51:33 (GMT)
commit413d10f6e3d4db5341413ba7cd4f819eb5156a51 (patch)
tree8741384bb37a09d0e8d31116c64d9065a0b046f3 /fortran/src/H5Fff.F90
parent987a734e759c82c65a661ae6090b2252d63a7aec (diff)
parent424cb6ecd35bc262120e250ee25706c3d3c3c15d (diff)
downloadhdf5-413d10f6e3d4db5341413ba7cd4f819eb5156a51.zip
hdf5-413d10f6e3d4db5341413ba7cd4f819eb5156a51.tar.gz
hdf5-413d10f6e3d4db5341413ba7cd4f819eb5156a51.tar.bz2
Merge pull request #4019 from lrknox/1_14_dev_sync2_lrk
* Update upload- artifact to match download version (#3929) * Reorg and update options for doc and cmake config (#3934) * Add binary build for linux S3 (#3936) * Clean up Doxygen for szip functions and constants (#3943) * Replace off_t with HDoff_t internally (#3944) off_t is a 32-bit signed value on Windows, so we should use HDoff_t (which is __int64 on Windows) internally instead. Also defines HDftell on Windows to be _ftelli64(). * Fix chid_t to hid_t (#3948) * Fortran API work. (#3941) * - Added Fortran APIs: H5FGET_INTENT_F, H5SSELECT_ITER_CREATE_F, H5SSEL_ITER_GET_SEQ_LIST_F, H5SSELECT_ITER_CLOSE_F, H5S_mp_H5SSELECT_ITER_RESET_F - Added Fortran Parameters: H5S_SEL_ITER_GET_SEQ_LIST_SORTED_F, H5S_SEL_ITER_SHARE_WITH_DATASPACE_F - Added tests for new APIs - Removed H5F C wrapper stubs - Documentation misc. cleanup. * Add the user test program in HDFFV-9174 for committed types. (#3937) Add the user test program for committed types in HDFFV-9174 * Remove cached datatype conversion path table entries on file close (#3942) * fixed BIND name (#3957) * update H5Ssel_iter_reset_f test * Change 'extensible' to 'fixed' in H5FA code (#3964) * RF: move codespell configuration into .codespellrc so could be used locally as well (#3958) * Add RELEASE.txt note for the fix for issue #1256 (#3955) * Fix doxygen errors (#3962) * Add API support for Fortran MPI_F08 module definitions. (#3959) * revert to using c-stub for _F08 MPI APIs * use mpi compiler wrappers for cmake and nvhpc * Added a GitHub Codespaces configuration. (#3966) * Fixed XL and gfortran errors (#3968) * h5 compiler wrappers now pass all arguments passed to it to the compile line (#3954) * The issue was that the "allargs" variable was not being used in the final command of the compiler wrapper. Any entries containing an escaped quote (\", \') or other non-matching argument (*) would not be passed to the compile line. I have fixed this problem by ensuring all arguments passed to the compiler wrapper are now included in the compile line. * Add binary testing to CI testing (#3971) * Replace 'T2' with ' ' to avoid failure to match expected output due to (#3975) * Clarify vlen string datatype message (#3950) * append '-WF,' when passing C preprocessor directives to the xlf compiler (#3976) * Create CITATION.cff (#3927) Add citation source based on http://web.archive.org/web/20230610185232/https://portal.hdfgroup.org/display/knowledge/How+do+I+properly+cite+HDF5%The space difference in the Fortran examples must be fixed to match the expected output for compression filter examples. * corrected warning: implicit conversion changes signedness (#3982) * Skip mac bintest until more reliable (#3983) * Make platform specific test presets for windows and macs (#3988) * chore: fix typo (#3989) * Add a missing left parenthesis in RELEASE.txt. (#3990) * Remove ADB signature from RELEASE.txt. (#3986) * Bump the github-actions group with 6 updates (#3981) * Sync API tests with vol-tests (#3940) * Fix for github issue #2414: segfault when copying dataset with attrib… (#3967) * Fix for github issue #2414: segfault when copying dataset with attributes. This also fixes github issue #3241: segfault when copying dataset. Need to set the location via H5T_set_loc() of the src datatype when copying dense attributes. Otherwise the vlen callbacks are not set up therefore causing seg fault when doing H5T_convert() -> H5T__conv_vlen(). * Fix broken links caused by examples relocation. (#3995) * Add abi-complience check and upload to releases (#3996) * Fix h5watch test failures to ignore system warnings on ppc64le. (#3997) * Remove oneapi/clang compiler printf() type warning. (#3994) * Updated information about obtaining the HDF5 source code to use the repos. (#3972) * Fix overwritten preset names (#4000) * Fix incompatible pointer type warnings in object reference examples (#3999) * Fix build issue and some warnings in H5_api_dataset_test.c (#3998) * Modern C++ dtor declarations (#1830) * C++ dtor modernization - Replaced a bunch of empty dtors with `= default` - Removed deprecated `throw()`. In C++11, dtors are `noexcept` by default. * remove incorrect check for environ (#4002) * Add a missing file into Makefile.am for MinGW Autotools build error. (#4004) * Issue #1824: Replaced most remaining sprintf with safer snprint (#4003) * Add hl and cpp ABI reports to daily build (#4006) * Don't add files and directories with names that begin with ., or that match *autom4te* to release tar & zip files. (#4009) * Fix some output issues with ph5diff (#4008) * Update install texts (#4010) * Add C in project line for CMake to fix #4012. (#4014) * separate out individual checks for string removal (#4015) * Add compound subset ops on attributes to API tests (#4005) ---------
Diffstat (limited to 'fortran/src/H5Fff.F90')
-rw-r--r--fortran/src/H5Fff.F90166
1 files changed, 106 insertions, 60 deletions
diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90
index 79aa5a7..e8b765b 100644
--- a/fortran/src/H5Fff.F90
+++ b/fortran/src/H5Fff.F90
@@ -639,19 +639,21 @@ CONTAINS
!!
SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
+ INTEGER(HID_T), INTENT(IN) :: file_id
INTEGER(HID_T), INTENT(OUT) :: prop_id
- INTEGER, INTENT(OUT) :: hdferr
+ INTEGER , INTENT(OUT) :: hdferr
INTERFACE
- INTEGER FUNCTION h5fget_create_plist_c(file_id, prop_id) BIND(C,NAME='h5fget_create_plist_c')
+ INTEGER(HID_T) FUNCTION H5Fget_create_plist(file_id) BIND(C,NAME='H5Fget_create_plist')
IMPORT :: HID_T
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
- INTEGER(HID_T), INTENT(OUT) :: prop_id
- END FUNCTION h5fget_create_plist_c
+ INTEGER(HID_T), VALUE :: file_id
+ END FUNCTION H5Fget_create_plist
END INTERFACE
- hdferr = h5fget_create_plist_c(file_id, prop_id)
+ prop_id = H5Fget_create_plist(file_id)
+
+ hdferr = 0
+ IF(prop_id.LT.0) hdferr = -1
END SUBROUTINE h5fget_create_plist_f
!>
@@ -667,19 +669,21 @@ CONTAINS
!!
SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
+ INTEGER(HID_T), INTENT(IN) :: file_id
INTEGER(HID_T), INTENT(OUT) :: access_id
INTEGER, INTENT(OUT) :: hdferr
INTERFACE
- INTEGER FUNCTION h5fget_access_plist_c(file_id, access_id) BIND(C,NAME='h5fget_access_plist_c')
+ INTEGER(HID_T) FUNCTION H5Fget_access_plist(file_id) BIND(C,NAME='H5Fget_access_plist')
IMPORT :: HID_T
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
- INTEGER(HID_T), INTENT(OUT) :: access_id
- END FUNCTION h5fget_access_plist_c
+ INTEGER(HID_T), VALUE :: file_id
+ END FUNCTION H5Fget_access_plist
END INTERFACE
- hdferr = h5fget_access_plist_c(file_id, access_id)
+ access_id = H5Fget_access_plist(file_id)
+
+ hdferr = 0
+ IF(access_id.LT.0) hdferr = -1
END SUBROUTINE h5fget_access_plist_f
@@ -835,37 +839,41 @@ CONTAINS
!>
!! \ingroup FH5F
!!
-!! \brief Gets number of the objects open within a file
+!! \brief Gets number of the objects open within a file.
!!
-!! \param file_id File identifier.
+!! \param file_id File identifier
!! \param obj_type Type of the object; possible values are:
!! \li H5F_OBJ_FILE_F
!! \li H5F_OBJ_DATASET_F
!! \li H5F_OBJ_GROUP_F
!! \li H5F_OBJ_DATATYPE_F
!! \li H5F_OBJ_ALL_F
-!! \param obj_count Number of open objects.
+!! \param obj_count Number of open objects
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Fget_obj_count()
!!
SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
- INTEGER, INTENT(IN) :: obj_type
+ INTEGER(HID_T) , INTENT(IN) :: file_id
+ INTEGER , INTENT(IN) :: obj_type
INTEGER(SIZE_T), INTENT(OUT) :: obj_count
- INTEGER, INTENT(OUT) :: hdferr
+ INTEGER , INTENT(OUT) :: hdferr
+
INTERFACE
- INTEGER FUNCTION h5fget_obj_count_c(file_id, obj_type, obj_count) BIND(C,NAME='h5fget_obj_count_c')
+ INTEGER(SIZE_T) FUNCTION H5Fget_obj_count(file_id, obj_type) BIND(C,NAME='H5Fget_obj_count')
+ IMPORT :: C_INT
IMPORT :: HID_T, SIZE_T
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
- INTEGER, INTENT(IN) :: obj_type
- INTEGER(SIZE_T), INTENT(OUT) :: obj_count
- END FUNCTION h5fget_obj_count_c
+ INTEGER(HID_T), VALUE :: file_id
+ INTEGER(C_INT), VALUE :: obj_type
+ END FUNCTION H5Fget_obj_count
END INTERFACE
- hdferr = h5fget_obj_count_c(file_id, obj_type, obj_count)
+ obj_count = H5Fget_obj_count(file_id, INT(obj_type, C_INT))
+
+ hdferr = 0
+ IF(obj_count.LT.0) hdferr = -1
! Don't include objects created by H5open in the H5F_OBJ_ALL_F count
IF(file_id.EQ.INT(H5F_OBJ_ALL_F,HID_T))THEN
@@ -877,47 +885,51 @@ CONTAINS
!>
!! \ingroup FH5F
!!
-!! \brief Get list of open objects identifiers within a file
+!! \brief Get list of open objects identifiers within a file.
!!
-!! \param file_id File identifier.
+!! \param file_id File identifier
!! \param obj_type Type of the object; possible values are:
!! \li H5F_OBJ_FILE_F
!! \li H5F_OBJ_DATASET_F
!! \li H5F_OBJ_GROUP_F
!! \li H5F_OBJ_DATATYPE_F
!! \li H5F_OBJ_ALL_F
-!! \param max_objs Maximum # of objects to retrieve.
-!! \param obj_ids Array of open object identifiers.
+!! \param max_objs Maximum # of objects to retrieve
+!! \param obj_ids Array of open object identifiers
!! \param hdferr \fortran_error
-!! \param num_objs Number of open objects.
+!! \param num_objs Number of open objects
!!
!! See C API: @ref H5Fget_obj_ids()
!!
SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, max_objs, obj_ids, hdferr, num_objs)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
- INTEGER, INTENT(IN) :: obj_type
+ INTEGER(HID_T) , INTENT(IN) :: file_id
+ INTEGER , INTENT(IN) :: obj_type
INTEGER(SIZE_T), INTENT(IN) :: max_objs
- INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
- INTEGER, INTENT(OUT) :: hdferr
+ INTEGER(HID_T) , DIMENSION(*), INTENT(INOUT) :: obj_ids
+ INTEGER , INTENT(OUT) :: hdferr
INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs
INTEGER(SIZE_T) :: c_num_objs ! Number of open objects of the specified type
INTERFACE
- INTEGER FUNCTION h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) &
- BIND(C,NAME='h5fget_obj_ids_c')
+ INTEGER(SIZE_T) FUNCTION H5Fget_obj_ids(file_id, obj_type, max_objs, obj_ids) &
+ BIND(C,NAME='H5Fget_obj_ids')
+ IMPORT :: C_INT
IMPORT :: HID_T, SIZE_T
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: file_id
- INTEGER, INTENT(IN) :: obj_type
- INTEGER(SIZE_T), INTENT(IN) :: max_objs
- INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
- INTEGER(SIZE_T), INTENT(OUT) :: c_num_objs
- END FUNCTION h5fget_obj_ids_c
+ INTEGER(HID_T) , VALUE :: file_id
+ INTEGER(C_INT) , VALUE :: obj_type
+ INTEGER(SIZE_T), VALUE :: max_objs
+ INTEGER(HID_T) , DIMENSION(*) :: obj_ids
+ END FUNCTION H5Fget_obj_ids
END INTERFACE
- hdferr = h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs)
+ c_num_objs = H5Fget_obj_ids(file_id, INT(obj_type, C_INT), max_objs, obj_ids)
+
+ hdferr = 0
+ IF(c_num_objs.LT.0) hdferr = -1
+
IF (PRESENT(num_objs)) num_objs= c_num_objs
END SUBROUTINE h5fget_obj_ids_f
@@ -926,8 +938,8 @@ CONTAINS
!!
!! \brief Get amount of free space within a file.
!!
-!! \param file_id File identifier.
-!! \param free_space Amount of free space in file.
+!! \param file_id File identifier
+!! \param free_space Amount of free space in file
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Fget_freespace()
@@ -955,9 +967,9 @@ CONTAINS
!!
!! \brief Gets the name of the file from the object identifier.
!!
-!! \param obj_id Object identifier.
-!! \param buf Buffer to store the read name.
-!! \param size Actual size of the name.
+!! \param obj_id Object identifier
+!! \param buf Buffer to store the read name
+!! \param size Actual size of the name
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Fget_name()
@@ -990,8 +1002,8 @@ CONTAINS
!!
!! \brief Retrieves the file size of the HDF5 file.
!!
-!! \param file_id File identifier.
-!! \param size File size.
+!! \param file_id File identifier
+!! \param size File size
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Fget_filesize()
@@ -1018,8 +1030,8 @@ CONTAINS
!!
!! \brief Retrieves the file number of the HDF5 file.
!!
-!! \param file_id File identifier.
-!! \param fileno File number.
+!! \param file_id File identifier
+!! \param fileno File number
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Fget_fileno()
@@ -1046,11 +1058,11 @@ CONTAINS
!!
!! \brief Retrieves a copy of the image of an existing, open file.
!!
-!! \param file_id Target file identifier.
-!! \param buf_ptr Pointer to the buffer into which the image of the HDF5 file is to be copied.
-!! \param buf_len Size of the supplied buffer.
+!! \param file_id Target file identifier
+!! \param buf_ptr Pointer to the buffer into which the image of the HDF5 file is to be copied
+!! \param buf_len Size of the supplied buffer
!! \param hdferr \fortran_error
-!! \param buf_size Returns the size in bytes of the buffer required to store the file image, no data will be copied.
+!! \param buf_size Returns the size in bytes of the buffer required to store the file image, no data will be copied
!!
!! See C API: @ref H5Fget_file_image()
!!
@@ -1094,8 +1106,8 @@ CONTAINS
!! \brief Gets the value of the "minimize dataset headers" value which creates
!! smaller dataset object headers when its set and no attributes are present.
!!
-!! \param file_id Target file identifier.
-!! \param minimize Value of the setting.
+!! \param file_id Target file identifier
+!! \param minimize Value of the setting
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Fget_dset_no_attrs_hint()
@@ -1129,8 +1141,8 @@ CONTAINS
!! \brief Sets the value of the "minimize dataset headers" value which creates
!! smaller dataset object headers when its set and no attributes are present.
!!
-!! \param file_id Target file identifier.
-!! \param minimize Value of the setting.
+!! \param file_id Target file identifier
+!! \param minimize Value of the setting
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Fset_dset_no_attrs_hint()
@@ -1192,5 +1204,39 @@ CONTAINS
END SUBROUTINE H5Fget_info_f
+!>
+!! \ingroup FH5F
+!!
+!! \brief Determines the read/write or read-only status of a file.
+!!
+!! \param file_id File identifier
+!! \param intent Access mode flag as originally passed with H5Fopen_f()
+!! \param hdferr \fortran_error
+!!
+!! See C API: @ref H5Fget_intent()
+!!
+ SUBROUTINE h5fget_intent_f(file_id, intent, hdferr)
+ IMPLICIT NONE
+ INTEGER(HID_T), INTENT(IN) :: file_id
+ INTEGER, INTENT(OUT) :: intent
+ INTEGER, INTENT(OUT) :: hdferr
+
+ INTEGER(C_INT) :: c_intent
+
+ INTERFACE
+ INTEGER(C_INT) FUNCTION H5Fget_intent(file_id, intent) BIND(C,NAME='H5Fget_intent')
+ IMPORT :: C_INT
+ IMPORT :: HID_T
+ IMPLICIT NONE
+ INTEGER(HID_T), VALUE :: file_id
+ INTEGER(C_INT) :: intent
+ END FUNCTION H5Fget_intent
+ END INTERFACE
+
+ hdferr = INT(H5Fget_intent(file_id, c_intent))
+ intent = INT(c_intent)
+
+ END SUBROUTINE h5fget_intent_f
+
END MODULE H5F