summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2016-09-23 16:31:43 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2016-09-23 16:31:43 (GMT)
commit7b056aadff59de5760246d6dff3f5402d0b887bf (patch)
treeffe00af53b177ebf16cbe6f2c8463f2dae5f82d9 /hl
parent7cbf491e29cb9c2cfa3fbbd232f48a51cfaebff4 (diff)
downloadhdf5-7b056aadff59de5760246d6dff3f5402d0b887bf.zip
hdf5-7b056aadff59de5760246d6dff3f5402d0b887bf.tar.gz
hdf5-7b056aadff59de5760246d6dff3f5402d0b887bf.tar.bz2
Added SEQUENCE to derived types for NAG:
Section 81 of the compiler manual, e.g. at http://www.nag.co.uk/nagware/np/r61_doc/np61_manual.pdf covers details about the compiler's internal representations, including " Fortran derived types are translated into C structs. If BIND(C) or SEQUENCE is used, the order of the items within the struct is the same as the order within the derived type definition. Otherwise, the order of items is permuted to put larger types at the front of the struct so as to improve alignment and reduce storage; the C output code can be inspected to determine the ordering used. " Removed INTENT(IN) to fix segfaults in C APIs for TYPE(C_PTR). Tested: NAG (gnu)
Diffstat (limited to 'hl')
-rw-r--r--hl/fortran/src/H5TBff.F903
-rw-r--r--hl/fortran/test/tsttable.F904
2 files changed, 4 insertions, 3 deletions
diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90
index a31c751..5d1ee35 100644
--- a/hl/fortran/src/H5TBff.F90
+++ b/hl/fortran/src/H5TBff.F90
@@ -376,7 +376,8 @@ CONTAINS
INTEGER(size_t), INTENT(in) :: dst_size ! The size of the structure type
INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_offset ! An array containing the offsets of the fields
INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: dst_sizes ! An array containing the sizes of the fields
- TYPE(C_PTR), INTENT(OUT) :: dst_buf ! Buffer with data
+ TYPE(C_PTR) :: dst_buf ! Buffer with data !! do not use INTENT, causes NAG
+ ! to segfault in C APIs
INTEGER :: errcode ! error code
INTEGER(size_t) :: namelen ! name length
diff --git a/hl/fortran/test/tsttable.F90 b/hl/fortran/test/tsttable.F90
index bffbb03..3cf8fed 100644
--- a/hl/fortran/test/tsttable.F90
+++ b/hl/fortran/test/tsttable.F90
@@ -561,6 +561,7 @@ SUBROUTINE test_table2()
INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(10) ! This should map to REAL*8 on most modern processors
TYPE particle_t
+ SEQUENCE
CHARACTER(LEN=11) :: name
INTEGER(KIND=i8) :: lati
INTEGER(KIND=i16) :: long
@@ -671,11 +672,10 @@ SUBROUTINE test_table2()
f_ptr1 = C_NULL_PTR
f_ptr2 = C_LOC(fill_data(1)%name(1:1))
-
CALL h5tbmake_table_f("Table Title Fill", file_id, table_name_fill, nfields, nrecords, &
dst_size, field_names, dst_offset, field_type, &
chunk_size, f_ptr2, compress, f_ptr1, errcode )
-
+
f_ptr3 = C_LOC(r_data(1)%name(1:1))
CALL h5tbread_table_f(file_id, table_name_fill, nfields, dst_size, dst_offset, dst_sizes, f_ptr3, errcode)