summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'fortran')
-rw-r--r--fortran/examples/Makefile.in11
-rw-r--r--fortran/src/H5Df.c24
-rw-r--r--fortran/src/H5Tff.f9057
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--fortran/test/tH5T.f9045
5 files changed, 85 insertions, 54 deletions
diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in
index 12460f3..410f1e9 100644
--- a/fortran/examples/Makefile.in
+++ b/fortran/examples/Makefile.in
@@ -683,7 +683,7 @@ install-data-local:
uninstall-local:
@$(MAKE) $(AM_MAKEFLAGS) uninstall-examples
-install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
+install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
@for f in X $(INSTALL_FILES); do \
if test $$f != X; then \
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \
@@ -695,6 +695,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
(set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\
fi; \
done
+ @for f in X $(INSTALL_TOP_FILES); do \
+ if test $$f != X; then \
+ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
+ chmod a-x $(EXAMPLETOPDIR)/$$f;\
+ fi; \
+ done
@for f in X $(INSTALL_TOP_SCRIPT_FILES); do \
if test $$f != X; then \
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
@@ -708,6 +714,9 @@ uninstall-examples:
@if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \
fi
+ @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \
+ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \
+ fi
@if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \
set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \
fi
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index e1aa98e..ab7adf7 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -2401,16 +2401,6 @@ nh5dread_f_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id,
hid_t c_xfer_prp;
herr_t status;
-/* int i, j; */
-/* typedef struct { */
-/* int x; */
-/* float y; */
-/* } r_dual_c; */
-
-/* r_dual_c *name=buf; */
-
-/* r_dual_c access[4][4]; */
-
c_dset_id = (hid_t)*dset_id;
c_mem_type_id = (hid_t)*mem_type_id;
c_mem_space_id = (hid_t)*mem_space_id;
@@ -2419,22 +2409,10 @@ nh5dread_f_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id,
/*
* Call H5Dread function.
*/
-
-/* printf("%i %i %i %i %i \n",c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp); */
-
status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf);
if ( status < 0 ) return ret_value;
-/* for ( i=0; i<4; ++i) */
-/* for (j = 0; j<4; ++j) { */
-/* access[i][j] = name[i*4+j]; */
-/* /\* access[i].x = access[i].x + 1; *\/ */
-/* printf("x = %i \n", access[i][j].x); */
-/* printf("y = %f \n", access[i][j].y); */
-/* } */
-
-
- ret_value = 1;
+ ret_value = 0;
return ret_value;
}
/****if* H5Df/nh5dget_access_plist_c
diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90
index f5369d0..fd857a8 100644
--- a/fortran/src/H5Tff.f90
+++ b/fortran/src/H5Tff.f90
@@ -2050,17 +2050,19 @@ CONTAINS
! h5tcreate_f
!
! PURPOSE
-! Creates a new dataype
+! Creates a new datatype.
!
! INPUTS
-! class - datatype class, possible values are:
-! H5T_COMPOUND_F
-! H5T_ENUM_F
-! H5T_OPAQUE_F
-! size - datattype size
+! class - Datatype class can be one of:
+! H5T_COMPOUND_F
+! H5T_ENUM_F
+! H5T_OPAQUE_F
+! H5T_STRING_F
+!
+! size - Size of the datatype.
! OUTPUTS
-! type_id - datatype identifier
-! hdferr - Returns 0 if successful and -1 if fails
+! type_id - Datatype identifier.
+! hdferr - Returns 0 if successful and -1 if fails
!
! AUTHOR
! Elena Pourmal
@@ -2072,29 +2074,26 @@ CONTAINS
! port). March 7, 2001
! SOURCE
SUBROUTINE h5tcreate_f(class, size, type_id, hdferr)
- IMPLICIT NONE
- INTEGER, INTENT(IN) :: class ! Datatype class can be one of
- ! H5T_COMPOUND_F
- ! H5T_ENUM_F
- ! H5T_OPAQUE_F
- INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the datatype
- INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier
- INTEGER, INTENT(OUT) :: hdferr ! Error code
+ IMPLICIT NONE
+ INTEGER , INTENT(IN) :: class
+ INTEGER(SIZE_T), INTENT(IN) :: size
+ INTEGER(HID_T) , INTENT(OUT) :: type_id
+ INTEGER , INTENT(OUT) :: hdferr
!*****
- INTERFACE
- INTEGER FUNCTION h5tcreate_c(class, size, type_id)
- USE H5GLOBAL
- !DEC$IF DEFINED(HDF5F90_WINDOWS)
- !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCREATE_C'::h5tcreate_c
- !DEC$ENDIF
- INTEGER, INTENT(IN) :: class
- INTEGER(SIZE_T), INTENT(IN) :: size
- INTEGER(HID_T), INTENT(OUT) :: type_id
- END FUNCTION h5tcreate_c
- END INTERFACE
+ INTERFACE
+ INTEGER FUNCTION h5tcreate_c(class, size, type_id)
+ USE H5GLOBAL
+ !DEC$IF DEFINED(HDF5F90_WINDOWS)
+ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCREATE_C'::h5tcreate_c
+ !DEC$ENDIF
+ INTEGER, INTENT(IN) :: class
+ INTEGER(SIZE_T), INTENT(IN) :: size
+ INTEGER(HID_T), INTENT(OUT) :: type_id
+ END FUNCTION h5tcreate_c
+ END INTERFACE
- hdferr = h5tcreate_c(class, size, type_id)
- END SUBROUTINE h5tcreate_f
+ hdferr = h5tcreate_c(class, size, type_id)
+ END SUBROUTINE h5tcreate_f
!
!****s* H5T/h5tinsert_f
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index c963c83..e0fd502 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 103
+LT_VERS_REVISION = 114
LT_VERS_AGE = 0
# Include src directory in both Fortran and C flags (C compiler is used
diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90
index 6af1ba6..9605c45 100644
--- a/fortran/test/tH5T.f90
+++ b/fortran/test/tH5T.f90
@@ -108,6 +108,51 @@
INTEGER(HID_T) :: decoded_sid1
INTEGER(HID_T) :: decoded_tid1
+ INTEGER(HID_T) :: fixed_str1, fixed_str2
+ LOGICAL :: are_equal
+ INTEGER(SIZE_T), PARAMETER :: str_size = 10
+ INTEGER(SIZE_T) :: query_size
+
+ ! Test h5tcreate_f with H5T_STRING_F option:
+ ! Create fixed-length string in two ways and make sure they are the same
+
+ CALL h5tcopy_f(H5T_FORTRAN_S1, fixed_str1, error)
+ CALL check("h5tcopy_f", error, total_error)
+ CALL h5tset_size_f(fixed_str1, str_size, error)
+ CALL check("h5tset_size_f", error, total_error)
+ CALL h5tset_strpad_f(fixed_str1, H5T_STR_NULLTERM_F, error)
+ CALL check("h5tset_strpad_f", error, total_error)
+
+ CALL h5tcreate_f(H5T_STRING_F, str_size, fixed_str2, error)
+ CALL check("h5tcreate_f", error, total_error)
+ CALL h5tset_strpad_f(fixed_str2, H5T_STR_NULLTERM_F, error)
+ CALL check("h5tset_strpad_f", error, total_error)
+
+ CALL h5tequal_f(fixed_str1, fixed_str2, are_equal, error)
+ IF(.NOT.are_equal)THEN
+ CALL check("h5tcreate_f", -1, total_error)
+ ENDIF
+
+ CALL h5tget_size_f(fixed_str1, query_size, error)
+ CALL check("h5tget_size_f", error, total_error)
+
+ IF(query_size.NE.str_size)THEN
+ CALL check("h5tget_size_f", -1, total_error)
+ ENDIF
+
+ CALL h5tget_size_f(fixed_str2, query_size, error)
+ CALL check("h5tget_size_f", error, total_error)
+
+ IF(query_size.NE.str_size)THEN
+ CALL check("h5tget_size_f", -1, total_error)
+ ENDIF
+
+ CALL h5tclose_f(fixed_str1,error)
+ CALL check("h5tclose_f", error, total_error)
+
+ CALL h5tclose_f(fixed_str2,error)
+ CALL check("h5tclose_f", error, total_error)
+
data_dims(1) = dimsize
!
! Initialize data buffer.