summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fortran/src/CMakeLists.txt11
-rw-r--r--fortran/src/H5match_types.c2
-rw-r--r--fortran/src/H5test_kind.F9069
3 files changed, 72 insertions, 10 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 18af3f6..eff133d 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -31,7 +31,7 @@ configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${CMAKE_BINARY_D
#-----------------------------------------------------------------------------
# Setup the Fortran auto-detection utilities
-# H5test_kind.F90 used to generate H5fortran_detect.F90
+# H5test_kind.F90 used to generate H5fortran_detect.F90 and H5_KINDff.F90
# H5fortran_detect.F90 used to generate H5fort_type_defines.h
# H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.F90
#-----------------------------------------------------------------------------
@@ -65,6 +65,11 @@ add_custom_command (
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
DEPENDS H5test_FortranHavekind
)
+add_custom_target (h5_kindff
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ DEPENDS H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.F90
+)
+set_target_properties (h5_kindff PROPERTIES LINKER_LANGUAGE Fortran)
#-----------------------------------------------------------------------------
add_executable (H5fortran_detect
${HDF5_F90_BINARY_DIR}/H5fortran_detect.F90
@@ -136,7 +141,7 @@ set (f90CStub_C_HDRS
${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
)
-add_library (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS})
+add_library (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS} ${h5_kindff})
TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} " " " ")
target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
@@ -153,6 +158,7 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES
set (f90_F_SRCS
# generated files
${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+ ${HDF5_F90_BINARY_DIR}/H5_KINDff.F90
# normal distribution
${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.F90
@@ -253,6 +259,7 @@ set (mod_files
${MOD_BUILD_DIR}/h5s.mod
${MOD_BUILD_DIR}/h5t.mod
${MOD_BUILD_DIR}/h5z.mod
+ ${MOD_BUILD_DIR}/h5_kind.mod
)
install (
FILES
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index d162634..ae4ef40 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -101,7 +101,7 @@ initFfile(void)
!\n!\n\
! This file is automatically generated and contains HDF5 Fortran90 type definitions.\n!\n\
MODULE H5FORTRAN_TYPES\n\
- USE ISO_C_BINDING\n\
+ USE ISO_C_BINDING\n\
!\n\
! HDF5 integers\n\
!\n");
diff --git a/fortran/src/H5test_kind.F90 b/fortran/src/H5test_kind.F90
index 2752a2f..cb5af11 100644
--- a/fortran/src/H5test_kind.F90
+++ b/fortran/src/H5test_kind.F90
@@ -62,6 +62,7 @@ PROGRAM test_kind
CHARACTER(LEN=2) :: chr2
! subroutine rank of array being passed in
CHARACTER(LEN=2), DIMENSION(1:8), PARAMETER :: chr_rank=(/"_0","_1","_2","_3","_4","_5","_6","_7"/)
+! rank definitions
CHARACTER(LEN=70), DIMENSION(1:8), PARAMETER :: rank_dim_line=(/ &
' ', &
', DIMENSION(dims(1)) ', &
@@ -72,6 +73,7 @@ PROGRAM test_kind
', DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) ', &
', DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7))' &
/)
+! pointer to the buffer
CHARACTER(LEN=37), DIMENSION(1:8), PARAMETER :: f_ptr_line=(/ &
' f_ptr = C_LOC(buf) ', &
' f_ptr = C_LOC(buf(1)) ', &
@@ -312,7 +314,7 @@ WRITE(*,'(40(A,/))') &
WRITE(*,*) "END PROGRAM H5test_kind"
-! Generate Fortran H5* interfaces having multiple KIND interfaces.
+! (c) Generate Fortran H5* interfaces having multiple KIND interfaces.
!
! Developer's notes:
!
@@ -322,6 +324,38 @@ WRITE(*,'(40(A,/))') &
! with the Fortran 90/95 APIs codes which could never handle rank 15 array sizes.
OPEN(11,FILE='H5_KINDff.F90')
+WRITE(*,'(40(A,/))') &
+'!****h* ROBODoc/H5_KINDff.F90',&
+'!',&
+'! NAME',&
+'! H5_KIND',&
+'! ',&
+'! PURPOSE',&
+'! This module is generated at build by H5test_kind.F90 to handle all the',&
+'! detected REAL KINDs for APIs being passed REAL KINDs. Currently these ',&
+'! are H5A, H5D and H5P APIs',&
+'!',&
+'! COPYRIGHT',&
+'! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',&
+'! Copyright by The HDF Group. *',&
+'! Copyright by the Board of Trustees of the University of Illinois. *',&
+'! All rights reserved. *',&
+'! *',&
+'! This file is part of HDF5. The full HDF5 copyright notice, including *',&
+'! terms governing use, modification, and redistribution, is contained in *',&
+'! the files COPYING and Copyright.html. COPYING can be found at the root *',&
+'! of the source code distribution tree; Copyright.html can be found at the *',&
+'! root level of an installed copy of the electronic HDF5 document set and *',&
+'! is linked from the top-level documents page. It can also be found at *',&
+'! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *',&
+'! access to either file, you may request a copy from help@hdfgroup.org. *',&
+'! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',&
+'!',&
+'! AUTHOR',&
+'! H5test_kind.F90',&
+'!',&
+'!*****'
+
WRITE(11,'(a)') "MODULE H5_KIND"
WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING'
@@ -331,8 +365,12 @@ WRITE(*,'(40(A,/))') &
WRITE(11,'(A)') ' USE H5D'
WRITE(11,'(A)') ' USE H5P'
WRITE(11,'(A)') ' IMPLICIT NONE'
-
+!***************
+! H5A INTERFACES
+!***************
+!
! H5Awrite_f
+!
WRITE(11,'(A)') " INTERFACE h5awrite_f"
DO i = 1, ir
j = rkind_numbers(i)
@@ -353,7 +391,10 @@ WRITE(*,'(40(A,/))') &
ENDDO
END DO
WRITE(11,'(A)') " END INTERFACE"
-
+!***************
+! H5D INTERFACES
+!***************
+!
! H5Dwrite_f
WRITE(11,'(A)') " INTERFACE h5dwrite_f"
DO i = 1, ir
@@ -376,6 +417,10 @@ WRITE(*,'(40(A,/))') &
END DO
WRITE(11,'(A)') " END INTERFACE"
+!***************
+! H5P INTERFACES
+!***************
+!
! H5Pset_fill_value_f
WRITE(11,'(A)') " INTERFACE h5pset_fill_value_f"
DO i = 1, ir
@@ -431,9 +476,12 @@ WRITE(*,'(40(A,/))') &
WRITE(11,'(A)') " END INTERFACE"
WRITE(11,'(A)') 'CONTAINS'
+
!**********************
-! H5A interfaces
+! H5A APIs
!**********************
+!
+! H5Awrite_f
DO i = 1, ir
k = rkind_numbers(i)
WRITE(chr2,'(I2)') k
@@ -453,6 +501,8 @@ WRITE(*,'(40(A,/))') &
WRITE(11,'(A)') ' END SUBROUTINE h5awrite_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j)
ENDDO
ENDDO
+!
+! H5Aread_f
DO i = 1, ir
k = rkind_numbers(i)
WRITE(chr2,'(I2)') k
@@ -472,9 +522,12 @@ WRITE(*,'(40(A,/))') &
WRITE(11,'(A)') ' END SUBROUTINE h5aread_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j)
ENDDO
ENDDO
+
!**********************
-! H5D interfaces
+! H5D APIs
!**********************
+!
+! h5dread_f
DO i = 1, ir
k = rkind_numbers(i)
WRITE(chr2,'(I2)') k
@@ -509,7 +562,8 @@ WRITE(*,'(40(A,/))') &
ENDDO
ENDDO
-
+!
+! h5dwrite_f
DO i = 1, ir
k = rkind_numbers(i)
WRITE(chr2,'(I2)') k
@@ -545,8 +599,9 @@ WRITE(*,'(40(A,/))') &
ENDDO
!**********************
-! H5P interfaces
+! H5P APIs
!**********************
+!
! H5Pset_fill_value_f
DO i = 1, ir
k = rkind_numbers(i)