diff options
Diffstat (limited to 'fortran/test/tH5T.f90')
-rw-r--r-- | fortran/test/tH5T.f90 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90 index d546cd0..d7669af 100644 --- a/fortran/test/tH5T.f90 +++ b/fortran/test/tH5T.f90 @@ -81,6 +81,7 @@ INTEGER :: num_members ! Number of members in the compound datatype CHARACTER(LEN=256) :: member_name INTEGER :: len ! Lenght of the name of the compound datatype member + INTEGER :: member_index ! index of the field LOGICAL :: flag INTEGER(HSIZE_T), DIMENSION(3) :: array_dims=(/2,3,4/) INTEGER :: array_dims_range = 3 @@ -305,12 +306,20 @@ endif ! ! Go through the members and find out their names and offsets. + ! Also see if name corresponds to the index ! do i = 1, num_members CALL h5tget_member_name_f(dtype_id, i-1, member_name, len, error) CALL check("h5tget_member_name_f", error, total_error) CALL h5tget_member_offset_f(dtype_id, i-1, offset_out, error) CALL check("h5tget_member_offset_f", error, total_error) + CALL h5tget_member_index_f(dtype_id, member_name(1:len), member_index, error) + CALL check("h5tget_member_index_f", error, total_error) + if(member_index .ne. i-1) then + write(*,*) "Index returned is incorrect" + write(*,*) member_index, i-1 + total_error = total_error + 1 + endif CHECK_NAME: SELECT CASE (member_name(1:len)) CASE("char_field") |